Commit b52d2874 by guomingpang

Merge branch 'dev' of…

Merge branch 'dev' of ssh://xmgit.ixm5.cn:10022/xiaomai-cloud-class/xiaomai-cloud-class-web into dev
parents 1eb551e7 5a0b1d53
...@@ -72,6 +72,7 @@ function getClientEnvironment(publicUrl) { ...@@ -72,6 +72,7 @@ function getClientEnvironment(publicUrl) {
// Useful for determining whether we’re running in production mode. // Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode. // Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development', NODE_ENV: process.env.NODE_ENV || 'development',
BRAND: process.env.BRAND || 'xiaomai',
DEPLOY_ENV: process.env.DEPLOY_ENV, DEPLOY_ENV: process.env.DEPLOY_ENV,
// Useful for resolving the correct path to static assets in `public`. // Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />. // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
"style-loader": "0.23.1", "style-loader": "0.23.1",
"terser-webpack-plugin": "2.3.8", "terser-webpack-plugin": "2.3.8",
"ts-pnp": "1.1.6", "ts-pnp": "1.1.6",
"better-npm-run": "^0.1.0",
"typescript": "^4.0.2", "typescript": "^4.0.2",
"underscore": "^1.10.2", "underscore": "^1.10.2",
"url-loader": "2.3.0", "url-loader": "2.3.0",
...@@ -111,12 +112,30 @@ ...@@ -111,12 +112,30 @@
"start:rc": "cross-env DEPLOY_ENV=rc node scripts/start.js", "start:rc": "cross-env DEPLOY_ENV=rc node scripts/start.js",
"start:gray": "cross-env DEPLOY_ENV=gray node scripts/start.js", "start:gray": "cross-env DEPLOY_ENV=gray node scripts/start.js",
"start:prod": "cross-env DEPLOY_ENV=prod node scripts/start.js", "start:prod": "cross-env DEPLOY_ENV=prod node scripts/start.js",
"build:dev": "cross-env DEPLOY_ENV=dev node --max_old_space_size=4096 scripts/build.js", "start:syoo": "better-npm-run start:syoo",
"build:dev": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js", "build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js", "build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js",
"build:gray": "cross-env DEPLOY_ENV=gray node scripts/build.js", "build:gray": "cross-env DEPLOY_ENV=gray node scripts/build.js",
"build:syoo": "better-npm-run build:syoo",
"build:prod": "cross-env DEPLOY_ENV=prod node scripts/build.js" "build:prod": "cross-env DEPLOY_ENV=prod node scripts/build.js"
}, },
"betterScripts": {
"start:syoo": {
"command": "node scripts/start.js",
"env": {
"DEPLOY_ENV": "",
"BRAND": "syoo"
}
},
"build:syoo": {
"command": "node scripts/build.js",
"env": {
"DEPLOY_ENV": "prod",
"BRAND": "syoo"
}
}
},
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
}, },
...@@ -154,4 +173,4 @@ ...@@ -154,4 +173,4 @@
"pre-push": "node hooks/pre-commit.js" "pre-push": "node hooks/pre-commit.js"
} }
} }
} }
\ No newline at end of file
...@@ -104,11 +104,12 @@ ...@@ -104,11 +104,12 @@
const appTermEnum = getParameterByName('appTermEnum'); const appTermEnum = getParameterByName('appTermEnum');
const code = getParameterByName('code'); const code = getParameterByName('code');
const ticket = getParameterByName('ticket'); const ticket = getParameterByName('ticket');
const corpType = getParameterByName('corpType');
if (!code) { if (!code) {
postJSON('hades/anon/hades/getCorpTrainSuiteId', {}, (res) => { GetJSON('hades/anon/hades/getCorpTrainSuiteId', (res) => {
const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.result}&redirect_uri=${encodeURIComponent(location.href)}&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect` const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.result}&redirect_uri=${encodeURIComponent(location.href)}&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect`
location.href = url location.href = url
}) })
...@@ -133,7 +134,20 @@ ...@@ -133,7 +134,20 @@
} }
function GetJSON(url, callback) {
const ajaxOptions = {
type: 'GET',
url: BASIC_HOST_MAP[env] + url+`?corpType=${corpType}`,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
timeout: 20000,
success(res, status, xhr) {
callback(res)
},
};
$.ajax(ajaxOptions)
}
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError } from 'axios'; import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError } from 'axios';
import { message, Modal } from 'antd'; import { message, Modal } from 'antd';
import { corpType } from '@/domains/brand/constants'
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';
...@@ -24,12 +24,12 @@ interface FetchOptions { ...@@ -24,12 +24,12 @@ interface FetchOptions {
requestType: string, // 请求类型 form为表单类型 json为json类型,默认json类型 requestType: string, // 请求类型 form为表单类型 json为json类型,默认json类型
reject: boolean, reject: boolean,
} }
interface HeadersType{ interface HeadersType {
storeId?:any, storeId?: any,
storeUserId?:any, storeUserId?: any,
userId?:any, userId?: any,
xmtoken?:any, xmtoken?: any,
enterpriseId?:string|null enterpriseId?: string | null
} }
class Axios { class Axios {
static post( static post(
...@@ -40,18 +40,18 @@ class Axios { ...@@ -40,18 +40,18 @@ class Axios {
): Promise<any> { ): Promise<any> {
const _url = `${url}?storeId=${User.getStoreId()}&token=${User.getToken()}&storeUserId=${User.getStoreUserId()}&userId=${User.getUserId()}`; const _url = `${url}?storeId=${User.getStoreId()}&token=${User.getToken()}&storeUserId=${User.getStoreUserId()}&userId=${User.getUserId()}`;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let headerObject:HeadersType={}; let headerObject: HeadersType = {};
if(User.getStoreId()){ if (User.getStoreId()) {
headerObject.storeId = User.getStoreId(); headerObject.storeId = User.getStoreId();
} }
if(User.getStoreUserId()){ if (User.getStoreUserId()) {
headerObject.storeUserId = User.getStoreUserId(); headerObject.storeUserId = User.getStoreUserId();
} }
if(User.getUserId()){ if (User.getUserId()) {
headerObject.userId = User.getUserId(); headerObject.userId = User.getUserId();
} }
if(User.getToken()){ if (User.getToken()) {
headerObject.xmtoken = User.getToken(); headerObject.xmtoken = User.getToken();
} }
if (User.getEnterpriseId()) { if (User.getEnterpriseId()) {
headerObject.enterpriseId = User.getEnterpriseId(); headerObject.enterpriseId = User.getEnterpriseId();
...@@ -65,7 +65,7 @@ class Axios { ...@@ -65,7 +65,7 @@ class Axios {
'Content-Type': options.requestType === 'form' ? 'application/x-www-form-urlencoded' : 'application/json; charset=UTF-8', 'Content-Type': options.requestType === 'form' ? 'application/x-www-form-urlencoded' : 'application/json; charset=UTF-8',
} }
}); });
if (method !== 'GET' && options.requestType === 'form') { if (method !== 'GET' && options.requestType === 'form') {
instance.defaults.transformRequest = [(queryParam): string => { instance.defaults.transformRequest = [(queryParam): string => {
let ret: string = ''; let ret: string = '';
...@@ -92,8 +92,8 @@ class Axios { ...@@ -92,8 +92,8 @@ class Axios {
const { message: ResMessage, success, resultMsg, code: resultCode } = response.data; const { message: ResMessage, success, resultMsg, code: resultCode } = response.data;
if (resultCode === "CROP_DEPLOY_PAST_BETTER") { if (resultCode === "CROP_DEPLOY_PAST_BETTER") {
Modal.warning({ Modal.warning({
title:"服务已到期", title: "服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买", content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: "我知道了" okText: "我知道了"
}) })
} else if (success || resultCode === 0) { } else if (success || resultCode === 0) {
...@@ -104,24 +104,24 @@ class Axios { ...@@ -104,24 +104,24 @@ class Axios {
return Promise.reject(response.data); return Promise.reject(response.data);
}, (error): AxiosPromise => { }, (error): AxiosPromise => {
const requestStatus = error.request.status const requestStatus = error.request.status
switch (requestStatus){ switch (requestStatus) {
case 401: case 401:
User.removeUserId(); User.removeUserId();
User.removeToken(); User.removeToken();
window.RCHistory.replace('/login'); window.RCHistory.replace('/login');
break; break;
case 403: case 403:
message.error('暂无查看权限'); message.error('暂无查看权限');
window.RCHistory.replace('/login'); window.RCHistory.replace('/login');
return Promise.reject(); return Promise.reject();
break; break;
case 504: case 504:
message.error('网络状况不稳定,如果出现数据异常,请刷新页面'); message.error('网络状况不稳定,如果出现数据异常,请刷新页面');
Promise.reject(); Promise.reject();
break; break;
default: default:
message.error(error.message); message.error(error.message);
break; break;
} }
return Promise.reject(error.message); return Promise.reject(error.message);
}); });
...@@ -130,7 +130,9 @@ class Axios { ...@@ -130,7 +130,9 @@ class Axios {
if (method === 'GET') { if (method === 'GET') {
config = Object.assign({ params, url: `${BASIC_HOST}${_url}`, method }); config = Object.assign({ params, url: `${BASIC_HOST}${_url}`, method });
} else { } else {
config = Object.assign({ data: params, url: `${BASIC_HOST}${_url}`, method }); console.log(corpType)
config = Object.assign({ data: { corpType, ...(params || {}) }, url: `${BASIC_HOST}${_url}`, method });
console.log(config,'config')
} }
instance(config).then((res: AxiosResponse): void => { instance(config).then((res: AxiosResponse): void => {
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts * @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
*/ */
import { MapInterface } from '@/domains/basic-domain/interface' import { MapInterface } from '@/domains/basic-domain/interface'
import { path,live } from '@/domains/brand/constants'
// 默认是 dev 环境 // 默认是 dev 环境
const ENV: string = process.env.DEPLOY_ENV || 'dev' const ENV: string = process.env.DEPLOY_ENV || 'dev'
console.log('process.env.DEPLOY_ENV', process) console.log('process.env.DEPLOY_ENV', process.env, ENV, 'hjkkkk')
const BASIC_HOST_MAP: MapInterface = { const BASIC_HOST_MAP: MapInterface = {
dev: 'https://dev-heimdall.xiaomai5.com/', dev: 'https://dev-heimdall.xiaomai5.com/',
dev1: 'https://dev1-heimdall.xiaomai5.com/', dev1: 'https://dev1-heimdall.xiaomai5.com/',
...@@ -23,7 +24,7 @@ const PATH_MAP: MapInterface = { ...@@ -23,7 +24,7 @@ const PATH_MAP: MapInterface = {
dev1: 'https://dev.xiaomai5.com/xiaomai-cloud-class-web/h5.html', dev1: 'https://dev.xiaomai5.com/xiaomai-cloud-class-web/h5.html',
rc: 'https://rc.xiaomai5.com/xiaomai-cloud-class-web/h5.html', rc: 'https://rc.xiaomai5.com/xiaomai-cloud-class-web/h5.html',
gray: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/gray/h5.html', gray: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/gray/h5.html',
prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html', prod: path,
} }
export const YZ_APPId = "yozoqvpO2Hvz8346"; export const YZ_APPId = "yozoqvpO2Hvz8346";
......
export const BRAND: any = process.env.BRAND;
const BrandNameMap: any = {
xiaomai: '小麦企学院',
syoo: '云课堂'
}
const BrandIconMap: any = {
xiaomai: 'https://image.xiaomaiketang.com/xm/bFkRBz7teA.png',
syoo: 'https://image.xiaomaiketang.com/xm/PfDseQHZtB.png'
}
const BrandLogoMap: any = {
xiaomai: 'https://image.xiaomaiketang.com/xm/6k8PPCmywG.png',
syoo: 'https://image.xiaomaiketang.com/xm/T7NRKwrfQE.png'
}
const BrandBannerMap: any = {
xiaomai: 'https://image.xiaomaiketang.com/xm/CDCcdAdaPs.png',
syoo: 'https://image.xiaomaiketang.com/xm/DzMHpX7GWF.png'
}
const PATH_MAP: any = {
prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html',
syoo: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html',
}
const LIVE_SHARE_MAP: any = {
xiaomai: 'https://res.xiaomai0.com/store-live/index.html#/',
syoo: 'https://res.xiaomai0.com/store-live/index.html#/',
}
const CorpType_MAP: any = {
xiaomai: 'X_MAI',
syoo: 'S_YOU',
}
export const brandName: string = BrandNameMap[BRAND];
export const brandIcon: string = BrandIconMap[BRAND];
export const brandLogo: string = BrandLogoMap[BRAND];
export const brandBanner: string = BrandBannerMap[BRAND];
export const path: string = PATH_MAP[BRAND];
export const live: string = LIVE_SHARE_MAP[BRAND];
export const corpType: string = CorpType_MAP[BRAND];
window.brandName = BrandNameMap[BRAND];
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
import { MapInterface } from '@/domains/basic-domain/interface' import { MapInterface } from '@/domains/basic-domain/interface'
import { path, live } from '@/domains/brand/constants'
const ENV: string = process.env.DEPLOY_ENV || 'dev'; const ENV: string = process.env.DEPLOY_ENV || 'dev';
const appIdMap: MapInterface = { const appIdMap: MapInterface = {
...@@ -14,7 +15,7 @@ const appIdMap: MapInterface = { ...@@ -14,7 +15,7 @@ const appIdMap: MapInterface = {
dev1: 'wx3ea60e78ddfa277e', dev1: 'wx3ea60e78ddfa277e',
rc: 'wx5c5a1fb71ecab7bc', rc: 'wx5c5a1fb71ecab7bc',
gray: "wx3dda02036493ada6", // 小麦校讯通 gray: "wx3dda02036493ada6", // 小麦校讯通
prod: 'wx3dda02036493ada6' prod: 'wx3dda02036493ada6',
} }
const shareUrlMap: MapInterface = { const shareUrlMap: MapInterface = {
...@@ -22,7 +23,7 @@ const shareUrlMap: MapInterface = { ...@@ -22,7 +23,7 @@ const shareUrlMap: MapInterface = {
'dev1': 'https://dev.xiaomai5.com/share/show?appid=', 'dev1': 'https://dev.xiaomai5.com/share/show?appid=',
'rc': 'https://rc.xiaomai5.com/share/show?appid=', 'rc': 'https://rc.xiaomai5.com/share/show?appid=',
'prod': 'https://prod.xiaomai5.com/share/show?appid=', 'prod': 'https://prod.xiaomai5.com/share/show?appid=',
'gray': 'https://prod.xiaomai5.com/share/show?appid=' 'gray': 'https://prod.xiaomai5.com/share/show?appid=',
} }
const LIVE_SHARE_MAP: MapInterface = { const LIVE_SHARE_MAP: MapInterface = {
...@@ -30,7 +31,7 @@ const LIVE_SHARE_MAP: MapInterface = { ...@@ -30,7 +31,7 @@ const LIVE_SHARE_MAP: MapInterface = {
dev1: 'https://dev.xiaomai5.com/store-live/index.html#/', dev1: 'https://dev.xiaomai5.com/store-live/index.html#/',
rc: 'https://rc.xiaomai5.com/store-live/index.html#/', rc: 'https://rc.xiaomai5.com/store-live/index.html#/',
gray: 'https://res.xiaomai0.com/store-live/gray/index.html#/', gray: 'https://res.xiaomai0.com/store-live/gray/index.html#/',
prod: 'https://res.xiaomai0.com/store-live/index.html#/', prod: live,
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-24 12:20:57 * @Date: 2020-08-24 12:20:57
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-19 15:48:51 * @LastEditTime: 2021-08-02 17:00:14
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
--> -->
...@@ -22,16 +22,17 @@ ...@@ -22,16 +22,17 @@
content="小麦企学院,企业培训,员工培训,企业大学,企业内训,企业外训,培训计划,培训素材,企培,企训,素材库,培训课程,培训任务,直播课,线上课,图文课,线下活动,知识库,作业,考试,排行榜,培训类别管理,定制培训计划,管理数据,学习数据,企学院,资料共享,培训数字化,数字化培训,培训工具,在线培训,线上培训,培训saas,培训管理,企业微信培训,对客培训,客户培训,直播培训,互联网培训,新员工培训,管理培训,管理者培训,工人培训,制造业培训,餐饮培训,服务业培训,零售培训,门店培训,工厂培训,车间培训,培训补贴,人事培训,财务培训,职场培训,企业学院平台,教育企业学院,教育企业平台,教育平台学院,企业学习,酷学院,小鹅通,企业学院,云学堂,时代光华,云课堂,魔学院,云大学,米知云,授课学堂" content="小麦企学院,企业培训,员工培训,企业大学,企业内训,企业外训,培训计划,培训素材,企培,企训,素材库,培训课程,培训任务,直播课,线上课,图文课,线下活动,知识库,作业,考试,排行榜,培训类别管理,定制培训计划,管理数据,学习数据,企学院,资料共享,培训数字化,数字化培训,培训工具,在线培训,线上培训,培训saas,培训管理,企业微信培训,对客培训,客户培训,直播培训,互联网培训,新员工培训,管理培训,管理者培训,工人培训,制造业培训,餐饮培训,服务业培训,零售培训,门店培训,工厂培训,车间培训,培训补贴,人事培训,财务培训,职场培训,企业学院平台,教育企业学院,教育企业平台,教育平台学院,企业学习,酷学院,小鹅通,企业学院,云学堂,时代光华,云课堂,魔学院,云大学,米知云,授课学堂"
/> />
<!-- <link rel="apple-touch-icon" href="../src/common/images/logo.png" /> --> <!-- <link rel="apple-touch-icon" href="../src/common/images/logo.png" /> -->
<link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" /> <!-- <link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" /> -->
<!-- <link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/WGWCtxiGzE.png"> -->
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_oe5p510553.css" /> <link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_oe5p510553.css" />
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML. Only files inside the `public` folder can be referenced from the HTML.
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
<!-- <!--
This HTML file is a template. This HTML file is a template.
If you open it directly in the browser, you will see an empty page. If you open it directly in the browser, you will see an empty page.
...@@ -64,5 +65,5 @@ ...@@ -64,5 +65,5 @@
To begin the development, run `npm start` or `yarn start`. To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `npm run build` or `yarn build`.
--> -->
</body> </body>
</html> </html>
...@@ -23,12 +23,24 @@ import '@/core/xmTD'; ...@@ -23,12 +23,24 @@ 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'; import BaseService from '@/domains/basic-domain/baseService';
import {brandName,BRAND,brandIcon} from '@/domains/brand/constants'
declare var getParameterByName: any; declare var getParameterByName: any;
declare var window: any; declare var window: any;
window.currentStoreUserInfo = {} window.currentStoreUserInfo = {}
const history = createHashHistory(); const history = createHashHistory();
document.title=brandName;
var iconUrl ='https://image.xiaomaiketang.com/xm/WGWCtxiGzE.png'
if(BRAND !='xiaomai'){
iconUrl =brandIcon
}
var linkzh = document.createElement('link');
linkzh.setAttribute('rel',"shortcut icon");
linkzh.setAttribute('href',iconUrl);
document.head.appendChild(linkzh);
window.RCHistory = _.extend({}, history, { window.RCHistory = _.extend({}, history, {
push: (obj: any) => { push: (obj: any) => {
history.push(obj) history.push(obj)
......
...@@ -26,7 +26,7 @@ export default function LimitTip(props:{total:number,type:string,tip:() => React ...@@ -26,7 +26,7 @@ export default function LimitTip(props:{total:number,type:string,tip:() => React
{ {
isOver ? ( isOver ? (
<> <>
<div style={{marginLeft:"14px",display:"inline-block"}}>当前企业使用人数已达到上限 (<span style={{color:"#333333",fontWeight:"bold"}}>{limitUser}</span>人),将无法添加新员工、新学员,如需增加人数限制,请联系小麦企学院服务平台。</div> <div style={{marginLeft:"14px",display:"inline-block"}}>{`当前企业使用人数已达到上限 (<span style={{color:"#333333",fontWeight:"bold"}}>{limitUser}</span>人),将无法添加新员工、新学员,如需增加人数限制,请联系${window.brandName}服务平台。`}</div>
<ContactWidget trigger="hover" placement="bottom"> <ContactWidget trigger="hover" placement="bottom">
<div className="renew-text">立即续费<span className="icon iconfont" style={{fontSize:"10px"}}>&#59291;</span></div> <div className="renew-text">立即续费<span className="icon iconfont" style={{fontSize:"10px"}}>&#59291;</span></div>
</ContactWidget> </ContactWidget>
......
...@@ -279,7 +279,7 @@ class AddLive extends React.Component { ...@@ -279,7 +279,7 @@ class AddLive extends React.Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) { if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({ Modal.warning({
title: '服务已到期', title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买', content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: '我知道了', okText: '我知道了',
}); });
return; return;
...@@ -541,7 +541,7 @@ class AddLive extends React.Component { ...@@ -541,7 +541,7 @@ class AddLive extends React.Component {
<Breadcrumbs navList={type == 'add' ? '新建直播课' : '编辑直播课'} goBack={this.handleGoBack} /> <Breadcrumbs navList={type == 'add' ? '新建直播课' : '编辑直播课'} goBack={this.handleGoBack} />
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<div className='add-live-page__form'> <div className='add-live-page__form'>
<div className='basic-info__wrap'> <div className='basic-info__wrap'>
......
...@@ -280,7 +280,7 @@ class AddGraphicsCourse extends React.Component { ...@@ -280,7 +280,7 @@ class AddGraphicsCourse extends React.Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) { if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({ Modal.warning({
title: '服务已到期', title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买', content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: '我知道了', okText: '我知道了',
}) })
return return
...@@ -423,7 +423,7 @@ class AddGraphicsCourse extends React.Component { ...@@ -423,7 +423,7 @@ class AddGraphicsCourse extends React.Component {
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<div className='form'> <div className='form'>
......
...@@ -21,492 +21,487 @@ import './GraphicsCourseList.less' ...@@ -21,492 +21,487 @@ import './GraphicsCourseList.less'
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png' const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png'
class GraphicsCourseList extends React.Component { class GraphicsCourseList extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
id: '', // 视频课ID id: '', // 视频课ID
studentIds: [], studentIds: [],
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
selectPlanList: {}, selectPlanList: {},
} }
} }
componentDidMount() { componentDidMount() {
const videoCourseItem = localStorage.getItem('videoCourseItem') const videoCourseItem = localStorage.getItem('videoCourseItem')
if (videoCourseItem) { if (videoCourseItem) {
const _videoCourseItem = JSON.parse(videoCourseItem) const _videoCourseItem = JSON.parse(videoCourseItem)
this.handleShowShareModal(_videoCourseItem, true) this.handleShowShareModal(_videoCourseItem, true)
} }
} }
// 观看数据弹窗 // 观看数据弹窗
handleShowWatchDataModal = (record) => { handleShowWatchDataModal = (record) => {
const watchDataModal = ( const watchDataModal = (
<WatchDataModal <WatchDataModal
type='videoCourseList' type='videoCourseList'
data={record} data={record}
close={() => { close={() => {
this.setState({ this.setState({
watchDataModal: null, watchDataModal: null,
}) })
}} }}
/> />
) )
this.setState({ watchDataModal }) this.setState({ watchDataModal })
} }
handlePlanName = (planArray) => { handlePlanName = (planArray) => {
let planStr = '' let planStr = ''
planArray.forEach((item, index) => { planArray.forEach((item, index) => {
if (index < planArray.length - 1) { if (index < planArray.length - 1) {
planStr = planStr + item.planName + '、' planStr = planStr + item.planName + '、'
} else { } else {
planStr = planStr + item.planName planStr = planStr + item.planName
} }
}) })
return planStr return planStr
} }
// 请求表头 // 请求表头
parseColumns = () => { parseColumns = () => {
const columns = [ const columns = [
{ {
title: '图文课', title: '图文课',
key: 'scheduleName', key: 'scheduleName',
dataIndex: 'scheduleName', dataIndex: 'scheduleName',
width: 321, width: 321,
fixed: 'left', fixed: 'left',
render: (val, record) => { render: (val, record) => {
const { coverUrl } = record const { coverUrl } = record
return ( return (
<div className='record__item'> <div className='record__item'>
{/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */} {/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */}
<img className='course-cover' src={coverUrl || defaultCoverUrl} alt='' /> <img className='course-cover' src={coverUrl || defaultCoverUrl} alt='' />
<Choose> <Choose>
<When condition={record.courseName.length > 25}> <When condition={record.courseName.length > 25}>
<Tooltip title={record.courseName}> <Tooltip title={record.courseName}>
<div className='course-name'>{record.courseName}</div> <div className='course-name'>{record.courseName}</div>
</Tooltip> </Tooltip>
</When> </When>
<Otherwise> <Otherwise>
<div className='course-name'>{record.courseName}</div> <div className='course-name'>{record.courseName}</div>
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
) )
}, },
}, },
{ {
title: '课程分类', title: '课程分类',
key: 'categoryName', key: 'categoryName',
dataIndex: 'categoryName', dataIndex: 'categoryName',
width: 120, width: 120,
render: (val, record) => { render: (val, record) => {
return <div className='record__item'>{record.categorySonName}</div> return <div className='record__item'>{record.categorySonName}</div>
}, },
}, },
{ {
title: '创建人', title: '创建人',
key: 'createName', key: 'createName',
dataIndex: 'createName', dataIndex: 'createName',
width: 100, width: 100,
render: (val) => { render: (val) => {
return ( return (
<div> <div>
{val && ( {val && (
<Tooltip title={val}> <Tooltip title={val}>
<div>{val.length > 4 ? `${val.slice(0, 4)}...` : val}</div> <div>{val.length > 4 ? `${val.slice(0, 4)}...` : val}</div>
</Tooltip> </Tooltip>
)} )}
</div> </div>
) )
}, },
}, },
{ {
title: ( title: (
<span> <span>
<span>学院展示</span> <span>学院展示</span>
<Tooltip <Tooltip
title={ title={
<div> <div>
开启后,学员可在学院内查看到此课程。 开启后,学员可在学院内查看到此课程。
<br /> <br />
关闭后,学院内不再展示此课程,但学员仍可通过分享的海报/链接查看此课程。 关闭后,学院内不再展示此课程,但学员仍可通过分享的海报/链接查看此课程。
</div> </div>
}> }>
<i className='icon iconfont' style={{ marginLeft: '5px', cursor: 'pointer', color: '#bfbfbf', fontSize: '14px', fontWeight: 'normal' }}> <i className='icon iconfont' style={{ marginLeft: '5px', cursor: 'pointer', color: '#bfbfbf', fontSize: '14px', fontWeight: 'normal' }}>
&#xe61d; &#xe61d;
</i> </i>
</Tooltip> </Tooltip>
</span> </span>
), ),
width: 120, width: 120,
dataIndex: 'courseware', dataIndex: 'courseware',
render: (val, item, index) => { render: (val, item, index) => {
return ( return (
<Switch <Switch
size='small' size='small'
checked={item.shelfState === 'YES'} checked={item.shelfState === 'YES'}
defaultChecked={item.shelfState === 'YES' ? true : false} defaultChecked={item.shelfState === 'YES' ? true : false}
onChange={(checked) => this.changeShelfState(index, item, checked)} onChange={(checked) => this.changeShelfState(index, item, checked)}
/> />
) )
}, },
}, },
{ {
title: '观看学员数', title: '观看学员数',
width: 110, width: 110,
key: 'watchUserCount', key: 'watchUserCount',
dataIndex: 'watchUserCount', dataIndex: 'watchUserCount',
render: (val, item) => { render: (val, item) => {
return <div className='watchUserCount'>{val}</div> return <div className='watchUserCount'>{val}</div>
}, },
}, },
{ {
title: '创建时间', title: '创建时间',
width: 181, width: 181,
key: 'created', key: 'created',
dataIndex: 'created', dataIndex: 'created',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val) return window.formatDate('YYYY-MM-DD H:i', val)
}, },
}, },
{ {
title: '最近修改时间', title: '最近修改时间',
width: 181, width: 181,
key: 'updated', key: 'updated',
dataIndex: 'updated', dataIndex: 'updated',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val) return window.formatDate('YYYY-MM-DD H:i', val)
}, },
}, },
{ {
title: '关联项', title: '关联项',
width: 200, width: 200,
key: 'planList', key: 'planList',
dataIndex: 'planList', dataIndex: 'planList',
render: (val, record) => { render: (val, record) => {
return ( return (
<div className='related-task'> <div className='related-task'>
<Choose> <Choose>
<When condition={record.relatedPlanList}> <When condition={record.relatedPlanList}>
<Tooltip title={this.handlePlanName(record.relatedPlanList)} placement='top' arrowPointAtCenter> <Tooltip title={this.handlePlanName(record.relatedPlanList)} placement='top' arrowPointAtCenter>
{record.relatedPlanList.map((item, index) => { {record.relatedPlanList.map((item, index) => {
return ( return (
<span key={item.planId}> <span key={item.planId}>
{item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '} {item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '}
</span> </span>
) )
})} })}
</Tooltip> </Tooltip>
</When> </When>
<Otherwise> <Otherwise>
<span></span> <span></span>
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
) )
}, },
}, },
{ {
title: '操作', title: '操作',
key: 'operate', key: 'operate',
dataIndex: 'operate', dataIndex: 'operate',
width: 210, width: 210,
fixed: 'right', fixed: 'right',
render: (val, record) => { render: (val, record) => {
return ( return (
<div className='operate'> <div className='operate'>
<div className='operate__item' onClick={() => this.handleShowWatchDataModal(record)}> <div className='operate__item' onClick={() => this.handleShowWatchDataModal(record)}>
观看数据 观看数据
</div> </div>
<span className='operate__item split'> | </span> <span className='operate__item split'> | </span>
<div className='operate__item' onClick={() => this.handleShowShareModal(record)}> <div className='operate__item' onClick={() => this.handleShowShareModal(record)}>
分享 分享
</div> </div>
<span className='operate__item split'> | </span> <span className='operate__item split'> | </span>
<Dropdown overlay={this.renderMoreOperate(record)}> <Dropdown overlay={this.renderMoreOperate(record)}>
<span className='more-operate'> <span className='more-operate'>
<span className='operate-text'>更多</span> <span className='operate-text'>更多</span>
<span className='iconfont icon' style={{ color: '#2966FF' }}> <span className='iconfont icon' style={{ color: '#2966FF' }}>
&#xe824; &#xe824;
</span> </span>
</span> </span>
</Dropdown> </Dropdown>
</div> </div>
) )
}, },
}, },
] ]
return columns return columns
} }
handleRelatedModalShow = (item) => { handleRelatedModalShow = (item) => {
const selectPlanList = {} const selectPlanList = {}
if (item.relatedPlanList) { if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => { item.relatedPlanList.map((item, index) => {
selectPlanList[item.planId] = {} selectPlanList[item.planId] = {}
selectPlanList[item.planId].planId = item.planId selectPlanList[item.planId].planId = item.planId
selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }] selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }]
return item return item
}) })
} }
this.setState({ this.setState({
RelatedPlanModalVisible: true, RelatedPlanModalVisible: true,
selectCourseId: item.id, selectCourseId: item.id,
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}) })
} }
closeRelatedPlanModalVisible = () => { closeRelatedPlanModalVisible = () => {
this.setState({ this.setState({
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}) })
} }
onChangeSelectPlanList = (selectPlanList) => { onChangeSelectPlanList = (selectPlanList) => {
this.setState({ this.setState({
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}) })
} }
onConfirmSelectPlanList = () => { onConfirmSelectPlanList = () => {
this.setState( this.setState(
{ {
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}, },
() => { () => {
this.props.onChange() this.props.onChange()
} }
) )
} }
renderMoreOperate = (item) => { renderMoreOperate = (item) => {
return ( return (
<div className='live-course-more-menu'> <div className='live-course-more-menu'>
{(User.getUserRole() === 'CloudManager' || User.getUserRole() === 'StoreManager') && ( {(User.getUserRole() === 'CloudManager' || User.getUserRole() === 'StoreManager') && (
<div <div
className='operate__item' className='operate__item'
key='plan' key='plan'
onClick={() => { onClick={() => {
this.handleRelatedModalShow(item) this.handleRelatedModalShow(item)
}}> }}>
关联培训计划 关联培训计划
</div> </div>
)} )}
<div <div
className='operate__item' className='operate__item'
key='edit' key='edit'
onClick={() => { onClick={() => {
window.RCHistory.push(`/create-graphics-course?type=edit&id=${item.id}`) window.RCHistory.push(`/create-graphics-course?type=edit&id=${item.id}`)
}}> }}>
编辑 编辑
</div> </div>
<div className='operate__item' key='delete' onClick={() => this.handleDeleteGraphicsCourse(item.id)}> <div className='operate__item' key='delete' onClick={() => this.handleDeleteGraphicsCourse(item.id)}>
删除 删除
</div> </div>
</div> </div>
) )
} }
//改变上架状态 //改变上架状态
changeShelfState = (index, item, checked) => { changeShelfState = (index, item, checked) => {
let _shelfState = checked ? 'YES' : 'NO' let _shelfState = checked ? 'YES' : 'NO'
// if(_shelfState==='NO'){ const params = {
// _shelfState = "YES"; courseId: item.id,
// }else{ shelfState: _shelfState,
// _shelfState = "NO" }
// } CourseService.changeVideoShelfState(params).then((res) => {
const params = { if (res.success) {
courseId: item.id, if (_shelfState === 'YES') {
shelfState: _shelfState, message.success('已开启展示')
} } else {
CourseService.changeVideoShelfState(params).then((res) => { message.success('已取消展示')
if (res.success) { }
if (_shelfState === 'YES') { this.props.changeShelfState(index, _shelfState)
message.success('已开启展示') }
} else { })
message.success('已取消展示') }
} // 删除视频课
this.props.changeShelfState(index, _shelfState) handleDeleteGraphicsCourse = (scheduleId) => {
} Modal.confirm({
}) title: '你确定要删除此线上课吗?',
} content: '删除后,学员将不能进行观看。',
// 删除视频课 icon: <span className='icon iconfont default-confirm-icon'>&#xe6f4;</span>,
handleDeleteGraphicsCourse = (scheduleId) => { okText: '确定',
Modal.confirm({ okType: 'danger',
title: '你确定要删除此线上课吗?', cancelText: '取消',
content: '删除后,学员将不能进行观看。', onOk: () => {
icon: <span className='icon iconfont default-confirm-icon'>&#xe6f4;</span>, const param = {
okText: '确定', courseId: scheduleId,
okType: 'danger', storeId: User.getStoreId(),
cancelText: '取消', }
onOk: () => { CourseService.delVideoSchedule(param).then(() => {
const param = { message.success('删除成功')
courseId: scheduleId, this.props.onChange()
storeId: User.getStoreId(), })
} },
CourseService.delVideoSchedule(param).then(() => { })
message.success('删除成功') }
this.props.onChange()
})
},
})
}
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (record, needStr = false) => { handleShowShareModal = (record, needStr = false) => {
const { id, scheduleVideoUrl } = record const { id, scheduleVideoUrl } = record
const htmlUrl = `${LIVE_SHARE}graphics_detail/${id}?id=${User.getStoreId()}` const htmlUrl = `${LIVE_SHARE}graphics_detail/${id}?id=${User.getStoreId()}`
const longUrl = htmlUrl const longUrl = htmlUrl
const { coverUrl, courseName } = record const { coverUrl, courseName } = record
const shareData = { const shareData = {
longUrl, longUrl,
coverUrl, coverUrl,
scheduleVideoUrl, scheduleVideoUrl,
courseName, courseName,
} }
const shareLiveModal = ( const shareLiveModal = (
<ShareLiveModal <ShareLiveModal
needStr={needStr} needStr={needStr}
data={shareData} data={shareData}
type='graphicsClass' type='graphicsClass'
title='图文课' title='图文课'
close={() => { close={() => {
this.setState({ this.setState({
shareLiveModal: null, shareLiveModal: null,
}) })
localStorage.setItem('videoCourseItem', '') localStorage.setItem('videoCourseItem', '')
}} }}
/> />
) )
this.setState({ shareLiveModal }) this.setState({ shareLiveModal })
} }
handleChangeTable = (pagination, filters, sorter) => { handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter const { columnKey, order } = sorter
const { query } = this.props const { query } = this.props
let { order: _order } = query let { order: _order } = query
// 按创建时间升序排序 // 按创建时间升序排序
if (columnKey === 'created' && order === 'ascend') { if (columnKey === 'created' && order === 'ascend') {
_order = 'CREATED_ASC' _order = 'CREATED_ASC'
} }
// 按创建时间降序排序 // 按创建时间降序排序
if (columnKey === 'created' && order === 'descend') { if (columnKey === 'created' && order === 'descend') {
_order = 'CREATED_DESC' _order = 'CREATED_DESC'
} }
// 按更新时间升序排序 // 按更新时间升序排序
if (columnKey === 'updated' && order === 'ascend') { if (columnKey === 'updated' && order === 'ascend') {
_order = 'UPDATED_ASC' _order = 'UPDATED_ASC'
} }
// 按更新时间降序排序 // 按更新时间降序排序
if (columnKey === 'updated' && order === 'descend') { if (columnKey === 'updated' && order === 'descend') {
_order = 'UPDATED_DESC' _order = 'UPDATED_DESC'
} }
const _query = { const _query = {
...query, ...query,
orderEnum: _order, orderEnum: _order,
} }
this.props.onChange(_query) this.props.onChange(_query)
} }
handleRelatedModalShow = (item) => { handleRelatedModalShow = (item) => {
const selectPlanList = {} const selectPlanList = {}
if (item.relatedPlanList) { if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => { item.relatedPlanList.map((item, index) => {
selectPlanList[item.planId] = {} selectPlanList[item.planId] = {}
selectPlanList[item.planId].planId = item.planId selectPlanList[item.planId].planId = item.planId
selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }] selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }]
return item return item
}) })
} }
this.setState({ this.setState({
RelatedPlanModalVisible: true, RelatedPlanModalVisible: true,
selectCourseId: item.id, selectCourseId: item.id,
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}) })
} }
closeRelatedPlanModalVisible = () => { closeRelatedPlanModalVisible = () => {
this.setState({ this.setState({
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}) })
} }
onChangeSelectPlanList = (selectPlanList) => { onChangeSelectPlanList = (selectPlanList) => {
this.setState({ this.setState({
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}) })
} }
onConfirmSelectPlanList = () => { onConfirmSelectPlanList = () => {
this.setState( this.setState(
{ {
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}, },
() => { () => {
this.props.onChange() this.props.onChange()
} }
) )
} }
render() { render() {
const { RelatedPlanModalVisible, selectCourseId, selectPlanList } = this.state const { RelatedPlanModalVisible, selectCourseId, selectPlanList } = this.state
const { dataSource = [], totalCount, query } = this.props const { dataSource = [], totalCount, query } = this.props
const { current, size } = query const { current, size } = query
return ( return (
<div className='video-course-list'> <div className='video-course-list'>
<XMTable <XMTable
renderEmpty={{ renderEmpty={{
image: college, image: college,
description: '暂无数据', description: '暂无数据',
}} }}
rowKey={(record) => record.id} rowKey={(record) => record.id}
dataSource={dataSource} dataSource={dataSource}
columns={this.parseColumns()} columns={this.parseColumns()}
onChange={this.handleChangeTable} onChange={this.handleChangeTable}
pagination={false} pagination={false}
scroll={{ x: 1500 }} scroll={{ x: 1500 }}
bordered bordered
className='video-list-table' className='video-list-table'
/> />
<div className='box-footer'> <div className='box-footer'>
<PageControl <PageControl
current={current - 1} current={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.props.onChange(_query) this.props.onChange(_query)
}} }}
/> />
</div> </div>
{RelatedPlanModalVisible && ( {RelatedPlanModalVisible && (
<RelatedPlanModal <RelatedPlanModal
onClose={this.closeRelatedPlanModalVisible} onClose={this.closeRelatedPlanModalVisible}
visible={RelatedPlanModalVisible} visible={RelatedPlanModalVisible}
selectCourseId={selectCourseId} selectCourseId={selectCourseId}
selectPlanList={selectPlanList} selectPlanList={selectPlanList}
onChange={this.onChangeSelectPlanList} onChange={this.onChangeSelectPlanList}
onConfirm={this.onConfirmSelectPlanList} onConfirm={this.onConfirmSelectPlanList}
/> />
)} )}
{RelatedPlanModalVisible && ( {RelatedPlanModalVisible && (
<RelatedPlanModal <RelatedPlanModal
onClose={this.closeRelatedPlanModalVisible} onClose={this.closeRelatedPlanModalVisible}
visible={RelatedPlanModalVisible} visible={RelatedPlanModalVisible}
selectCourseId={selectCourseId} selectCourseId={selectCourseId}
selectPlanList={selectPlanList} selectPlanList={selectPlanList}
onChange={this.onChangeSelectPlanList} onChange={this.onChangeSelectPlanList}
onConfirm={this.onConfirmSelectPlanList} onConfirm={this.onConfirmSelectPlanList}
/> />
)} )}
{this.state.shareLiveModal} {this.state.shareLiveModal}
{this.state.watchDataModal} {this.state.watchDataModal}
</div> </div>
) )
} }
} }
export default GraphicsCourseList export default GraphicsCourseList
...@@ -373,7 +373,7 @@ class AddOfflineCourse extends React.Component { ...@@ -373,7 +373,7 @@ class AddOfflineCourse extends React.Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) { if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({ Modal.warning({
title: '服务已到期', title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买', content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: '我知道了', okText: '我知道了',
}) })
return return
...@@ -711,7 +711,7 @@ class AddOfflineCourse extends React.Component { ...@@ -711,7 +711,7 @@ class AddOfflineCourse extends React.Component {
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<div className='form'> <div className='form'>
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-23 14:26:26 * @LastEditTime: 2021-08-02 17:00:46
* @Description: 线上课新增/编辑页 * @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
import React from 'react' import React from 'react';
import { Button, Input, message, Modal, Tooltip, Form, Popconfirm, Menu, Dropdown } from 'antd' import { Button, Input, message, Modal, Tooltip, Form, Popconfirm, Menu, Dropdown } from 'antd';
import { FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum' import { FileTypeIcon } from '@/common/constants/academic/lessonEnum';
import { CourseCatalogSelect } from '@/modules/common' import { CourseCatalogSelect } from '@/modules/common';
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 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';
import PreviewCourseModal from '../modal/PreviewCourseModal' import PreviewCourseModal from '../modal/PreviewCourseModal';
import StoreService from '@/domains/store-domain/storeService' import CourseService from '@/domains/course-domain/CourseService';
import CourseService from '@/domains/course-domain/CourseService' import Service from '@/common/js/service';
import Service from '@/common/js/service' import User from '@/common/js/user';
import User from '@/common/js/user' import _ from 'underscore';
import _ from 'underscore' import Upload from '@/core/upload';
import Upload from '@/core/upload' import { randomString } from '@/domains/basic-domain/utils';
import { randomString } from '@/domains/basic-domain/utils' import ImgClipModal from '@/components/ImgClipModal';
import ImgClipModal from '@/components/ImgClipModal' import $ from 'jquery';
import $ from 'jquery' import './AddVideoCourse.less';
import './AddVideoCourse.less' import Bus from '@/core/bus';
import Bus from '@/core/bus'
const { TextArea } = Input;
const { TextArea } = Input const EDIT_BOX_KEY = Math.random();
const EDIT_BOX_KEY = Math.random()
const fieldNames = { label: 'categoryName', value: 'id', children: 'sonCategoryList' }
//添加课程时课程默认的一些值 //添加课程时课程默认的一些值
const defaultShelfState = 'YES' const defaultShelfState = 'YES';
const defaultScheduleMedia = [ const defaultScheduleMedia = [
{ {
contentType: 'INTRO', contentType: 'INTRO',
...@@ -43,23 +41,23 @@ const defaultScheduleMedia = [ ...@@ -43,23 +41,23 @@ const defaultScheduleMedia = [
mediaContent: '', mediaContent: '',
key: EDIT_BOX_KEY, key: EDIT_BOX_KEY,
}, },
] ];
const whetherVisitorsJoin = 'NO' const whetherVisitorsJoin = 'NO';
let cutFlag = false let cutFlag = false;
const SUPPORT_WORD_PDF = [ const SUPPORT_WORD_PDF = [
'application/msword', 'application/msword',
'application/wps-writer', 'application/wps-writer',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/pdf', 'application/pdf',
'application/wps-office.pdf', 'application/wps-office.pdf',
] ];
class AddVideoCourse extends React.Component { class AddVideoCourse extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props);
const id = getParameterByName('id') const id = getParameterByName('id');
const pageType = getParameterByName('type') const pageType = getParameterByName('type');
this.state = { this.state = {
id, // 线上课ID,编辑的时候从URL上带过来 id, // 线上课ID,编辑的时候从URL上带过来
...@@ -95,81 +93,59 @@ class AddVideoCourse extends React.Component { ...@@ -95,81 +93,59 @@ class AddVideoCourse extends React.Component {
mediaNameAlias: '', // 任一视频重命名的名称(气泡框) mediaNameAlias: '', // 任一视频重命名的名称(气泡框)
selectTypeList: ['MP4'], selectTypeList: ['MP4'],
accept: 'video/mp4', accept: 'video/mp4',
} };
} }
componentWillMount() { componentWillMount() {
const { id, pageType } = this.state const { id, pageType } = this.state;
if (pageType === 'edit') { if (pageType === 'edit') {
this.handleFetchScheudleDetail(id) this.handleFetchScheudleDetail(id);
} }
Bus.bind('editorLimit', (editorTextLength) => { Bus.bind('editorLimit', (editorTextLength) => {
this.setState({ this.setState({
editorTextLength, editorTextLength,
}) });
}) });
} }
handleChangeCatalogList = (value, label) => { handleChangeCatalogList = (value, label) => {
this.setState({ categoryId: value, categoryName: label[0] }) this.setState({ categoryId: value, categoryName: label[0] });
} };
// catalogChange = (value, _categoryName) => {
// const categoryName = _.pluck(_categoryName, 'categoryName').join('-')
// const changeValueLength = value.length
// switch (changeValueLength) {
// case 1:
// this.setState({ categoryId: value[0], categoryName })
// break
// case 2:
// this.setState({ categoryId: value[1], categoryName })
// break
// default:
// this.setState({ categoryId: null })
// break
// }
// }
// 获取线上课详情 // 获取线上课详情
handleFetchScheudleDetail = (courseId) => { handleFetchScheudleDetail = (courseId) => {
CourseService.videoScheduleDetail({ CourseService.videoScheduleDetail({
courseId, courseId,
}).then((res) => { }).then((res) => {
const { result = {} } = res || {} const { result = {} } = res || {};
const { courseName, shelfState, whetherVisitorsJoin, courseMediaVOS, categoryId, courseChapterVOList = [] } = result const { courseName, shelfState, whetherVisitorsJoin, courseMediaVOS, categoryId, courseChapterVOList = [] } = result;
let coverId let coverId;
let coverUrl let coverUrl;
let scheduleMedia = [] let scheduleMedia = [];
let scheduleVideoUrl let scheduleVideoUrl;
let hasIntro let hasIntro;
courseMediaVOS.map((item) => { courseMediaVOS.map((item) => {
switch (item.contentType) { switch (item.contentType) {
case 'COVER': case 'COVER':
coverId = item.mediaContent coverId = item.mediaContent;
coverUrl = item.mediaUrl coverUrl = item.mediaUrl;
break break;
case 'INTRO': case 'INTRO':
hasIntro = true hasIntro = true;
this.getTextDetail('introduce', item.mediaUrl) this.getTextDetail('introduce', item.mediaUrl);
break break;
default: default:
break break;
} }
return item return item;
}) });
// let categoryName
// if (categoryTwoName) {
// categoryName = `${categoryOneName}-${categoryTwoName}`
// } else {
// categoryName = `${categoryOneName}`
// }
const _courseChapterVOList = courseChapterVOList.map((item) => { const _courseChapterVOList = courseChapterVOList.map((item) => {
item.mediaName = item.name item.mediaName = item.name;
item.resourceId = item.id item.resourceId = item.id;
return item return item;
}) });
this.setState({ this.setState({
loadintroduce: !hasIntro, loadintroduce: !hasIntro,
...@@ -182,9 +158,9 @@ class AddVideoCourse extends React.Component { ...@@ -182,9 +158,9 @@ class AddVideoCourse extends React.Component {
whetherVisitorsJoin, whetherVisitorsJoin,
categoryId, categoryId,
courseChapterList: _courseChapterVOList, courseChapterList: _courseChapterVOList,
}) });
}) });
} };
getTextDetail = (key, url) => { getTextDetail = (key, url) => {
$.ajax({ $.ajax({
...@@ -193,13 +169,13 @@ class AddVideoCourse extends React.Component { ...@@ -193,13 +169,13 @@ class AddVideoCourse extends React.Component {
url, url,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8', contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
success: (res) => { success: (res) => {
this.setState({ [key]: res, [`load${key}`]: true }) this.setState({ [key]: res, [`load${key}`]: true });
}, },
}) });
} };
handleGoBack = () => { handleGoBack = () => {
const { coverId, courseName, scheduleMedia, courseChapterList, categoryId, shelfState, whetherVisitorsJoin } = this.state const { coverId, courseName, scheduleMedia, courseChapterList, categoryId, shelfState, whetherVisitorsJoin } = this.state;
if ( if (
!courseChapterList.length || !courseChapterList.length ||
!_.isEqual(scheduleMedia, defaultScheduleMedia) || !_.isEqual(scheduleMedia, defaultScheduleMedia) ||
...@@ -218,29 +194,29 @@ class AddVideoCourse extends React.Component { ...@@ -218,29 +194,29 @@ class AddVideoCourse extends React.Component {
onOk: () => { onOk: () => {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/video-course`, pathname: `/video-course`,
}) });
}, },
}) });
} else { } else {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/video-course`, pathname: `/video-course`,
}) });
} }
} };
// 修改表单 // 修改表单
handleChangeForm = (field, value, coverUrl) => { handleChangeForm = (field, value, coverUrl) => {
this.setState({ this.setState({
[field]: value, [field]: value,
coverUrl: coverUrl ? coverUrl : this.state.coverUrl, coverUrl: coverUrl ? coverUrl : this.state.coverUrl,
}) });
} };
// 显示选择学员弹窗 // 显示选择学员弹窗
handleShowSelectStuModal = () => { handleShowSelectStuModal = () => {
this.setState({ studentModal: true }) this.setState({ studentModal: true });
const { studentList, selectedStuList } = this.state const { studentList, selectedStuList } = this.state;
const studentModal = ( const studentModal = (
<SelectStudent <SelectStudent
showTabs={true} showTabs={true}
...@@ -251,35 +227,35 @@ class AddVideoCourse extends React.Component { ...@@ -251,35 +227,35 @@ class AddVideoCourse extends React.Component {
close={() => { close={() => {
this.setState({ this.setState({
studentModal: null, studentModal: null,
}) });
}} }}
/> />
) );
this.setState({ studentModal }) this.setState({ studentModal });
} };
handleSelectStudent = (studentIds) => { handleSelectStudent = (studentIds) => {
let studentList = [] let studentList = [];
_.each(studentIds, (item) => { _.each(studentIds, (item) => {
studentList.push({ studentId: item }) studentList.push({ studentId: item });
}) });
this.setState({ studentList }) this.setState({ studentList });
this.setState({ studentModal: false }) this.setState({ studentModal: false });
} };
// 显示预览弹窗 // 显示预览弹窗
handleShowPreviewModal = () => { handleShowPreviewModal = () => {
const { coverUrl, scheduleVideoUrl, courseName, scheduleMedia, introduce, courseChapterList, categoryName } = this.state const { coverUrl, scheduleVideoUrl, courseName, scheduleMedia, introduce, courseChapterList, categoryName } = this.state;
const courseBasinInfo = { const courseBasinInfo = {
coverUrl, coverUrl,
scheduleVideoUrl, scheduleVideoUrl,
courseName, courseName,
} };
const courseIntroInfo = { const courseIntroInfo = {
liveCourseMediaRequests: scheduleMedia, liveCourseMediaRequests: scheduleMedia,
introduce, introduce,
categoryName, categoryName,
} };
const previewCourseModal = ( const previewCourseModal = (
<PreviewCourseModal <PreviewCourseModal
...@@ -289,35 +265,35 @@ class AddVideoCourse extends React.Component { ...@@ -289,35 +265,35 @@ class AddVideoCourse extends React.Component {
close={() => { close={() => {
this.setState({ this.setState({
previewCourseModal: null, previewCourseModal: null,
}) });
}} }}
courseChapterList={courseChapterList} courseChapterList={courseChapterList}
/> />
) );
this.setState({ previewCourseModal }) this.setState({ previewCourseModal });
} };
// 选择视频 // 选择视频
handleSelectVideo = (addFolderIds, selectedFileList) => { handleSelectVideo = (addFolderIds, selectedFileList) => {
this.setState({ this.setState({
showSelectFileModal: false, showSelectFileModal: false,
}) });
let { courseChapterList } = this.state let { courseChapterList } = this.state;
let _courseChapterList = [...courseChapterList] let _courseChapterList = [...courseChapterList];
if (selectedFileList.length + courseChapterList.length > 20) { if (selectedFileList.length + courseChapterList.length > 20) {
message.warning(`最多只能上传20个文件`) message.warning(`最多只能上传20个文件`);
return return;
} }
selectedFileList.map((file, index) => { selectedFileList.map((file, index) => {
const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file;
const _mediaName = folderName.replace(`.${_.last(folderName.split('.')).toLowerCase()}`, '') const _mediaName = folderName.replace(`.${_.last(folderName.split('.')).toLowerCase()}`, '');
console.log('folderFormat', folderFormat) console.log('folderFormat', folderFormat);
if (folderFormat === 'MP4' || folderFormat === 'video/mp4') { if (folderFormat === 'MP4' || folderFormat === 'video/mp4') {
const videoDom = document.createElement('video') const videoDom = document.createElement('video');
videoDom.src = ossUrl videoDom.src = ossUrl;
videoDom.onloadedmetadata = () => { videoDom.onloadedmetadata = () => {
_courseChapterList.push({ _courseChapterList.push({
mediaContent: resourceId, mediaContent: resourceId,
...@@ -328,13 +304,13 @@ class AddVideoCourse extends React.Component { ...@@ -328,13 +304,13 @@ class AddVideoCourse extends React.Component {
resourceId, resourceId,
mediaUrl: ossUrl, mediaUrl: ossUrl,
sort: _courseChapterList.length, sort: _courseChapterList.length,
}) });
this.setState({ this.setState({
courseChapterList: _courseChapterList, courseChapterList: _courseChapterList,
}) });
} };
} else if (folderFormat === 'WORD' || folderFormat === 'PDF' || SUPPORT_WORD_PDF.indexOf(folderFormat) > -1) { } else if (folderFormat === 'WORD' || folderFormat === 'PDF' || SUPPORT_WORD_PDF.indexOf(folderFormat) > -1) {
const suffix = _.last(folderName.split('.')).toUpperCase() const suffix = _.last(folderName.split('.')).toUpperCase();
_courseChapterList.push({ _courseChapterList.push({
mediaContent: resourceId, mediaContent: resourceId,
contentType: 'SCHEDULE', contentType: 'SCHEDULE',
...@@ -343,47 +319,47 @@ class AddVideoCourse extends React.Component { ...@@ -343,47 +319,47 @@ class AddVideoCourse extends React.Component {
resourceId, resourceId,
mediaUrl: ossUrl, mediaUrl: ossUrl,
sort: _courseChapterList.length, sort: _courseChapterList.length,
}) });
this.setState({ this.setState({
courseChapterList: _courseChapterList, courseChapterList: _courseChapterList,
}) });
} }
}) });
} };
// 校验课节名称 // 校验课节名称
handleValidateChapterName = (chapterName) => { handleValidateChapterName = (chapterName) => {
let hasError = false let hasError = false;
return new Promise((resolve) => { return new Promise((resolve) => {
if (!chapterName) { if (!chapterName) {
this.setState({ this.setState({
chapterNameValidateStatus: 'error', chapterNameValidateStatus: 'error',
chapterNameHelpMsg: '请输入课节名称', chapterNameHelpMsg: '请输入课节名称',
}) });
hasError = true hasError = true;
resolve(false) resolve(false);
return false return false;
} }
if (chapterName.length > 40) { if (chapterName.length > 40) {
this.setState({ this.setState({
chapterNameValidateStatus: 'error', chapterNameValidateStatus: 'error',
chapterNameHelpMsg: '不要超过40字', chapterNameHelpMsg: '不要超过40字',
}) });
hasError = true hasError = true;
resolve(false) resolve(false);
return false return false;
} }
if (!hasError) { if (!hasError) {
resolve(true) resolve(true);
this.setState({ this.setState({
chapterNameValidateStatus: '', chapterNameValidateStatus: '',
chapterNameHelpMsg: '', chapterNameHelpMsg: '',
}) });
} }
}) });
} };
// 保存 // 保存
handleSubmit = () => { handleSubmit = () => {
...@@ -393,8 +369,8 @@ class AddVideoCourse extends React.Component { ...@@ -393,8 +369,8 @@ class AddVideoCourse extends React.Component {
title: '服务已到期', title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买', content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买',
okText: '我知道了', okText: '我知道了',
}) });
return return;
} }
const { const {
...@@ -411,7 +387,7 @@ class AddVideoCourse extends React.Component { ...@@ -411,7 +387,7 @@ class AddVideoCourse extends React.Component {
introduce, introduce,
courseChapterList, courseChapterList,
editorTextLength, editorTextLength,
} = this.state } = this.state;
const commonParams = { const commonParams = {
// videoName, // videoName,
...@@ -426,75 +402,75 @@ class AddVideoCourse extends React.Component { ...@@ -426,75 +402,75 @@ class AddVideoCourse extends React.Component {
whetherVisitorsJoin, whetherVisitorsJoin,
courseType: 'VOICE', courseType: 'VOICE',
courseChapterList, courseChapterList,
} };
// 校验必填字段:课程名称, 课程视频 // 校验必填字段:课程名称, 课程视频
this.handleValidate(courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength).then((res) => { this.handleValidate(courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength).then((res) => {
if (!res) return if (!res) return;
Upload.uploadTextToOSS(introduce, `${randomString()}.txt`, (introduceId) => { Upload.uploadTextToOSS(introduce, `${randomString()}.txt`, (introduceId) => {
this.submitRemote({ id, pageType, commonParams: { ...commonParams, introduceId } }) this.submitRemote({ id, pageType, commonParams: { ...commonParams, introduceId } });
}) });
}) });
} };
submitRemote = ({ id, pageType, commonParams }) => { submitRemote = ({ id, pageType, commonParams }) => {
if (pageType === 'add') { if (pageType === 'add') {
Service.Hades('public/hades/createVideoSchedule', commonParams).then((res) => { Service.Hades('public/hades/createVideoSchedule', commonParams).then((res) => {
if (!res) return if (!res) return;
message.success('新建成功') message.success('新建成功');
window.RCHistory.push({ window.RCHistory.push({
pathname: `/video-course`, pathname: `/video-course`,
}) });
}) });
} else { } else {
const editParams = { const editParams = {
courseId: id, courseId: id,
...commonParams, ...commonParams,
} };
Service.Hades('public/hades/editVideoSchedule', editParams).then((res) => { Service.Hades('public/hades/editVideoSchedule', editParams).then((res) => {
if (!res) return if (!res) return;
message.success('保存成功') message.success('保存成功');
window.RCHistory.push({ window.RCHistory.push({
pathname: `/video-course`, pathname: `/video-course`,
}) });
}) });
} }
} };
handleValidate = (courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength) => { handleValidate = (courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength) => {
return new Promise((resolve) => { return new Promise((resolve) => {
if (!courseName) { if (!courseName) {
message.warning('请输入课程名称') message.warning('请输入课程名称');
resolve(false) resolve(false);
return false return false;
} }
if (!courseChapterList.length) { if (!courseChapterList.length) {
message.warning('请上传课节') message.warning('请上传课节');
resolve(false) resolve(false);
return false return false;
} }
if (!categoryId) { if (!categoryId) {
message.warning('请选择课程分类') message.warning('请选择课程分类');
resolve(false) resolve(false);
return false return false;
} }
if (editorTextLength > 1000) { if (editorTextLength > 1000) {
message.warning('课程简介超过字数限定') message.warning('课程简介超过字数限定');
resolve(false) resolve(false);
return return;
} }
resolve(true) resolve(true);
}) });
} };
handleSelectCover = (file) => { handleSelectCover = (file) => {
if (!file) { if (!file) {
message.info('请选择文件!') message.info('请选择文件!');
return return;
} }
this.setState({ this.setState({
visible: true, visible: true,
imageFile: file, imageFile: file,
}) });
} };
//获取resourceId //获取resourceId
getSignature = (blob, fileName) => { getSignature = (blob, fileName) => {
Upload.uploadBlobToOSS(blob, 'cover' + new Date().valueOf(), null, 'signInfo').then((signInfo) => { Upload.uploadBlobToOSS(blob, 'cover' + new Date().valueOf(), null, 'signInfo').then((signInfo) => {
...@@ -505,77 +481,77 @@ class AddVideoCourse extends React.Component { ...@@ -505,77 +481,77 @@ class AddVideoCourse extends React.Component {
visible: false, visible: false,
}, },
() => this.updateCover() () => this.updateCover()
) );
}) });
} };
updateCover = () => { updateCover = () => {
const { coverClicpPath, coverId } = this.state const { coverClicpPath, coverId } = this.state;
this.setState({ this.setState({
showSelectCoverModal: false, showSelectCoverModal: false,
coverUrl: coverClicpPath, coverUrl: coverClicpPath,
coverId: coverId, coverId: coverId,
}) });
} };
handleRenameCourseChapter = (chapterId, chapterIndex) => { handleRenameCourseChapter = (chapterId, chapterIndex) => {
const { mediaNameAlias } = this.state const { mediaNameAlias } = this.state;
this.handleValidateChapterName(mediaNameAlias).then((res) => { this.handleValidateChapterName(mediaNameAlias).then((res) => {
// 校验不通过不能点确定保存修改课节名称 // 校验不通过不能点确定保存修改课节名称
if (!res) { if (!res) {
return message.warning('重命名失败') return message.warning('重命名失败');
} }
let { courseChapterList } = this.state let { courseChapterList } = this.state;
let _courseChapterList = [] let _courseChapterList = [];
_courseChapterList = courseChapterList.map((item, index) => { _courseChapterList = courseChapterList.map((item, index) => {
if (item.resourceId === chapterId && chapterIndex === index) { if (item.resourceId === chapterId && chapterIndex === index) {
item.mediaName = mediaNameAlias item.mediaName = mediaNameAlias;
item.visible = false item.visible = false;
} }
return item return item;
}) });
this.setState({ this.setState({
courseChapterList: _courseChapterList, courseChapterList: _courseChapterList,
chapterNameValidateStatus: '', chapterNameValidateStatus: '',
chapterNameHelpMsg: '', chapterNameHelpMsg: '',
mediaNameAlias: '', mediaNameAlias: '',
}) });
}) });
} };
handleChangePopConfirmVisible = (chapterId, chapterNameIndex, visible) => { handleChangePopConfirmVisible = (chapterId, chapterNameIndex, visible) => {
let { courseChapterList } = this.state let { courseChapterList } = this.state;
let _courseChapterList = [] let _courseChapterList = [];
_courseChapterList = courseChapterList.map((item, index) => { _courseChapterList = courseChapterList.map((item, index) => {
if (item.resourceId === chapterId && chapterNameIndex === index) { if (item.resourceId === chapterId && chapterNameIndex === index) {
item.visible = visible item.visible = visible;
} else { } else {
item.visible = false item.visible = false;
} }
return item return item;
}) });
this.setState({ this.setState({
courseChapterList: _courseChapterList, courseChapterList: _courseChapterList,
}) });
} };
handleDeleteCourseChapter = (chapterId, chapterIndex) => { handleDeleteCourseChapter = (chapterId, chapterIndex) => {
console.log('chapterId---', chapterId, chapterIndex) console.log('chapterId---', chapterId, chapterIndex);
let { courseChapterList } = this.state let { courseChapterList } = this.state;
let _courseChapterList = courseChapterList.filter((item, index) => { let _courseChapterList = courseChapterList.filter((item, index) => {
return item.resourceId !== chapterId || (item.resourceId === chapterId && chapterIndex !== index) return item.resourceId !== chapterId || (item.resourceId === chapterId && chapterIndex !== index);
}) });
_courseChapterList.map((item, index) => { _courseChapterList.map((item, index) => {
item.sort = index item.sort = index;
}) });
this.setState({ this.setState({
courseChapterList: _courseChapterList, courseChapterList: _courseChapterList,
}) });
} };
renderChapterTitle = (item) => { renderChapterTitle = (item) => {
const { chapterNameValidateStatus, chapterNameHelpMsg } = this.state const { chapterNameValidateStatus, chapterNameHelpMsg } = this.state;
return ( return (
<div className='course-chapter-title-popover'> <div className='course-chapter-title-popover'>
...@@ -594,54 +570,54 @@ class AddVideoCourse extends React.Component { ...@@ -594,54 +570,54 @@ class AddVideoCourse extends React.Component {
mediaNameAlias: e.target.value.trim(), mediaNameAlias: e.target.value.trim(),
}, },
() => { () => {
this.handleValidateChapterName(this.state.mediaNameAlias) this.handleValidateChapterName(this.state.mediaNameAlias);
} }
) );
}} }}
/> />
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
) );
} };
// 上下移动 // 上下移动
handleChangeIndex = (isUp, sortIndex) => { handleChangeIndex = (isUp, sortIndex) => {
const { courseChapterList } = this.state const { courseChapterList } = this.state;
// 第一个上移和最后一个下移不能使用 // 第一个上移和最后一个下移不能使用
if ((isUp && sortIndex === 0) || (!isUp && sortIndex === courseChapterList.length - 1)) { if ((isUp && sortIndex === 0) || (!isUp && sortIndex === courseChapterList.length - 1)) {
return return;
} }
let _courseChapterList = [...courseChapterList] let _courseChapterList = [...courseChapterList];
const temp = courseChapterList[sortIndex] const temp = courseChapterList[sortIndex];
// 若上移 // 若上移
if (isUp) { if (isUp) {
_courseChapterList[sortIndex - 1] = temp _courseChapterList[sortIndex - 1] = temp;
_courseChapterList[sortIndex - 1].sort = sortIndex - 1 _courseChapterList[sortIndex - 1].sort = sortIndex - 1;
_courseChapterList[sortIndex] = courseChapterList[sortIndex - 1] _courseChapterList[sortIndex] = courseChapterList[sortIndex - 1];
_courseChapterList[sortIndex].sort = sortIndex _courseChapterList[sortIndex].sort = sortIndex;
} else { } else {
// 若下移 // 若下移
_courseChapterList[sortIndex + 1] = temp _courseChapterList[sortIndex + 1] = temp;
_courseChapterList[sortIndex + 1].sort = sortIndex + 1 _courseChapterList[sortIndex + 1].sort = sortIndex + 1;
_courseChapterList[sortIndex] = courseChapterList[sortIndex + 1] _courseChapterList[sortIndex] = courseChapterList[sortIndex + 1];
_courseChapterList[sortIndex].sort = sortIndex _courseChapterList[sortIndex].sort = sortIndex;
} }
this.setState({ this.setState({
courseChapterList: _courseChapterList, courseChapterList: _courseChapterList,
}) });
} };
renderTypemenu = () => { renderTypemenu = () => {
return ( return (
<Menu> <Menu>
<Menu.Item> <Menu.Item>
<span <span
onClick={() => { onClick={() => {
this.selectFileType('VIDEO') this.selectFileType('VIDEO');
}}> }}>
视频文件 视频文件
</span> </span>
...@@ -649,34 +625,34 @@ class AddVideoCourse extends React.Component { ...@@ -649,34 +625,34 @@ class AddVideoCourse extends React.Component {
<Menu.Item> <Menu.Item>
<span <span
onClick={() => { onClick={() => {
this.selectFileType('WORD_PDF') this.selectFileType('WORD_PDF');
}}> }}>
资料文件 资料文件
</span> </span>
</Menu.Item> </Menu.Item>
</Menu> </Menu>
) );
} };
selectFileType = (type) => { selectFileType = (type) => {
const { courseChapterList } = this.state const { courseChapterList } = this.state;
if (courseChapterList.length >= 20) { if (courseChapterList.length >= 20) {
message.warning(`最多只能上传20个文件`) message.warning(`最多只能上传20个文件`);
return return;
} }
if (type === 'VIDEO') { if (type === 'VIDEO') {
this.setState({ this.setState({
showSelectFileModal: true, showSelectFileModal: true,
selectTypeList: ['MP4'], selectTypeList: ['MP4'],
accept: 'video/mp4', accept: 'video/mp4',
}) });
} else { } else {
this.setState({ this.setState({
showSelectFileModal: true, showSelectFileModal: true,
selectTypeList: ['DOC', 'DOCX', 'PDF'], selectTypeList: ['DOC', 'DOCX', 'PDF'],
accept: '.doc,.docx,.pdf', accept: '.doc,.docx,.pdf',
}) });
} }
} };
renderToolTipTitle = () => { renderToolTipTitle = () => {
return ( return (
...@@ -684,8 +660,8 @@ class AddVideoCourse extends React.Component { ...@@ -684,8 +660,8 @@ class AddVideoCourse extends React.Component {
<p>视频支持mp4格式,大小不超过2G;</p> <p>视频支持mp4格式,大小不超过2G;</p>
<p>文件支持PDF、docx、doc格式,大小不超过100M</p> <p>文件支持PDF、docx、doc格式,大小不超过100M</p>
</div> </div>
) );
} };
render() { render() {
const { const {
...@@ -709,9 +685,9 @@ class AddVideoCourse extends React.Component { ...@@ -709,9 +685,9 @@ class AddVideoCourse extends React.Component {
imageFile, imageFile,
selectTypeList, selectTypeList,
accept, accept,
} = this.state } = this.state;
const defaultCover = 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png' const defaultCover = 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png';
const isDefaultCover = coverUrl === defaultCover || coverUrl == null const isDefaultCover = coverUrl === defaultCover || coverUrl == null;
return ( return (
<div className='page add-video-course-page'> <div className='page add-video-course-page'>
...@@ -719,7 +695,7 @@ class AddVideoCourse extends React.Component { ...@@ -719,7 +695,7 @@ class AddVideoCourse extends React.Component {
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<div className='form'> <div className='form'>
...@@ -731,7 +707,7 @@ class AddVideoCourse extends React.Component { ...@@ -731,7 +707,7 @@ class AddVideoCourse extends React.Component {
maxLength={40} maxLength={40}
style={{ width: 240 }} style={{ width: 240 }}
onChange={(e) => { onChange={(e) => {
this.handleChangeForm('courseName', e.target.value) this.handleChangeForm('courseName', e.target.value);
}} }}
/> />
</div> </div>
...@@ -814,15 +790,15 @@ class AddVideoCourse extends React.Component { ...@@ -814,15 +790,15 @@ class AddVideoCourse extends React.Component {
chapterNameValidateStatus: '', chapterNameValidateStatus: '',
chapterNameHelpMsg: '', chapterNameHelpMsg: '',
mediaNameAlias: '', mediaNameAlias: '',
}) });
}} }}
onCancel={() => this.handleChangePopConfirmVisible(item.resourceId, index, false)}> onCancel={() => this.handleChangePopConfirmVisible(item.resourceId, index, false)}>
<div <div
className='rename' className='rename'
onClick={() => { onClick={() => {
this.setState({ mediaNameAlias: item.mediaName }, () => { this.setState({ mediaNameAlias: item.mediaName }, () => {
this.handleChangePopConfirmVisible(item.resourceId, index, true) this.handleChangePopConfirmVisible(item.resourceId, index, true);
}) });
}}> }}>
重命名 重命名
</div> </div>
...@@ -833,7 +809,7 @@ class AddVideoCourse extends React.Component { ...@@ -833,7 +809,7 @@ class AddVideoCourse extends React.Component {
</div> </div>
</div> </div>
</div> </div>
) );
})} })}
</div> </div>
</div> </div>
...@@ -846,7 +822,7 @@ class AddVideoCourse extends React.Component { ...@@ -846,7 +822,7 @@ class AddVideoCourse extends React.Component {
<div> <div>
<Button <Button
onClick={() => { onClick={() => {
this.setState({ showSelectCoverModal: true }) this.setState({ showSelectCoverModal: true });
}}>{`${pageType === 'add' && !coverUrl ? '上传' : '修改'}封面`}</Button> }}>{`${pageType === 'add' && !coverUrl ? '上传' : '修改'}封面`}</Button>
<span <span
className={`span ${coverUrl ? 'defalut-span' : ''}`} className={`span ${coverUrl ? 'defalut-span' : ''}`}
...@@ -854,7 +830,7 @@ class AddVideoCourse extends React.Component { ...@@ -854,7 +830,7 @@ class AddVideoCourse extends React.Component {
this.setState({ this.setState({
coverUrl: '', coverUrl: '',
coverId: '', coverId: '',
}) });
}}> }}>
使用默认图 使用默认图
</span> </span>
...@@ -874,7 +850,7 @@ class AddVideoCourse extends React.Component { ...@@ -874,7 +850,7 @@ class AddVideoCourse extends React.Component {
<CourseCatalogSelect <CourseCatalogSelect
value={categoryId} value={categoryId}
onChange={(value, label) => { onChange={(value, label) => {
this.handleChangeCatalogList(value, label) this.handleChangeCatalogList(value, label);
}} }}
/> />
</div> </div>
...@@ -919,7 +895,7 @@ class AddVideoCourse extends React.Component { ...@@ -919,7 +895,7 @@ class AddVideoCourse extends React.Component {
diskList={diskList} diskList={diskList}
addVideo={true} addVideo={true}
onClose={() => { onClose={() => {
this.setState({ showSelectFileModal: false }) this.setState({ showSelectFileModal: false });
}} }}
onSelect={this.handleSelectVideo} onSelect={this.handleSelectVideo}
/> />
...@@ -934,7 +910,7 @@ class AddVideoCourse extends React.Component { ...@@ -934,7 +910,7 @@ class AddVideoCourse extends React.Component {
tooltip='支持文件类型:jpg、jpeg、png' tooltip='支持文件类型:jpg、jpeg、png'
isOpen={showSelectCoverModal} isOpen={showSelectCoverModal}
onClose={() => { onClose={() => {
this.setState({ showSelectCoverModal: false }) this.setState({ showSelectCoverModal: false });
}} }}
onSelect={this.handleSelectCover} onSelect={this.handleSelectCover}
/> />
...@@ -945,14 +921,14 @@ class AddVideoCourse extends React.Component { ...@@ -945,14 +921,14 @@ class AddVideoCourse extends React.Component {
imgUrl={imageFile.ossUrl} imgUrl={imageFile.ossUrl}
onConfirm={this.getSignature} onConfirm={this.getSignature}
onClose={() => { onClose={() => {
this.setState({ visible: false }) this.setState({ visible: false });
}} }}
/> />
)} )}
{this.state.previewCourseModal} {this.state.previewCourseModal}
</div> </div>
) );
} }
} }
export default AddVideoCourse export default AddVideoCourse;
...@@ -7,59 +7,59 @@ import moment from "moment"; ...@@ -7,59 +7,59 @@ import moment from "moment";
export default function HomeTip() { export default function HomeTip() {
const [isOverNum, setIsOverNum] = useState<boolean>(false) const [isOverNum, setIsOverNum] = useState<boolean>(false)
const [tipType, setTipType] = useState(0) //0不显示1即将过期2已过期 const [tipType, setTipType] = useState(0) //0不显示1即将过期2已过期
const [expirationTime, setExpirationTime] = useState("") const [expirationTime, setExpirationTime] = useState("")
const [surplusDay, setSurplusDay] = useState(0) const [surplusDay, setSurplusDay] = useState(0)
const versionInfo = useContext(VersionContext) const versionInfo = useContext(VersionContext)
useEffect(()=> { useEffect(() => {
if (versionInfo) { if (versionInfo) {
setIsOverNum(versionInfo.userNum === -1 ? false : versionInfo.whetherReachUserNum) setIsOverNum(versionInfo.userNum === -1 ? false : versionInfo.whetherReachUserNum)
setSurplusDay(versionInfo.surplusDayTime) setSurplusDay(versionInfo.surplusDayTime)
setExpirationTime(versionInfo.validEndTime) setExpirationTime(versionInfo.validEndTime)
if (versionInfo.stateEnum === "NO") { if (versionInfo.stateEnum === "NO") {
setTipType(2) setTipType(2)
} else if (versionInfo.surplusDayTime === 30 || versionInfo.surplusDayTime <= 7) { } else if (versionInfo.surplusDayTime === 30 || versionInfo.surplusDayTime <= 7) {
setTipType(1) setTipType(1)
}
} }
}
},[versionInfo])
}, [versionInfo])
return (
<div className="home-tip"> return (
{ <div className="home-tip">
(isOverNum || tipType !== 0) && {
(isOverNum || tipType !== 0) &&
<div className="tip"> <div className="tip">
<Carousel dotPosition="left" dots={false} autoplay={true} autoplaySpeed={5000}> <Carousel dotPosition="left" dots={false} autoplay={true} autoplaySpeed={5000}>
{ {
isOverNum && ( isOverNum && (
<div className="content"> <div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>温馨提示:企业使用人数已达上限,将无法新增员工、学员,如需增加人数限制,请联系小麦企学院服务平台。 <span className="icon iconfont" style={{ color: "#FF4F4F", marginRight: "8px" }}>&#xe61d;</span>{`温馨提示:企业使用人数已达上限,将无法新增员工、学员,如需增加人数限制,请联系${window.brandName}服务平台。`}
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget> <ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div> </div>
) )
} }
{ {
tipType === 2 && ( tipType === 2 && (
<div className="content"> <div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>版本到期提醒:当前企业购买的小麦企学院服务已于{moment(versionInfo?.validEndTimeST).format("YYYY-MM-DD HH:mm:ss")}到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~ <span className="icon iconfont" style={{ color: "#FF4F4F", marginRight: "8px" }}>&#xe61d;</span>版本到期提醒:当前企业购买的{`${window.brandName}`}服务已于{moment(versionInfo?.validEndTimeST).format("YYYY-MM-DD HH:mm:ss")}到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget> <ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div> </div>
) )
} }
{ {
tipType === 1 && ( tipType === 1 && (
<div className="content"> <div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>当前企业购买的小麦企学院服务仅剩{surplusDay}天(于{expirationTime}到期),为了不影响使用,建议尽快续费购买哦~ <span className="icon iconfont" style={{ color: "#FF4F4F", marginRight: "8px" }}>&#xe61d;</span>当前企业购买的{`${window.brandName}`}服务仅剩{surplusDay}天(于{expirationTime}到期),为了不影响使用,建议尽快续费购买哦~
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget> <ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div> </div>
) )
} }
</Carousel> </Carousel>
</div> </div>
} }
</div> </div>
) )
} }
\ No newline at end of file \ No newline at end of file
...@@ -22,7 +22,6 @@ import "./KnowledgeBaseList.less"; ...@@ -22,7 +22,6 @@ import "./KnowledgeBaseList.less";
const DEFAULT_SIZE_UNIT = 1000 * 1000 // 将B转换成M const DEFAULT_SIZE_UNIT = 1000 * 1000 // 将B转换成M
const { confirm } = Modal const { confirm } = Modal
const ENV = process.env.DEPLOY_ENV || "dev"
class KnowledgeBaseList extends React.Component { class KnowledgeBaseList extends React.Component {
constructor(props) { constructor(props) {
......
...@@ -19,7 +19,6 @@ import "./LiveList.less"; ...@@ -19,7 +19,6 @@ import "./LiveList.less";
import CourseService from "@/domains/course-domain/CourseService"; import CourseService from "@/domains/course-domain/CourseService";
import User from "@/common/js/user"; import User from "@/common/js/user";
const ENV = process.env.DEPLOY_ENV || "dev";
class VideoList extends React.Component { class VideoList extends React.Component {
constructor(props) { constructor(props) {
......
...@@ -281,7 +281,7 @@ function AddPlan() { ...@@ -281,7 +281,7 @@ function AddPlan() {
<Breadcrumbs navList={type == 'add' ? '新建培训计划' : '编辑培训计划'} goBack={handleGoBack} /> <Breadcrumbs navList={type == 'add' ? '新建培训计划' : '编辑培训计划'} goBack={handleGoBack} />
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<div className='add-plan-page__form'> <div className='add-plan-page__form'>
<div className='basic-info__wrap'> <div className='basic-info__wrap'>
......
...@@ -34,7 +34,7 @@ class ScanFileModal extends React.Component { ...@@ -34,7 +34,7 @@ class ScanFileModal extends React.Component {
style={{ width: 632, objectFit: "cover" }} style={{ width: 632, objectFit: "cover" }}
/> />
)} )}
{fileType === "VIDEO" && ( {(fileType ==="VIDEO" || fileType === "MP4") && (
<div> <div>
<Player <Player
src={item.mediaUrl || item.ossAddress || item.ossUrl} src={item.mediaUrl || item.ossAddress || item.ossUrl}
......
...@@ -5,6 +5,7 @@ import BaseService from "@/domains/basic-domain/baseService"; ...@@ -5,6 +5,7 @@ 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 { Modal, message } from 'antd'; import { Modal, message } from 'antd';
import { brandLogo } from '@/domains/brand/constants'
import './CollegeManagePage.less'; import './CollegeManagePage.less';
import storage from '@/common/js/storage'; import storage from '@/common/js/storage';
...@@ -18,9 +19,9 @@ const roleMap = { ...@@ -18,9 +19,9 @@ const roleMap = {
function ExpirationPopover(props) { function ExpirationPopover(props) {
const [showType, setShowType] = useState(0); //0不显示,1剩余30天,2小于等于7天,3已过期 const [showType, setShowType] = useState(0); //0不显示,1剩余30天,2小于等于7天,3已过期
useEffect(()=> { useEffect(() => {
if (props.surplusDayTime === 0 ) { if (props.surplusDayTime === 0) {
//已过期 //已过期
let loginflag = storage.get("expiration_tip_login") let loginflag = storage.get("expiration_tip_login")
if (loginflag === null || loginflag === "true") { if (loginflag === null || loginflag === "true") {
...@@ -31,7 +32,7 @@ function ExpirationPopover(props) { ...@@ -31,7 +32,7 @@ function ExpirationPopover(props) {
} }
//即将过期 //即将过期
if (props.surplusDayTime === 30 || props.surplusDayTime <= 7) { if (props.surplusDayTime === 30 || props.surplusDayTime <= 7) {
let daysflag = storage.get("expiration_tip"+User.getUserId()+"_days") let daysflag = storage.get("expiration_tip" + User.getUserId() + "_days")
if (daysflag === null || daysflag !== moment().format("YYYYMMDD")) { if (daysflag === null || daysflag !== moment().format("YYYYMMDD")) {
setShowType(2) setShowType(2)
} }
...@@ -52,12 +53,12 @@ function ExpirationPopover(props) { ...@@ -52,12 +53,12 @@ function ExpirationPopover(props) {
// setShowType(2) // setShowType(2)
// } // }
// } // }
},[props.endTime,props.surplusDayTime]) }, [props.endTime, props.surplusDayTime])
function iknow() { function iknow() {
storage.set("expiration_tip_login",false) storage.set("expiration_tip_login", false)
storage.set("expiration_tip"+User.getUserId()+"_days",moment().format("YYYYMMDD")) storage.set("expiration_tip" + User.getUserId() + "_days", moment().format("YYYYMMDD"))
/* /*
if (props.surplusDayTime === 0 ) { if (props.surplusDayTime === 0 ) {
//已过期 //已过期
...@@ -79,27 +80,27 @@ function ExpirationPopover(props) { ...@@ -79,27 +80,27 @@ function ExpirationPopover(props) {
return ( return (
<> <>
{ {
showType === 0 ? ("") :( showType === 0 ? ("") : (
<div className="expirationpopover"> <div className="expirationpopover">
<div className="dialog"> <div className="dialog">
<div className="title">{props.surplusDayTime === 0 ? "服务已到期":"服务到期提醒"}</div> <div className="title">{props.surplusDayTime === 0 ? "服务已到期" : "服务到期提醒"}</div>
{ {
showType === 3 ? ( 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">当前企业购买的{`${window.brandName}`}服务已于<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="tip-text">当前企业购买的{`${window.brandName}`}服务 <span style={{ color: "#FF4F4F" }}>仅剩{props.surplusDayTime}</span>(于<span>{moment(props.endTime).format("YYYY-MM-DD")}</span>到期),为了不影响使用,建议尽快续费购买哦~</div>
) )
} }
<div className="qrcode"> <div className="qrcode">
<img src="https://cdn.xiaomai5.com/qixueyuankehu.png" alt=""></img> <img src="https://cdn.xiaomai5.com/qixueyuankehu.png" alt=""></img>
<div className="des">微信/企业微信扫码咨询</div> <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> </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>
) )
} }
</> </>
...@@ -115,9 +116,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -115,9 +116,9 @@ export default class CollegeManagePage extends React.Component {
list: [], list: [],
enterpriseId: User.getEnterpriseId(), enterpriseId: User.getEnterpriseId(),
isAdmin: false, isAdmin: false,
createStoreList:[], createStoreList: [],
joinStoreList:[], joinStoreList: [],
surplusDayTime:365, //剩余天数 surplusDayTime: 365, //剩余天数
endTime: 0, //有效截至时间 endTime: 0, //有效截至时间
}; };
} }
...@@ -127,7 +128,7 @@ export default class CollegeManagePage extends React.Component { ...@@ -127,7 +128,7 @@ export default class CollegeManagePage extends React.Component {
this.getEnterpriseUser(); this.getEnterpriseUser();
this.getVersion() this.getVersion()
} }
getEnterpriseUser() { getEnterpriseUser() {
const { enterpriseId } = this.state; const { enterpriseId } = this.state;
const params = { const params = {
...@@ -142,16 +143,16 @@ export default class CollegeManagePage extends React.Component { ...@@ -142,16 +143,16 @@ export default class CollegeManagePage extends React.Component {
getVersion() { getVersion() {
BaseService.getLesseeVersionMsg() BaseService.getLesseeVersionMsg()
.then(res=> { .then(res => {
User.setVersion(res.result) User.setVersion(res.result)
User.setExpirationTime(res.result.validEndTime) User.setExpirationTime(res.result.validEndTime)
this.setState({ this.setState({
surplusDayTime: res.result.stateEnum === "NO" ? 0 : res.result.surplusDayTime, surplusDayTime: res.result.stateEnum === "NO" ? 0 : res.result.surplusDayTime,
endTime: res.result.validEndTime endTime: res.result.validEndTime
})
}) })
})
} }
getStoreList() { getStoreList() {
const { enterpriseId } = this.state; const { enterpriseId } = this.state;
if (!enterpriseId) return null; if (!enterpriseId) return null;
...@@ -166,13 +167,13 @@ export default class CollegeManagePage extends React.Component { ...@@ -166,13 +167,13 @@ export default class CollegeManagePage extends React.Component {
User.setStoreId(mainStore.id); User.setStoreId(mainStore.id);
User.setStoreUserId(mainStore.storeUserId); User.setStoreUserId(mainStore.storeUserId);
} }
const createStoreList = list.filter((item)=>{ const createStoreList = list.filter((item) => {
return item.userRole === 'StoreManager' return item.userRole === 'StoreManager'
}) })
const joinStoreList = list.filter((item)=>{ const joinStoreList = list.filter((item) => {
return item.userRole !== 'StoreManager' return item.userRole !== 'StoreManager'
}) })
this.setState({createStoreList:createStoreList,joinStoreList:joinStoreList}) this.setState({ createStoreList: createStoreList, joinStoreList: joinStoreList })
}); });
} }
checkCollege(item, bool) { checkCollege(item, bool) {
...@@ -218,12 +219,12 @@ export default class CollegeManagePage extends React.Component { ...@@ -218,12 +219,12 @@ export default class CollegeManagePage extends React.Component {
} }
handleLogout() { handleLogout() {
BaseService.logout({identifier:User.getIdentifier()}).then((res) => { BaseService.logout({ identifier: User.getIdentifier() }).then((res) => {
User.removeUserId(); User.removeUserId();
User.removeToken(); User.removeToken();
User.removeEnterpriseId(); User.removeEnterpriseId();
User.clearUserInfo(); User.clearUserInfo();
const htmlUrl = `${LIVE_SHARE}store/index?id=${User.getCustomerStoreId()||User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`; const htmlUrl = `${LIVE_SHARE}store/index?id=${User.getCustomerStoreId() || User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`;
window.location.href = htmlUrl; window.location.href = htmlUrl;
}); });
} }
...@@ -239,10 +240,10 @@ export default class CollegeManagePage extends React.Component { ...@@ -239,10 +240,10 @@ 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}/> <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={brandLogo} />
<div className="user"> <div className="user">
<img className="image" src={avatar} /> <img className="image" src={avatar} />
<span className="name">{name}</span> <span className="name">{name}</span>
...@@ -294,13 +295,13 @@ export default class CollegeManagePage extends React.Component { ...@@ -294,13 +295,13 @@ export default class CollegeManagePage extends React.Component {
}} }}
> >
<div className="header"> <div className="header">
<img className="image" src={item.logo || "https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png"} /> <img className="image" src={item.logo || brandLogo} />
<span className="tag">{roleMap[item.userRole]}</span> <span className="tag">{roleMap[item.userRole]}</span>
</div> </div>
<div className="title">{item.storeName}</div> <div className="title">{item.storeName}</div>
<div className="time">{moment(item.createTime).format('YYYY-MM-DD HH:mm')}</div> <div className="time">{moment(item.createTime).format('YYYY-MM-DD HH:mm')}</div>
<div className="control-box"> <div className="control-box">
{item.userRole === 'StoreManager' && item.state === 'VALID' && {item.userRole === 'StoreManager' && item.state === 'VALID' &&
<span <span
className="control-button" className="control-button"
onClick={(e) => { onClick={(e) => {
...@@ -348,76 +349,76 @@ export default class CollegeManagePage extends React.Component { ...@@ -348,76 +349,76 @@ export default class CollegeManagePage extends React.Component {
} }
</div> </div>
</div> </div>
{ joinStoreList.length > 0 && {joinStoreList.length > 0 &&
<div className="join-container"> <div className="join-container">
<div className="title-box"> <div className="title-box">
<span className="title">我加入的({joinStoreList.length})</span> <span className="title">我加入的({joinStoreList.length})</span>
</div> </div>
<div className="college-list"> <div className="college-list">
{joinStoreList.map((item) => ( {joinStoreList.map((item) => (
<div <div
key={item.id} key={item.id}
className={`college-item${item.state === 'VALID' ? '' : ' disabled'}${item.userRole === 'StoreManager' ? ' enabled' : ''}`} className={`college-item${item.state === 'VALID' ? '' : ' disabled'}${item.userRole === 'StoreManager' ? ' enabled' : ''}`}
onClick={() => { onClick={() => {
if (item.state !== 'VALID') { if (item.state !== 'VALID') {
message.warning('学院已停用,请启用后使用或联系学院管理员'); message.warning('学院已停用,请启用后使用或联系学院管理员');
return null; return null;
}; };
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId); User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id; window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId; window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/home') window.RCHistory.push('/home')
}} }}
> >
<div className="header"> <div className="header">
<img className="image" src={item.logo || "https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png"} /> <img className="image" src={item.logo || brandLogo} />
<span className="tag">{roleMap[item.userRole]}</span> <span className="tag">{roleMap[item.userRole]}</span>
</div> </div>
<div className="title">{item.storeName}</div> <div className="title">{item.storeName}</div>
<div className="time">{moment(item.createTime).format('YYYY-MM-DD HH:mm')}</div> <div className="time">{moment(item.createTime).format('YYYY-MM-DD HH:mm')}</div>
<div className="control-box"> <div className="control-box">
{item.userRole === 'StoreManager' && item.state === 'VALID' && !item.mainStore && {item.userRole === 'StoreManager' && item.state === 'VALID' && !item.mainStore &&
<span
className="control-button"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/college-info')
}}
>编辑</span>
}
{((item.userRole === 'StoreManager' && !item.mainStore) || item.state !== 'VALID') &&
<span
className="control-button"
onClick={(e) => {
if (item.state !== 'VALID') return null;
e.preventDefault();
e.stopPropagation();
this.checkCollege(item, false);
}}
>{item.state === 'VALID' ? '停用' : '已停用'}</span>
}
<span <span
className="control-button" className="control-button disable-button"
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
User.setStoreId(item.id); this.changeCollege(item, true);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/college-info')
}} }}
>编辑</span> >启用</span>
} </div>
{((item.userRole === 'StoreManager' && !item.mainStore) || item.state !== 'VALID') &&
<span
className="control-button"
onClick={(e) => {
if (item.state !== 'VALID') return null;
e.preventDefault();
e.stopPropagation();
this.checkCollege(item, false);
}}
>{item.state === 'VALID' ? '停用' : '已停用'}</span>
}
<span
className="control-button disable-button"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
this.changeCollege(item, true);
}}
>启用</span>
</div> </div>
</div> ))}
))} </div>
</div> </div>
</div>
} }
</div> </div>
</div> </div>
) )
} }
......
...@@ -6,6 +6,7 @@ import BaseService from "@/domains/basic-domain/baseService"; ...@@ -6,6 +6,7 @@ import BaseService from "@/domains/basic-domain/baseService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import Breadcrumbs from "@/components/Breadcrumbs"; import Breadcrumbs from "@/components/Breadcrumbs";
import ImgClipModal from '@/components/ImgClipModal' import ImgClipModal from '@/components/ImgClipModal'
import { brandLogo } from '@/domains/brand/constants'
import './CreateCollege.less'; import './CreateCollege.less';
let cutFlag = false; let cutFlag = false;
...@@ -16,7 +17,7 @@ export default class CreateCollege extends React.Component { ...@@ -16,7 +17,7 @@ export default class CreateCollege extends React.Component {
super(props); super(props);
this.state = { this.state = {
avatar: 'https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png', avatar: 'https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png',
logo: 'https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png', logo: brandLogo,
name: '', name: '',
enterpriseId: User.getEnterpriseId(), enterpriseId: User.getEnterpriseId(),
imageFile: null, // 需要被截取的图片 imageFile: null, // 需要被截取的图片
...@@ -111,7 +112,7 @@ export default class CreateCollege extends React.Component { ...@@ -111,7 +112,7 @@ export default class CreateCollege extends React.Component {
<div className="college-manage-page"> <div className="college-manage-page">
<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={brandLogo} />
</div> </div>
</div> </div>
<div className="breadcrumb-wrap"> <div className="breadcrumb-wrap">
...@@ -134,7 +135,7 @@ export default class CreateCollege extends React.Component { ...@@ -134,7 +135,7 @@ export default class CreateCollege extends React.Component {
className="icon iconfont" className="icon iconfont"
onClick={() => { onClick={() => {
this.setState({ this.setState({
logo: 'https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png', logo: brandLogo,
visible: false, visible: false,
}) })
}} }}
......
...@@ -9,7 +9,7 @@ import BaseService from '@/domains/basic-domain/baseService'; ...@@ -9,7 +9,7 @@ import BaseService from '@/domains/basic-domain/baseService';
import storage from '@/common/js/storage'; import storage from '@/common/js/storage';
import axios from 'axios'; import axios from 'axios';
import _ from 'underscore'; import _ from 'underscore';
import user from '@/common/js/user'; import {brandLogo,brandBanner} from '@/domains/brand/constants'
const { TabPane } = Tabs; const { TabPane } = Tabs;
function Login(props) { function Login(props) {
...@@ -156,12 +156,12 @@ function Login(props) { ...@@ -156,12 +156,12 @@ function Login(props) {
return ( return (
<div className='login-page'> <div className='login-page'>
<div className='logo-img-box'> <div className='logo-img-box'>
<img src='https://image.xiaomaiketang.com/xm/6k8PPCmywG.png' className='logo-img' /> <img src={brandLogo} className='logo-img' />
</div> </div>
<div className='login-main'> <div className='login-main'>
<div className='left-banner'> <div className='left-banner'>
<div className='img-box'> <div className='img-box'>
<img src='https://image.xiaomaiketang.com/xm/CDCcdAdaPs.png' alt='' /> <img src={brandBanner} alt='' />
</div> </div>
</div> </div>
<div className='login-box'> <div className='login-box'>
......
...@@ -12,6 +12,7 @@ import classNames from 'classnames'; ...@@ -12,6 +12,7 @@ import classNames from 'classnames';
import User from "@/common/js/user" import User from "@/common/js/user"
import _ from 'underscore'; import _ from 'underscore';
import tBus from '@/core/tbus' import tBus from '@/core/tbus'
import { brandLogo } from '@/domains/brand/constants'
import "./Menu.less"; import "./Menu.less";
import { display } from 'html2canvas/dist/types/css/property-descriptors/display'; import { display } from 'html2canvas/dist/types/css/property-descriptors/display';
import ContactWidget from '@/components/ContactWidget'; import ContactWidget from '@/components/ContactWidget';
...@@ -157,7 +158,7 @@ function Aside(props: any) { ...@@ -157,7 +158,7 @@ function Aside(props: any) {
if (User.getToken()) { if (User.getToken()) {
StoreService.getStoreDetail({ storeId: User.getStoreId() }).then((res) => { StoreService.getStoreDetail({ storeId: User.getStoreId() }).then((res) => {
if (_.isEmpty(res.result.logo)) { if (_.isEmpty(res.result.logo)) {
setTopLogoUrl('https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png'); setTopLogoUrl(brandLogo);
} else { } else {
setTopLogoUrl(res.result.logo); setTopLogoUrl(res.result.logo);
} }
......
...@@ -3,8 +3,9 @@ import qrcode from '@/libs/qrcode/qrcode.js'; ...@@ -3,8 +3,9 @@ import qrcode from '@/libs/qrcode/qrcode.js';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import User from '@/common/js/user'; import User from '@/common/js/user';
import { PATH } from '@/domains/basic-domain/constants'; import { PATH } from '@/domains/basic-domain/constants';
import { corpType } from '@/domains/brand/constants'
import './WechatLogin.less'; import './WechatLogin.less';
const Logo = require('@/common/images/logo.png'); import { brandName, BRAND, brandIcon, brandLogo } from '@/domains/brand/constants'
declare var location: any; declare var location: any;
declare var window: any; declare var window: any;
export default function WechatLogin(props: any) { export default function WechatLogin(props: any) {
...@@ -26,13 +27,13 @@ export default function WechatLogin(props: any) { ...@@ -26,13 +27,13 @@ export default function WechatLogin(props: any) {
if (status === 0) { if (status === 0) {
Service.Hades('anon/hades/getTicket', {}).then((res: any) => { Service.Hades('anon/hades/getTicket', {}).then((res: any) => {
setTicket(res.result); setTicket(res.result);
const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}`; const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}&corpType=${corpType}`;
const qrcodeWrapDom: any = document.querySelector('#qrcode'); const qrcodeWrapDom: any = document.querySelector('#qrcode');
let qrnode = new qrcode({ let qrnode = new qrcode({
text: redirect, text: redirect,
correctLevel: 2, correctLevel: 2,
size: 180, size: 180,
image: 'https://image.xiaomaiketang.com/xm/bFkRBz7teA.png', image: brandIcon,
imageSize: 50, imageSize: 50,
}); });
qrcodeWrapDom.innerHTML = ''; qrcodeWrapDom.innerHTML = '';
......
...@@ -266,7 +266,7 @@ function EmployeesManagePage() { ...@@ -266,7 +266,7 @@ function EmployeesManagePage() {
function handleDeleteWorkWechatEmployeeConfirm(record: RecordTypes) { function handleDeleteWorkWechatEmployeeConfirm(record: RecordTypes) {
return confirm({ return confirm({
title: "你确定要删除此员工吗?", title: "你确定要删除此员工吗?",
content: "管理员需在企业微信后台的“小麦企学院”应用管理中移除此员工,此员工才无法继续登陆小麦企学院", content:`管理员需在企业微信后台的“${window.brandName}”应用管理中移除此员工,此员工才无法继续登陆${window.brandName}`,
icon: ( icon: (
<span className="icon iconfont default-confirm-icon">&#xe839; </span> <span className="icon iconfont default-confirm-icon">&#xe839; </span>
), ),
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
text-align: center; text-align: center;
margin-top: 100%; margin-top: 100%;
.empty-tree-btn { .empty-tree-btn {
color: #2966FF; color: #2966ff;
cursor: pointer; cursor: pointer;
} }
} }
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
width: 234px; width: 234px;
// overflow-x: scroll;
// overflow-y: hidden;
.anticon { .anticon {
color: #999999; color: #999999;
} }
...@@ -52,7 +50,7 @@ ...@@ -52,7 +50,7 @@
white-space: nowrap; white-space: nowrap;
} }
.ant-tree-node-content-wrapper.ant-tree-node-selected { .ant-tree-node-content-wrapper.ant-tree-node-selected {
color: #2966FF; color: #2966ff;
} }
} }
.ant-tree-treenode-selected:hover::before, .ant-tree-treenode-selected:hover::before,
......
...@@ -84,7 +84,7 @@ function AddExam(props: any) { ...@@ -84,7 +84,7 @@ function AddExam(props: any) {
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
source: 0, source: 0,
} }
Service.Hades('public/hades/queryExamPageList', param).then(res=> { Service.Hades('public/hades/queryExamPageList', param).then(res => {
const { result = {} } = res; const { result = {} } = res;
setExamList(result.records || []) setExamList(result.records || [])
}) })
...@@ -155,7 +155,7 @@ function AddExam(props: any) { ...@@ -155,7 +155,7 @@ function AddExam(props: any) {
return return
} }
if(checkExist(param.examName)) { if (checkExist(param.examName)) {
message.warning('此考试名称已存在'); message.warning('此考试名称已存在');
return return
} }
...@@ -275,14 +275,14 @@ function AddExam(props: any) { ...@@ -275,14 +275,14 @@ function AddExam(props: any) {
// 校验考试名称是否存在 // 校验考试名称是否存在
function checkExist(examName: any) { function checkExist(examName: any) {
var result:any = null; var result: any = null;
examList.length > 0 && examList.forEach((item:any) => { examList.length > 0 && examList.forEach((item: any) => {
if (result != null) { if (result != null) {
return result; return result;
} }
if (props.type === 'edit') { if (props.type === 'edit') {
if (item.examName === examName && item.examId !== match.params.id) { if (item.examName === examName && item.examId !== match.params.id) {
result = item; result = item;
} }
} else { } else {
if (item.examName === examName) { if (item.examName === examName) {
...@@ -314,9 +314,9 @@ function AddExam(props: any) { ...@@ -314,9 +314,9 @@ function AddExam(props: any) {
<Breadcrumbs navList={title} goBack={handleGoBack} /> <Breadcrumbs navList={title} goBack={handleGoBack} />
<div className="box"> <div className="box">
<div className="show-tips"> <div className="show-tips">
<ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利" /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> <div className="form"> </div> <div className="form">
<div className="title">基本信息</div> <div className="title">基本信息</div>
<Form <Form
labelCol={{ span: 3 }} labelCol={{ span: 3 }}
...@@ -324,7 +324,7 @@ function AddExam(props: any) { ...@@ -324,7 +324,7 @@ function AddExam(props: any) {
layout="horizontal" layout="horizontal"
> >
<Form.Item label="考试名称" <Form.Item label="考试名称"
validateStatus={(check && (!examName || (examName.length > 40 || checkExist(examName)) )) ? 'error' : ''} validateStatus={(check && (!examName || (examName.length > 40 || checkExist(examName)))) ? 'error' : ''}
help={check && (!examName ? '请输入考试名称' : (examName.length > 40 ? '考试名称最多40字' : (checkExist(examName) && '此考试名称已存在')))} help={check && (!examName ? '请输入考试名称' : (examName.length > 40 ? '考试名称最多40字' : (checkExist(examName) && '此考试名称已存在')))}
required> required>
...@@ -458,7 +458,7 @@ function AddExam(props: any) { ...@@ -458,7 +458,7 @@ function AddExam(props: any) {
onChange={(val) => { setNeedPhone(val ? 'NEED_PHONE_VERIFY' : 'DO_NOT_NEED_PHONE_VERIFY') }} onChange={(val) => { setNeedPhone(val ? 'NEED_PHONE_VERIFY' : 'DO_NOT_NEED_PHONE_VERIFY') }}
></Switch> ></Switch>
<div style={{ position: 'relative', left: 8, color: "#999" }}> <div style={{ position: 'relative', left: 8, color: "#999" }}>
{needPhone == 'NEED_PHONE_VERIFY' ? '已开启,学员需绑定手机号才可参与考试' : '已关闭,学员无需绑定手机号即可参与考试'} {needPhone == 'NEED_PHONE_VERIFY' ? '已开启,学员需绑定手机号才可参与考试' : '已关闭,学员无需绑定手机号即可参与考试'}
</div> </div>
</div> </div>
</Form.Item> </Form.Item>
...@@ -470,7 +470,7 @@ function AddExam(props: any) { ...@@ -470,7 +470,7 @@ function AddExam(props: any) {
onChange={(val) => { setNeedOptionDisorder(val ? 'OPTION_RANDOM' : 'OPTION_SORT') }} onChange={(val) => { setNeedOptionDisorder(val ? 'OPTION_RANDOM' : 'OPTION_SORT') }}
></Switch> ></Switch>
<div style={{ position: 'relative', left: 8, color: "#999" }}> <div style={{ position: 'relative', left: 8, color: "#999" }}>
{needOptionDisorder == 'OPTION_RANDOM' ? '已开启,选项随机排序' : '已关闭,选项按设置顺序排序'} {needOptionDisorder == 'OPTION_RANDOM' ? '已开启,选项随机排序' : '已关闭,选项按设置顺序排序'}
</div> </div>
</div> </div>
......
...@@ -826,7 +826,7 @@ class OperatePaper extends Component { ...@@ -826,7 +826,7 @@ class OperatePaper extends Component {
<Spin spinning={loading}> <Spin spinning={loading}>
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<Form ref={this.formRef} style={{ marginTop: 24, marginBottom: '85px' }}> <Form ref={this.formRef} style={{ marginTop: 24, marginBottom: '85px' }}>
<Form.Item <Form.Item
......
...@@ -303,7 +303,7 @@ class OperateQuestion extends Component { ...@@ -303,7 +303,7 @@ class OperateQuestion extends Component {
/> />
<div className="box"> <div className="box">
<div className="show-tips"> <div className="show-tips">
<ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利" /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<Tabs <Tabs
style={{ marginTop: 32 }} style={{ marginTop: 32 }}
......
...@@ -53,7 +53,7 @@ class BatchImportQuestionModal extends Component { ...@@ -53,7 +53,7 @@ class BatchImportQuestionModal extends Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) { if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({ Modal.warning({
title:"服务已到期", title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买", content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: "我知道了" okText: "我知道了"
}) })
return return
......
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