Commit d9a4bd20 by chenshu

fix:merge

parents 7f27308b 819fc92a
......@@ -1305,7 +1305,6 @@ input:focus {
.ant-modal-content {
.ant-modal-body {
min-height: 130px;
max-height: 600px;
overflow: auto;
// padding-top:0px!important;
.xm-page-control {
......
......@@ -301,7 +301,6 @@ class AddGraphicsCourse extends React.Component {
//上传图片
uploadCoverImage = (imageFile) => {
debugger
const { folderName } = imageFile;
const fileName = window.random_string(16) + folderName.slice(folderName.lastIndexOf("."));
const self = this;
......
......@@ -41,6 +41,10 @@ const App: React.FC = (props: any) => {
}
}, [])
useEffect(() => {
getStorePermission();
}, [window.location.hash])
function getStorePermission() {
const params = {
storeId: User.getStoreId(),
......@@ -120,7 +124,7 @@ const App: React.FC = (props: any) => {
return (
<div id="home">
<Header handleMenuType={handleMenuType} menuType={menuType} />
<Header id="app" handleMenuType={handleMenuType} menuType={menuType} />
<ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}>
<Main menuType={menuType} />
</ConfigProvider>
......
......@@ -45,6 +45,7 @@ export default class CollegeManagePage extends React.Component {
getStoreList() {
const { enterpriseId } = this.state;
if (!enterpriseId) return null;
const params = {
enterpriseId,
userId: User.getUserId(),
......@@ -52,7 +53,7 @@ export default class CollegeManagePage extends React.Component {
Service.Hades('public/customerHades/getStoreListUser', params).then((res) => {
const list = res.result;
if (!User.getStoreId()) {
const mainStore = _.find(list, item => item.mainStore) || {};
const mainStore = _.find(list, item => item.mainStore) || list[0] || {};
User.setStoreId(mainStore.id);
User.setStoreUserId(mainStore.storeUserId);
}
......@@ -73,7 +74,17 @@ export default class CollegeManagePage extends React.Component {
okText: '我知道了',
})
} else {
Modal.confirm({
title: '确定停用吗?',
content: '停用学院,所有学院相关信息不可使用,用户无法继续学习,请谨慎操作!',
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => {
this.changeCollege(item, bool);
},
okText: '停用',
cancelText: '取消',
})
}
})
}
......@@ -94,12 +105,7 @@ export default class CollegeManagePage extends React.Component {
handleLogout() {
BaseService.logout({}).then((res) => {
User.removeUserId();
User.removeToken();
User.removeEnterpriseId();
User.clearUserInfo();
const htmlUrl = `${LIVE_SHARE}store/index?id=${User.getCustomerStoreId()||User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`;
window.location.href = htmlUrl;
window.RCHistory.push('/login');
});
}
......@@ -186,16 +192,7 @@ export default class CollegeManagePage extends React.Component {
if (item.state !== 'VALID') return null;
e.preventDefault();
e.stopPropagation();
Modal.confirm({
title: '确定停用吗?',
content: '禁用学院,所有学院相关信息不可使用,用户无法继续学习,请谨慎操作!',
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => {
this.checkCollege(item, false);
},
okText: '停用',
cancelText: '取消',
})
}}
>{item.state === 'VALID' ? '停用' : '已停用'}</span>
}
......
import User from '@/common/js/user';
import React from 'react';
import Header from './Header'
import Service from "@/common/js/service";
import './ErrorCollege.less';
export default class ErrorCollege extends React.Component {
......@@ -11,6 +12,23 @@ export default class ErrorCollege extends React.Component {
}
}
componentDidMount() {
this.getStorePermission();
}
getStorePermission() {
const params = {
storeId: User.getStoreId(),
};
Service.Hades('public/customerHades/whetherStopStore', params).then((res) => {
if (!res.result) {
window.RCHistory.replace({
pathname: '/home',
})
}
});
}
handleMenuType() {
this.setState({ menuType: !menuType });
}
......@@ -19,7 +37,7 @@ export default class ErrorCollege extends React.Component {
const { menuType } = this.state;
return (
<div className="error-college-page">
<Header handleMenuType={this.handleMenuType} menuType={menuType} />
<Header id="error" handleMenuType={this.handleMenuType} menuType={menuType} />
<div className="error-college-box">
<img src="https://image.xiaomaiketang.com/xm/MQRaYkbr6J.png" className="error-college-image" />
<span className="error-college-tip">{User.getStoreName()}已停用</span>
......
......@@ -78,13 +78,15 @@ function Header(props) {
}
function getStoreList() {
if (!enterpriseId) return null;
const params = {
enterpriseId,
userId: User.getUserId(),
};
Service.Hades('public/customerHades/getStoreListUser', params).then((res) => {
setList(res.result);
listRef.current = res.result;
const newList = _.filter(res.result, item => item.state === 'VALID');
setList(newList);
listRef.current = newList;
});
}
......@@ -182,12 +184,7 @@ function Header(props) {
function handleLogout() {
BaseService.logout({}).then((res) => {
User.removeUserId();
User.removeToken();
User.removeEnterpriseId();
User.clearUserInfo();
const url = `${LIVE_SHARE}store/index?id=${User.getCustomerStoreId()||User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`;
window.location.href = url;
window.RCHistory.push('/login');
});
}
......@@ -267,6 +264,9 @@ function Header(props) {
<RadioGroup
onChange={(e) => {
setStoreId(e.target.value)
User.setStoreId(e.target.value);
window.RCHistory.push('/home');
window.location.reload();
}}
value={storeId}
id="college-radio-group"
......
......@@ -220,6 +220,7 @@
border-radius: 2px;
display: none;
padding-right: 0;
z-index: 10;
&.active {
display: block;
}
......@@ -231,7 +232,7 @@
.ant-radio-group {
overflow-y: auto;
width: 100%;
height: 190px;
max-height: 190px;
}
.ant-radio-wrapper {
display: flex;
......
......@@ -12,11 +12,12 @@
margin-top: 5px !important;
}
.radio-tip {
padding-left: 24px;
font-size: 14px;
font-weight: 400;
color: #999;
line-height: 20px;
white-space: nowrap;
margin: 6px 0 16px;
}
.avatar-box {
text-align: center;
......
......@@ -83,8 +83,8 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
}, [props.choosedItem.nickName]);
const layout = {
labelCol: { span: 5 },
wrapperCol: { span: 12 },
labelCol: { span: 6 },
wrapperCol: { span: 18 },
};
function handleChangeRole(value: string) {
......@@ -210,8 +210,8 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
maskClosable={false}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>}
>
<Row>
<Col span={16}>
<Row style={{ height: 271 }}>
<Col span={18}>
<Form
{...layout}
form={form}
......@@ -223,9 +223,8 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
name="nickName"
rules={[{ required: true }]}
validateStatus={nameStatus}
help={nameErrorMsg}
style={{marginBottom:'-2px !important'}}
className="mt-4"
help={nameErrorMsg || undefined}
style={{ marginBottom: 0 }}
>
<Input
style={{ width: 200 }}
......@@ -239,8 +238,6 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
<Form.Item
label="企业微信账号"
name="weChatAccount"
style={{marginBottom:'-2px !important'}}
className="mt-10"
>
<Tooltip title={props.choosedItem.weChatAccount}>
<div style={{
......@@ -257,8 +254,6 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
rules={[{ required: true }]}
validateStatus={phoneStatus}
help={phoneErrorMessage}
style={{marginBottom:'-2px !important'}}
className="mt-10"
>
<Input
style={{ width: 200 }}
......@@ -290,12 +285,6 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
}}
className="mt5"
>
<Radio value={"CloudOperator"} className="mt-4">
<span style={{ color: "#333" }}>运营师</span>
<p className="radio-tip">
仅可查看/转发培训计划内容,并查看其负责的用户学习进度
</p>
</Radio>
<Radio value={"CloudLecturer"} className="mt-4">
<span style={{ color: "#333" }}>普通讲师</span>
<p className="radio-tip">
......@@ -306,12 +295,18 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
<span style={{ color: "#333" }}>管理员</span>
<p className="radio-tip">可执行学院中所有的操作</p>
</Radio>
<Radio value={"CloudOperator"} className="mt-4">
<span style={{ color: "#333" }}>运营师</span>
<p className="radio-tip">
仅可查看/转发培训计划内容,并查看其负责的用户学习进度
</p>
</Radio>
</RadioGroup>
</Form.Item>
</Form>
</Col>
<Col span={8}>
<Col span={6}>
<div className="avatar-box">
<div className="avatar-text">头像</div>
<div className="avatart-img">
......@@ -319,7 +314,7 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
</div>
<div className="upload-avatar">
<Button id="click_upload_btn" onClick={_onUpload}>
点击上传
上传头像
</Button>
<input
type="file"
......
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