Commit 3bd26be0 by zhangleyuan

Merge branch 'master' into feature/zhangleyuan/20210619/yongzong-optimize

parents 2085ada3 ffead757
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
*/ */
import React from 'react'; import React from 'react';
import { Modal, Input, Table } from 'antd'; import { Modal, Input } from 'antd';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
// import _ from 'underscore';
import './ChooseMembersModal.less'; import './ChooseMembersModal.less';
import User from '@/common/js/user' import User from '@/common/js/user'
import { XMTable } from '@/components'; import { XMTable } from '@/components';
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
import React from 'react'; import React from 'react';
import { Modal, Button, Breadcrumb, Radio, message } from 'antd'; import { Modal, Button, Breadcrumb, message } from 'antd';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import { FILE_TYPE_ICON_MAP, DEFAULT_SIZE_UNIT } from "@/domains/resource-disk/constants"; import { FILE_TYPE_ICON_MAP, DEFAULT_SIZE_UNIT } from "@/domains/resource-disk/constants";
import LottieIcon from '@/components/LottieIcon'; import LottieIcon from '@/components/LottieIcon';
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-31 09:34:31 * @Date: 2020-08-31 09:34:31
* @LastEditors: wufan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-27 10:42:12 * @LastEditTime: 2021-06-24 19:34:21
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -84,7 +84,7 @@ class Axios { ...@@ -84,7 +84,7 @@ class Axios {
}) })
instance.interceptors.response.use((response: AxiosResponse): AxiosResponse | AxiosPromise => { instance.interceptors.response.use((response: AxiosResponse): AxiosResponse | AxiosPromise => {
const { message: ResMessage, success, resultMsg, resultCode } = response.data; const { message: ResMessage, success, resultMsg, resultCode,code} = response.data;
if (success || resultCode === 0) { if (success || resultCode === 0) {
return response; return response;
} else if (!options.reject) { } else if (!options.reject) {
......
...@@ -2,21 +2,26 @@ ...@@ -2,21 +2,26 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-31 09:34:25 * @Date: 2020-08-31 09:34:25
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-12 17:27:08 * @LastEditTime: 2021-06-23 16:08:50
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
import Storage from './storage'; import Storage from './storage';
import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants'; import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants';
declare var window:any;
class User { class User {
getStoreId() {
return Storage.get(`${PREFIX}_storeId`); getVersion() {
return Storage.getObj(`${PREFIX}_version`)
}
getStoreId(){
return window.currentStoreUserInfo.storeId || Storage.get(`${PREFIX}_storeId`)
} }
getEnterpriseId() { getEnterpriseId() {
return Storage.get(`${PREFIX}_enterpriseId`); return window.currentStoreUserInfo.enterpriseId || Storage.get(`${PREFIX}_enterpriseId`);
} }
getStoreName() { getStoreName() {
...@@ -28,21 +33,23 @@ class User { ...@@ -28,21 +33,23 @@ class User {
} }
getStoreUserId() { getStoreUserId() {
return Storage.get(`${PREFIX}_storeUserId`); return window.currentStoreUserInfo.storeUserId || Storage.get(`${PREFIX}_storeUserId`);
} }
getCustomerId() { getCustomerId() {
return Storage.get(`${PREFIX}_customerId`); return Storage.get(`${PREFIX}_customerId`);
} }
getUserId() { getUserId() {
return Storage.get(`${PREFIX}_userId`); return window.currentStoreUserInfo.userId || Storage.get(`${PREFIX}_userId`);
} }
getUserRole() { getUserRole() {
return Storage.get(`${PREFIX}_userRole`); return Storage.get(`${PREFIX}_userRole`);
} }
getToken() { getToken() {
return Storage.get(`${PREFIX}_token`); return window.currentStoreUserInfo.token || Storage.get(`${PREFIX}_token`);
} }
getIsAdmin() { getIsAdmin() {
......
@font-face { @font-face {
font-family: 'iconfont'; /* project id 2223403 */ font-family: 'iconfont'; /* Project id 2223403 */
src: url('//at.alicdn.com/t/font_2223403_boiin24pch6.eot'); src: url('//at.alicdn.com/t/font_2223403_oe5p510553.woff2?t=1624259078391') format('woff2'),
src: url('//at.alicdn.com/t/font_2223403_boiin24pch6.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_2223403_oe5p510553.woff?t=1624259078391') format('woff'),
url('//at.alicdn.com/t/font_2223403_boiin24pch6.woff2') format('woff2'), url('//at.alicdn.com/t/font_2223403_oe5p510553.ttf?t=1624259078391') format('truetype');
url('//at.alicdn.com/t/font_2223403_boiin24pch6.woff') format('woff'),
url('//at.alicdn.com/t/font_2223403_boiin24pch6.ttf') format('truetype'),
url('//at.alicdn.com/t/font_2223403_boiin24pch6.svg#iconfont') format('svg');
} }
.iconfont{ .iconfont {
font-family:"iconfont" !important; font-family: 'iconfont' !important;
font-size:16px; font-size: 16px;
font-style:normal; font-style: normal;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2021-06-15 13:48:35 * @Date: 2021-06-15 13:48:35
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-06-15 14:24:57 * @LastEditTime: 2021-06-24 11:10:45
* @Description: Description * @Description: Description
*/ */
import React from 'react'; import React from 'react';
...@@ -12,6 +12,7 @@ import student from '@/common/lottie/student.json'; ...@@ -12,6 +12,7 @@ import student from '@/common/lottie/student.json';
import activity from '@/common/lottie/activity.json'; import activity from '@/common/lottie/activity.json';
import teacher from '@/common/lottie/teacher.json'; import teacher from '@/common/lottie/teacher.json';
import college from '@/common/lottie/college.json'; import college from '@/common/lottie/college.json';
import search from '@/common/lottie/search.json';
import './LottieIcon.less'; import './LottieIcon.less';
...@@ -29,7 +30,8 @@ const ANIMATION_DATA_MAP: { ...@@ -29,7 +30,8 @@ const ANIMATION_DATA_MAP: {
student, student,
activity, activity,
teacher, teacher,
college college,
search
} }
function LottieIcon(props: LottieIconInterface) { function LottieIcon(props: LottieIconInterface) {
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-04-27 20:35:34 * @Date: 2020-04-27 20:35:34
* @LastEditors: wufan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-03-26 16:14:09 * @LastEditTime: 2021-06-23 14:14:20
* @Description: * @Description:
*/ */
...@@ -23,8 +23,8 @@ import User from '@/common/js/user'; ...@@ -23,8 +23,8 @@ import User from '@/common/js/user';
import Service from "@/common/js/service"; import Service from "@/common/js/service";
declare var getParameterByName: any; declare var getParameterByName: any;
declare var window: any;
window.currentStoreUserInfo = {}
const history = createHashHistory(); const history = createHashHistory();
window.RCHistory = _.extend({}, history, { window.RCHistory = _.extend({}, history, {
...@@ -65,6 +65,10 @@ if (getParameterByName('code') && isWeiXin()) { ...@@ -65,6 +65,10 @@ if (getParameterByName('code') && isWeiXin()) {
User.setUserId(res.result.loginInfo.userId); User.setUserId(res.result.loginInfo.userId);
User.setToken(res.result.loginInfo.xmToken); User.setToken(res.result.loginInfo.xmToken);
User.setEnterpriseId(res.result.enterpriseId); User.setEnterpriseId(res.result.enterpriseId);
window.currentStoreUserInfo = {}
window.currentStoreUserInfo.userId = res.result.loginInfo.userId;
window.currentStoreUserInfo.token = res.result.loginInfo.xmToken;
window.currentStoreUserInfo.enterpriseId = res.result.enterpriseId;
mount() mount()
}) })
} else { } else {
......
...@@ -8,17 +8,16 @@ ...@@ -8,17 +8,16 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
import PageControl from "@/components/PageControl"; import { CheckBox, PageControl } from "@/components";
import { CheckBox } from "@/components";
import { Button, Table, Modal, message, Input } from "antd"; import { Button, Table, Modal, message, Input } from "antd";
import Service from '@/common/js/service'; import { XMTable } from '@/components';
import college from '@/common/lottie/college.json';
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import EmployeeAddOrEditModal from "../store-manage/EmployeeAddOrEditModal"; import EmployeeAddOrEditModal from "../store-manage/EmployeeAddOrEditModal";
import User from "@/common/js/user"; import User from "@/common/js/user";
import "./EmployeeManage.less"; import "./EmployeeManage.less";
import ChooseMembersModal from "./modal/ChooseMembersModal"; import ChooseMembersModal from "./modal/ChooseMembersModal";
import SetEmployeeModal from "./modal/SetEmployeeModal";
const { confirm } = Modal; const { confirm } = Modal;
const { Search } = Input; const { Search } = Input;
...@@ -364,7 +363,11 @@ function EmployeeManage() { ...@@ -364,7 +363,11 @@ function EmployeeManage() {
} }
</div> </div>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={employeeList} dataSource={employeeList}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-30 15:57:40 * @LastEditTime: 2021-06-21 11:13:15
* @Description: 学员管理页面 * @Description: 学员管理页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -11,13 +11,15 @@ import React, { useEffect, useState } from "react"; ...@@ -11,13 +11,15 @@ import React, { useEffect, useState } from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
import { PageControl } from "@/components"; import { PageControl } from "@/components";
import { Table, Input, DatePicker, Select, Button, message } from "antd"; import { Input, DatePicker, Select, Button, message } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import ChooseMembersModal from "./modal/ChooseMembersModal"; import ChooseMembersModal from "./modal/ChooseMembersModal";
import { XMTable } from '@/components';
import college from '@/common/lottie/college.json';
import "./UserManagePage.less"; import "./UserManagePage.less";
import moment from "moment"; import moment from "moment";
const { Option } = Select; const { Option } = Select;
const { Search } = Input; const { Search } = Input;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
...@@ -198,7 +200,11 @@ function UserManagePage() { ...@@ -198,7 +200,11 @@ function UserManagePage() {
>添加学员</Button> >添加学员</Button>
} }
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={userList} dataSource={userList}
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
import React from 'react'; import React from 'react';
import { Modal, Input, Table, message, Tooltip, Empty } from 'antd'; import { Modal, Input, message, Tooltip } from 'antd';
import { XMTable } from '@/components'; import { XMTable } from '@/components';
import college from '@/common/lottie/college.json';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import User from '@/common/js/user' import User from '@/common/js/user'
import SetEmployeeModal from "./SetEmployeeModal"; import SetEmployeeModal from "./SetEmployeeModal";
...@@ -319,7 +320,7 @@ class ChooseMembersModal extends React.Component { ...@@ -319,7 +320,7 @@ class ChooseMembersModal extends React.Component {
pagination={false} pagination={false}
scroll={{ y: 290}} scroll={{ y: 290}}
renderEmpty={{ renderEmpty={{
image: searchKey ? search : '', image: searchKey ? search : college,
description: <div> description: <div>
<div style={{ color: '#333' }}>暂无数据</div> <div style={{ color: '#333' }}>暂无数据</div>
<div style={{ color: '#666', padding: '0 32px', fontSize: '12px' }}>需要先将员工添加到企微可见范围后,员工才会出现在这里</div> <div style={{ color: '#666', padding: '0 32px', fontSize: '12px' }}>需要先将员工添加到企微可见范围后,员工才会出现在这里</div>
...@@ -346,7 +347,11 @@ class ChooseMembersModal extends React.Component { ...@@ -346,7 +347,11 @@ class ChooseMembersModal extends React.Component {
<span className={ (selectUserList.length > 0) ? 'span-right-l' : null }>清空</span> <span className={ (selectUserList.length > 0) ? 'span-right-l' : null }>清空</span>
</div> </div>
<div className='container-right-body'> <div className='container-right-body'>
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
rowKey={(record) => record.enterpriseVisibleUserId} rowKey={(record) => record.enterpriseVisibleUserId}
dataSource={selectUserList} dataSource={selectUserList}
columns={this.selectedColumnsRight()} columns={this.selectedColumnsRight()}
......
...@@ -125,7 +125,9 @@ ...@@ -125,7 +125,9 @@
.ant-empty-normal { .ant-empty-normal {
margin: 120px 0 !important; margin: 120px 0 !important;
} }
.ant-empty {
margin-top: 76px;
}
.avatar{ .avatar{
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @Description: 大班直播、互动班课列表的筛选组件 * @Description: 大班直播、互动班课列表的筛选组件
*/ */
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import { Row, Input, Select ,Tooltip} from 'antd'; import { Row, Input, Select ,Tooltip} from 'antd';
import RangePicker from "@/modules/common/DateRangePicker"; import RangePicker from "@/modules/common/DateRangePicker";
...@@ -86,7 +86,7 @@ function PlanFilter(props) { ...@@ -86,7 +86,7 @@ function PlanFilter(props) {
}; };
StoreService.getStoreUserBasicPage( _query).then((res) => { StoreService.getStoreUserBasicPage( _query).then((res) => {
const { result = {} } = res; const { result = {} } = res;
const { records = [], total = 0, hasNext } = result; const { records = [], hasNext } = result;
const list = current > 1 ? creatorList.concat(records) : records; const list = current > 1 ? creatorList.concat(records) : records;
setHasNext(hasNext); setHasNext(hasNext);
setCreatorList(list); setCreatorList(list);
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-07-10 10:30:49 * @Date: 2019-07-10 10:30:49
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-24 16:29:05 * @LastEditTime: 2021-06-22 17:47:02
* @Description: * @Description:
*/ */
import React, { useContext, useEffect, useState } from 'react'; import React, { useContext, useEffect, useState } from 'react';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import { ConfigProvider, message } from 'antd'; import { ConfigProvider, message, Layout } from 'antd';
import Header from './Header' import Header from './Header'
import Menu from './Menu' import Menu from './Menu'
import Main from './Main' import Main from './Main'
...@@ -20,6 +20,8 @@ import Service from "@/common/js/service"; ...@@ -20,6 +20,8 @@ import Service from "@/common/js/service";
import Bus from '@/core/tbus'; import Bus from '@/core/tbus';
import { func } from 'prop-types'; import { func } from 'prop-types';
const { Footer, Sider, Content } = Layout;
declare var window: any; declare var window: any;
const App: React.FC = (props: any) => { const App: React.FC = (props: any) => {
...@@ -29,7 +31,7 @@ const App: React.FC = (props: any) => { ...@@ -29,7 +31,7 @@ const App: React.FC = (props: any) => {
const [menuType, setMenuType] = useState(true); const [menuType, setMenuType] = useState(true);
const enterpriseId = User.getEnterpriseId(); const enterpriseId = User.getEnterpriseId();
window.ctx = ctx; window.ctx = ctx;
useEffect(() => { useEffect(() => {
getStoreAndUserInfo(); getStoreAndUserInfo();
...@@ -60,24 +62,36 @@ const App: React.FC = (props: any) => { ...@@ -60,24 +62,36 @@ const App: React.FC = (props: any) => {
async function getStoreAndUserInfo() { async function getStoreAndUserInfo() {
await (enterpriseId ? getStoreInfo() : getStoreGroupAndStoreList()); await (enterpriseId ? getStoreInfo() : getStoreGroupAndStoreList());
} }
function getStoreInfo() { function getStoreInfo() {
console.log("currentStoreUserInfo",window.currentStoreUserInfo);
const params = { const params = {
storeId: User.getStoreId(), storeId: User.getStoreId(),
userId: User.getUserId(), userId: User.getUserId(),
}; };
Service.Hades('public/customerHades/getStoreAndUserMsg', params).then((res) => { Service.Hades('public/customerHades/getStoreAndUserMsg', params).then((res) => {
const { id, storeUserId, storeName, userRole, storeType } = res.result; if(res.success){
User.setStoreId(id); const { id, storeUserId, storeName, userRole, storeType } = res.result;
User.setStoreUserId(storeUserId); User.setStoreId(id);
User.setStoreName(storeName); User.setStoreUserId(storeUserId);
Bus.trigger('storeNameChange',storeName); User.setStoreName(storeName);
User.setUserRole(userRole); Bus.trigger('storeNameChange',storeName);
User.setStoreType(storeType); User.setUserRole(userRole);
setStoreUserId(storeUserId) User.setStoreType(storeType);
getUserPermission(); setCurrentStoreUserInfo(id,storeUserId)
setStoreUserId(storeUserId);
getUserPermission();
}
}) })
} }
function setCurrentStoreUserInfo(storeId:any,storeUserId:any){
window.currentStoreUserInfo.storeId = storeId;
window.currentStoreUserInfo.storeUserId = storeUserId;
window.currentStoreUserInfo.userId = User.getUserId();
window.currentStoreUserInfo.token = User.getToken();
window.currentStoreUserInfo.enterpriseId = User.getEnterpriseId();
}
function getStoreGroupAndStoreList() { function getStoreGroupAndStoreList() {
...@@ -97,6 +111,7 @@ const App: React.FC = (props: any) => { ...@@ -97,6 +111,7 @@ const App: React.FC = (props: any) => {
Bus.trigger('storeNameChange', storeName); Bus.trigger('storeNameChange', storeName);
User.setUserRole(userRole); User.setUserRole(userRole);
User.setStoreType(storeType); User.setStoreType(storeType);
setCurrentStoreUserInfo(id,storeUserId);
ctx.dispatch(setStoreGroupList(storeGroupVOS)) ctx.dispatch(setStoreGroupList(storeGroupVOS))
ctx.dispatch(setStoreList(storeVOS)); ctx.dispatch(setStoreList(storeVOS));
setStoreUserId(storeUserId) setStoreUserId(storeUserId)
...@@ -122,6 +137,15 @@ const App: React.FC = (props: any) => { ...@@ -122,6 +137,15 @@ const App: React.FC = (props: any) => {
return ( return (
<div id="home"> <div id="home">
{/* <Layout>
<Sider><Menu menuType={menuType} handleMenuType={handleMenuType} /></Sider>
<Layout>
<Header id="app" handleMenuType={handleMenuType} menuType={menuType} />
<ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}>
<Main menuType={menuType} />
</ConfigProvider>
</Layout>
</Layout> */}
<Header id="app" handleMenuType={handleMenuType} menuType={menuType} /> <Header id="app" handleMenuType={handleMenuType} menuType={menuType} />
<ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}> <ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}>
<Main menuType={menuType} /> <Main menuType={menuType} />
......
...@@ -179,6 +179,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -179,6 +179,9 @@ export default class CollegeManagePage extends React.Component {
return null; return null;
}; };
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/home') window.RCHistory.push('/home')
}} }}
> >
...@@ -196,6 +199,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -196,6 +199,9 @@ export default class CollegeManagePage extends React.Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/college-info') window.RCHistory.push('/college-info')
}} }}
>编辑</span> >编辑</span>
...@@ -250,6 +256,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -250,6 +256,9 @@ export default class CollegeManagePage extends React.Component {
return null; return null;
}; };
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/home') window.RCHistory.push('/home')
}} }}
> >
...@@ -267,6 +276,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -267,6 +276,9 @@ export default class CollegeManagePage extends React.Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/college-info') window.RCHistory.push('/college-info')
}} }}
>编辑</span> >编辑</span>
......
...@@ -10,6 +10,7 @@ import './CreateCollege.less'; ...@@ -10,6 +10,7 @@ import './CreateCollege.less';
let cutFlag = false; let cutFlag = false;
export default class CreateCollege extends React.Component { export default class CreateCollege extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -18,6 +19,7 @@ export default class CreateCollege extends React.Component { ...@@ -18,6 +19,7 @@ export default class CreateCollege extends React.Component {
name: '', name: '',
enterpriseId: User.getEnterpriseId(), enterpriseId: User.getEnterpriseId(),
}; };
this.loginInputRef = React.createRef()
} }
componentDidMount() { componentDidMount() {
...@@ -200,11 +202,11 @@ export default class CreateCollege extends React.Component { ...@@ -200,11 +202,11 @@ export default class CreateCollege extends React.Component {
</div> </div>
<div className="create-box"> <div className="create-box">
<div className="image-box"> <div className="image-box">
<img className="image" src="https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png"/> <img className="image" src={logo}/>
<div className="image-mask"> <div className="image-mask">
<span <span
className="icon iconfont" className="icon iconfont"
onClick={() => this.refs.logoInput.click()} onClick={() => this.loginInputRef.current.click()}
>&#xe6f5;</span> >&#xe6f5;</span>
<span <span
className="icon iconfont" className="icon iconfont"
...@@ -241,7 +243,7 @@ export default class CreateCollege extends React.Component { ...@@ -241,7 +243,7 @@ export default class CreateCollege extends React.Component {
type="file" type="file"
accept="image/*" accept="image/*"
value={""} value={""}
ref="logoInput" ref={this.loginInputRef}
style={{ display: "none" }} style={{ display: "none" }}
onChange={this.handleSelectCover} onChange={this.handleSelectCover}
/> />
......
@import "../../core/variables.less"; @import '../../core/variables.less';
@top-height: 60px; @top-height: 60px;
@icon-color: #939393; @icon-color: #939393;
.top-container { .top-container {
...@@ -7,16 +7,23 @@ ...@@ -7,16 +7,23 @@
left: 0; left: 0;
right: 0; right: 0;
height: @top-height; height: @top-height;
background-color: #2966FF; background-color: #2966ff;
// z-index:2; // z-index:2;
&::after{ &::after {
content:''; content: '';
width:100%; width: 100%;
height:60px; height: 60px;
background: linear-gradient(180deg, #2966FF 0%, rgba(41, 102, 255, 0.82) 29%, rgba(41, 102, 255, 0.58) 55%, rgba(41, 102, 255, 0.27) 77%, rgba(7, 78, 255, 0) 100%); background: linear-gradient(
position:absolute; 180deg,
z-index:2; #2966ff 0%,
top:59px; rgba(41, 102, 255, 0.82) 29%,
rgba(41, 102, 255, 0.58) 55%,
rgba(41, 102, 255, 0.27) 77%,
rgba(7, 78, 255, 0) 100%
);
position: absolute;
z-index: 2;
top: 59px;
} }
.logo { .logo {
display: inline-block; display: inline-block;
...@@ -26,7 +33,7 @@ ...@@ -26,7 +33,7 @@
.logo-name { .logo-name {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #2966FF; color: #2966ff;
line-height: 20px; line-height: 20px;
vertical-align: middle; vertical-align: middle;
font-weight: bold; font-weight: bold;
...@@ -204,7 +211,7 @@ ...@@ -204,7 +211,7 @@
cursor: pointer; cursor: pointer;
} }
.college-name { .college-name {
color:#FFFFFF; color: #ffffff;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
...@@ -213,9 +220,9 @@ ...@@ -213,9 +220,9 @@
.icon { .icon {
font-size: 14px; font-size: 14px;
margin-left: 8px; margin-left: 8px;
color: #FFF; color: #fff;
&:hover { &:hover {
color:#FFF; color: #fff;
} }
} }
} }
...@@ -283,7 +290,7 @@ ...@@ -283,7 +290,7 @@
align-items: center; align-items: center;
.store-name { .store-name {
font-size: 14px; font-size: 14px;
color: #FFF; color: #fff;
line-height: 49px; line-height: 49px;
margin-left: 8px; margin-left: 8px;
white-space: nowrap; white-space: nowrap;
...@@ -296,17 +303,17 @@ ...@@ -296,17 +303,17 @@
width: 1px; width: 1px;
height: 16px; height: 16px;
background-color: #f4f4f4; background-color: #f4f4f4;
margin-right:16px; margin-right: 16px;
} }
} }
.right-box { .right-box {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.right-bg-img{ .right-bg-img {
img{ img {
width:277px; width: 277px;
height:60px; height: 60px;
} }
} }
.link-to-store { .link-to-store {
...@@ -315,90 +322,91 @@ ...@@ -315,90 +322,91 @@
line-height: 49px; line-height: 49px;
.text { .text {
font-size: 14px; font-size: 14px;
color: #FFF; color: #fff;
line-height: 49px; line-height: 49px;
margin-left: 7px; margin-left: 7px;
} }
.iconfont { .iconfont {
color: #FFF; color: #fff;
} }
.link { .link {
cursor: pointer; cursor: pointer;
position: relative; position: relative;
.link-btn{ .link-btn {
padding:3px 12px; padding: 3px 12px;
border: 1px solid rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 4px; border-radius: 4px;
&:hover{ &:hover {
border: 1px solid rgba(255, 255, 255, 1); border: 1px solid rgba(255, 255, 255, 1);
} }
} }
.store-popover { .store-popover {
position: absolute;
display: none; display: none;
width: 216px;
height: 260px;
top: 49px;
left: 0;
background-color: #fff;
flex-wrap: wrap;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
z-index: 10;
.pc-url {
display: flex;
justify-content: space-between;
width: 100%;
height: 56px;
padding: 16px;
border-bottom: 1px solid #e8e8e8;
.name {
width: 70px;
font-size: 14px;
color: #333333;
line-height: 20px;
}
.url-link {
color: #2966ff;
font-size: 14px;
line-height: 20px;
}
}
.h5-url {
width: 100%;
.name,
.tip {
width: 70px;
font-size: 14px;
color: #333333;
line-height: 52px;
margin: 0 auto;
}
#h5-qrcode {
width: 110px;
height: 110px;
margin: 0 auto;
}
.tip {
line-height: 41px;
width: 130px;
}
}
} }
&:hover { &:hover {
.store-popover { .store-popover {
position: absolute;
display: flex; display: flex;
width: 216px;
height: 260px;
top: 49px;
left: 0;
background-color: #fff;
flex-wrap: wrap;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
z-index: 10;
.pc-url {
display: flex;
justify-content: space-between;
width: 100%;
height: 56px;
padding: 16px;
border-bottom: 1px solid #e8e8e8;
.name {
width: 70px;
font-size: 14px;
color: #333333;
line-height: 20px;
}
.url-link {
color: #2966FF;
font-size: 14px;
line-height: 20px;
}
}
.h5-url {
width: 100%;
.name,
.tip {
width: 70px;
font-size: 14px;
color: #333333;
line-height: 52px;
margin: 0 auto;
}
#h5-qrcode {
width: 110px;
height: 110px;
margin: 0 auto;
}
.tip {
line-height: 41px;
width: 130px;
}
}
} }
} }
} }
.share { .share,
.help {
cursor: pointer; cursor: pointer;
margin-left: 16px; margin-left: 16px;
.share-btn{ .share-btn,
padding:3px 12px; .help-btn {
padding: 3px 12px;
border: 1px solid rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 4px; border-radius: 4px;
&:hover{ &:hover {
border: 1px solid rgba(255, 255, 255, 1); border: 1px solid rgba(255, 255, 255, 1);
} }
} }
...@@ -529,7 +537,7 @@ ...@@ -529,7 +537,7 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
color:#FFF; color: #fff;
} }
} }
} }
...@@ -588,7 +596,7 @@ ...@@ -588,7 +596,7 @@
.user-detail { .user-detail {
position: relative; position: relative;
padding-bottom: 16px; padding-bottom: 16px;
border-bottom: 1px solid #E8E8E8; border-bottom: 1px solid #e8e8e8;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -625,7 +633,7 @@ ...@@ -625,7 +633,7 @@
cursor: pointer; cursor: pointer;
color: #333; color: #333;
.menu-before { .menu-before {
color: #BFBFBF; color: #bfbfbf;
margin-right: 8px; margin-right: 8px;
font-size: 14px; font-size: 14px;
} }
......
@import url("../../core/variables.less"); @import url('../../core/variables.less');
.login-page { .login-page {
position: static; position: static;
font-family: "微软雅黑"; font-family: '微软雅黑';
padding: 0; padding: 0;
min-width: 1200px; min-width: 1200px;
background: #F4F6FA; background: #f4f6fa;
height: 100%; height: 100%;
overflow-y: hidden; overflow-y: hidden;
.logo-img-box{ .logo-img-box {
position: absolute; position: absolute;
top:24px; top: 24px;
right:32px; right: 32px;
z-index:1; z-index: 1;
.logo-img{ .logo-img {
width:120px; width: 120px;
display: inline-block; display: inline-block;
} }
} }
.login-main { .login-main {
min-width: 1200px; min-width: 1200px;
display: flex; display: flex;
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
width: 540px; width: 540px;
height: 100vh; height: 100vh;
.img-box { .img-box {
background: #2966FF; background: #2966ff;
width: 540px; width: 540px;
height: 100vh; height: 100vh;
img { img {
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
} }
} }
} }
...@@ -50,10 +50,10 @@ ...@@ -50,10 +50,10 @@
height: 256px; height: 256px;
background: rgba(41, 102, 255, 0.05); background: rgba(41, 102, 255, 0.05);
position: absolute; position: absolute;
top:0; top: 0;
left: 0; left: 0;
&.right-bottom-block { &.right-bottom-block {
top:auto; top: auto;
left: auto; left: auto;
bottom: 0; bottom: 0;
right: 0; right: 0;
...@@ -90,11 +90,11 @@ ...@@ -90,11 +90,11 @@
height: 420px; height: 420px;
position: absolute; position: absolute;
left: 50%; left: 50%;
top:50%; top: 50%;
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
overflow: hidden; overflow: hidden;
background-color: #ffffff; background-color: #ffffff;
border-radius: 4px; border-radius: 4px;
.ant-tabs-tab-btn { .ant-tabs-tab-btn {
color: #999999; color: #999999;
font-size: 18px; font-size: 18px;
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
.ant-tabs-tab-active { .ant-tabs-tab-active {
.ant-tabs-tab-btn { .ant-tabs-tab-btn {
color: #333333; color: #333333;
font-weight:500!important; font-weight: 500 !important;
} }
} }
.ant-tabs-nav::before { .ant-tabs-nav::before {
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
} }
.ant-tabs-tab { .ant-tabs-tab {
text-align: center; text-align: center;
margin:0; margin: 0;
} }
.ant-tabs > .ant-tabs-nav .ant-tabs-nav-list { .ant-tabs > .ant-tabs-nav .ant-tabs-nav-list {
margin: 0 auto; margin: 0 auto;
...@@ -128,13 +128,7 @@ ...@@ -128,13 +128,7 @@
width: 280px; width: 280px;
height: 100%; height: 100%;
background: @primary; background: @primary;
background: -webkit-gradient( background: -webkit-gradient(linear, left top, left bottom, from(#ffaa1a), to(#ff8634)) !important;
linear,
left top,
left bottom,
from(#ffaa1a),
to(#ff8634)
) !important;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
-webkit-flex-direction: column; -webkit-flex-direction: column;
...@@ -197,8 +191,8 @@ ...@@ -197,8 +191,8 @@
} }
} }
} }
.login-form{ .login-form {
margin-top:32px; margin-top: 32px;
} }
.qrcode { .qrcode {
display: none; display: none;
...@@ -281,7 +275,7 @@ ...@@ -281,7 +275,7 @@
font-weight: 500; font-weight: 500;
color: #333; color: #333;
&::after { &::after {
content: ""; content: '';
display: block; display: block;
width: 24px; width: 24px;
height: 4px; height: 4px;
...@@ -383,12 +377,12 @@ ...@@ -383,12 +377,12 @@
border-radius: 3px; border-radius: 3px;
margin-top: 60px; margin-top: 60px;
font-size: 14px; // font-weight: 300; font-size: 14px; // font-weight: 300;
color:#2966FF; color: #2966ff;
&:hover { &:hover {
color: #2966FF; color: #2966ff;
} }
&::before { &::before {
content: ""; content: '';
display: block; display: block;
height: 20px; height: 20px;
width: 1px; width: 1px;
...@@ -416,7 +410,7 @@ ...@@ -416,7 +410,7 @@
} }
.refresh { .refresh {
font-size: 14px; font-size: 14px;
color: #2966FF; color: #2966ff;
cursor: pointer; cursor: pointer;
} }
} }
...@@ -466,10 +460,10 @@ ...@@ -466,10 +460,10 @@
transition: all 0.3s; transition: all 0.3s;
cursor: pointer; cursor: pointer;
border: none; border: none;
text-align:center; text-align: center;
&:hover { &:hover {
opacity: 0.7; opacity: 0.7;
background: #5C8AFF; background: #5c8aff;
} }
} }
} }
......
...@@ -12,31 +12,28 @@ ...@@ -12,31 +12,28 @@
width: @xm-left-width; width: @xm-left-width;
background: @menu-bakg; background: @menu-bakg;
color: #333; color: #333;
.topLogo { .top-ctrl {
height: 62px; display: flex;
background: rgba(255, 255, 255, 0.5); align-items: center;
.img1 { .topLogo {
width: 138px; height: 60px;
height: 35px; background: rgba(255, 255, 255, 0.5);
margin-left: 19px; .img1 {
margin-top: 13px; width: 138px;
} height: 35px;
.img0 { margin: 15px 0 15px 8px;
display: none; }
width: 35px;
height: 35px;
margin-left: 10px;
margin-top: 13px;
} }
} .menu-type-icon{
.menu-type-icon{ margin: 8px 14px 0px 4px;
margin:4px 0 0px 150px; cursor: pointer;
cursor: pointer; .icon{
.icon{ font-size:14px;
font-size:14px; color:#5E606A;
color:#5E606A; }
} }
} }
.ant-menu { .ant-menu {
padding-left: 0 !important; padding-left: 0 !important;
color: #333; color: #333;
...@@ -67,7 +64,7 @@ ...@@ -67,7 +64,7 @@
.icon-img{ .icon-img{
width:18px; width:18px;
height:18px; height:18px;
margin-right:16px; margin-right:6px;
} }
.listType { .listType {
width: 5px; width: 5px;
......
import React, { useContext, useEffect, useRef, useState } from 'react'; import React, { Key, useContext, useEffect, useRef, useState } from 'react';
import { import {
withRouter, withRouter,
} from 'react-router-dom'; } from 'react-router-dom';
...@@ -10,7 +10,6 @@ import StoreService from "@/domains/store-domain/storeService"; ...@@ -10,7 +10,6 @@ import StoreService from "@/domains/store-domain/storeService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import _ from 'underscore'; import _ from 'underscore';
import "./Menu.less"; import "./Menu.less";
console.log('2021-06-17')
const { SubMenu } = Menu; const { SubMenu } = Menu;
function Aside(props: any) { function Aside(props: any) {
...@@ -19,8 +18,7 @@ function Aside(props: any) { ...@@ -19,8 +18,7 @@ function Aside(props: any) {
const [selectKey, setSelectKey] = useState(); const [selectKey, setSelectKey] = useState();
const [openKeys, setOpenKeys] = useState(['']); const [openKeys, setOpenKeys] = useState(['']);
const [topLogoUrl, setTopLogoUrl] = useState("") const [topLogoUrl, setTopLogoUrl] = useState("")
const logoImg0Ref = useRef<any>() const [collapsed, setCollapsed] = useState(false)
const logoImg1Ref = useRef<any>()
const rootSubmenuKeys = _.pluck(menuList, 'groupCode'); const rootSubmenuKeys = _.pluck(menuList, 'groupCode');
useEffect(() => { useEffect(() => {
const link = props.location.pathname; const link = props.location.pathname;
...@@ -40,7 +38,7 @@ function Aside(props: any) { ...@@ -40,7 +38,7 @@ function Aside(props: any) {
}, [props.location.pathname]) }, [props.location.pathname])
useEffect(()=> { useEffect(()=> {
getTopLeftLogo() getTopLeftLogo()
}) },[])
function getTopLeftLogo() { function getTopLeftLogo() {
if (User.getToken()) { if (User.getToken()) {
StoreService.getStoreDetail({storeId:User.getStoreId()}) StoreService.getStoreDetail({storeId:User.getStoreId()})
...@@ -56,34 +54,37 @@ function Aside(props: any) { ...@@ -56,34 +54,37 @@ function Aside(props: any) {
} }
function toggleMenu(item: any) { function toggleMenu(item: any) {
window.RCHistory.push(item.link) window.RCHistory.push(item.link)
} if (!menuType) {
function onOpenChange(key: any) { setOpenKeys([])
if (openKeys.includes(key)) {
setOpenKeys([]);
} else {
setOpenKeys([key]);
} }
} }
function handleMenu() { function onOpenChange(key: Key[]) {
handleMenuType(); if (typeof key === "string") {
if (openKeys.includes(key)) {
setOpenKeys([]);
} else {
setOpenKeys([key]);
}
}
} }
useEffect(()=> {
if (!logoImg0Ref.current || !logoImg1Ref.current) { function onOpenChangeForHover(key: Key[]) {
if (menuType) {
return return
} }
if (!menuType) { if (typeof key === "string") {
if (topLogoUrl.indexOf("xiaomaiketang.com") < 0) { if (openKeys.includes(key)) {
logoImg0Ref.current.style.display = "none" setOpenKeys([]);
logoImg1Ref.current.style.display = "none"
} else { } else {
logoImg0Ref.current.style.display = "inline" setOpenKeys([key]);
logoImg1Ref.current.style.display = "none"
} }
} else {
logoImg0Ref.current.style.display = "none"
logoImg1Ref.current.style.display = "inline"
} }
},[menuType]) }
function handleMenu() {
handleMenuType();
setCollapsed(!collapsed)
}
return ( return (
<div <div
...@@ -94,9 +95,9 @@ function Aside(props: any) { ...@@ -94,9 +95,9 @@ function Aside(props: any) {
: "left-container left-container-vertical" : "left-container left-container-vertical"
} }
> >
<div className="top-ctrl">
<div className="topLogo"> <div className="topLogo">
<img ref={logoImg0Ref} src="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" alt="" className="img0"></img> { menuType && <img src={topLogoUrl} alt="" className="img1"></img> }
<img ref={logoImg1Ref} src={topLogoUrl} alt="" className="img1"></img>
</div> </div>
<div className="menu-type-icon" onClick={handleMenu}> <div className="menu-type-icon" onClick={handleMenu}>
{menuType ? ( {menuType ? (
...@@ -113,14 +114,17 @@ function Aside(props: any) { ...@@ -113,14 +114,17 @@ function Aside(props: any) {
</span> </span>
)} )}
</div> </div>
</div>
<div className="left"> <div className="left">
<div className="nav"> <div className="nav">
<Menu <Menu
style={{ minHeight: "100%", background: '#0E1935' }} style={menuType ? { minHeight: "100%", background: '#0E1935' }:{minHeight: "100%", background: '#0E1935',width:"56px" }}
selectedKeys={selectKey} selectedKeys={selectKey}
openKeys={openKeys} openKeys={menuType ? openKeys : []}
inlineCollapsed={false} onOpenChange={onOpenChange}
inlineCollapsed={collapsed}
mode={menuType ? "inline" : "vertical"} mode={menuType ? "inline" : "vertical"}
> >
{ {
...@@ -129,19 +133,19 @@ function Aside(props: any) { ...@@ -129,19 +133,19 @@ function Aside(props: any) {
return null; return null;
} }
if (item.children) { if (item.children) {
return <SubMenu key={item.groupCode} style={{ marginTop: 0 }} className="first-menu-item" title={<div > return <SubMenu
{/* <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> */} key={item.groupCode}
<img src={item.img} className="icon-img"></img> style={{ marginTop: 0 }}
{menuType && icon={<img src={item.img} className="icon-img"></img>}
<span>{item.groupName}</span> title={menuType ? <span>{item.groupName}</span> : ""}
}</div> onTitleClick={() => onOpenChange(item.groupCode)}
} onTitleClick={() => onOpenChange(item.groupCode)}> >
{ {
item.children.map((_item: any, _index: any) => { item.children.map((_item: any, _index: any) => {
if (ctx.xmState.storeUserPermissionList.indexOf(_item.groupCode) === -1) { if (ctx.xmState.storeUserPermissionList.indexOf(_item.groupCode) === -1) {
return null; return null;
} }
return <Menu.Item onClick={() => { toggleMenu(_item) }} style={{ marginTop: 0 }} key={_item.groupCode + index + _index}> return <Menu.Item onClick={() => { toggleMenu(_item) }} style={{ marginTop: 0 }} key={_item.groupCode + index + _index} >
<span className="name">{_item.groupName}</span> <span className="name">{_item.groupName}</span>
</Menu.Item> </Menu.Item>
...@@ -149,18 +153,12 @@ function Aside(props: any) { ...@@ -149,18 +153,12 @@ function Aside(props: any) {
} }
</SubMenu> </SubMenu>
} else { } else {
return <Menu.Item onClick={() => { toggleMenu(item) }} key={item.groupCode} className="first-menu-item"> return <Menu.Item
{/* <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> */} onClick={() => { toggleMenu(item) }}
{selectKey === item.groupCode ? key={item.groupCode}
<img src={item.selectImg} className="icon-img"></img> icon={<img src={selectKey === item.groupCode ? item.selectImg : item.img} className="icon-img"></img>}
: >
<img src={item.img} className="icon-img"></img> {menuType ? item.groupName : ""}
}
{menuType &&
<span>{item.groupName}</span>
}
</Menu.Item> </Menu.Item>
} }
}) })
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
color: #999999; color: #999999;
line-height: 20px; line-height: 20px;
} }
.rwm{ .rwm {
position: relative; position: relative;
width: 210px; width: 210px;
height: 210px; height: 210px;
...@@ -18,30 +18,29 @@ ...@@ -18,30 +18,29 @@
margin-top: 24px; margin-top: 24px;
border: 1px solid #e8e8e8; border: 1px solid #e8e8e8;
border-radius: 2px; border-radius: 2px;
padding:15px; padding: 15px;
.error{ .error {
position: absolute; position: absolute;
width: 200px; width: 200px;
height: 200px; height: 200px;
background: rgba(255, 255, 255, 0.95); background: rgba(255, 255, 255, 0.95);
display: flex; display: flex;
align-items:center; align-items: center;
justify-content:center; justify-content: center;
left:5px; left: 5px;
top:5px; top: 5px;
div{ div {
margin: 0 10px; margin: 0 10px;
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
}
} .ope {
.ope{ cursor: pointer;
cursor: pointer; color: rgba(82, 137, 250, 1);
color:rgba(82, 137, 250, 1); }
}
} }
} }
......
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import qrcode from "@/libs/qrcode/qrcode.js"; 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 './WechatLogin.less' import './WechatLogin.less';
const Logo = require("@/common/images/logo.png") const Logo = require('@/common/images/logo.png');
declare var location: any; declare var location: any;
declare var window: any;
export default function WechatLogin(props: any) { export default function WechatLogin(props: any) {
const freshTime = 60; const freshTime = 60;
const init: any = null; const init: any = null;
const [status, setStatus] = useState(0); const [status, setStatus] = useState(0);
const [ticket, setTicket] = useState(''); const [ticket, setTicket] = useState('');
const [leftTime, setLeftTime] = useState(freshTime) const [leftTime, setLeftTime] = useState(freshTime);
const QRCode = useRef(init); const QRCode = useRef(init);
const timer = useRef(init); const timer = useRef(init);
const leftTimeRef = useRef(init); const leftTimeRef = useRef(init);
useEffect(() => {
leftTimeRef.current = leftTime;
}, [leftTime])
useEffect(() => {
clearInterval(timer.current as any);
if (status === 0) {
Service.Hades("anon/hades/getTicket", {}).then((res: any) => {
setTicket(res.result)
const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}`
// console.log(redirect)
// const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww409ccf9c6e31f19e&redirect_uri=${encodeURIComponent(redirect)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
// console.log(url)
const qrcodeWrapDom:any = document.querySelector('#qrcode');
let qrnode = new qrcode({
text: redirect,
correctLevel: 2,
size: 180,
// image: 'https://image.xiaomaiketang.com/xm/Newk4NrxKC.png',
image: 'https://image.xiaomaiketang.com/xm/bFkRBz7teA.png',
imageSize: 50
});
qrcodeWrapDom.innerHTML = '';
qrcodeWrapDom && qrcodeWrapDom.appendChild(qrnode);
// QRCode.current.innerHTML = ''
// QRCode.current.prepend(qrnode);
setLeftTime(freshTime);
timer.current = setInterval(() => {
if (leftTimeRef.current == 0) {
clearInterval(timer.current);
setStatus(1);
return
}
setLeftTime(leftTimeRef.current - 1); useEffect(() => {
leftTimeRef.current = leftTime;
}, [leftTime]);
}, 1000) useEffect(() => {
}) clearInterval(timer.current as any);
} if (status === 0) {
return () => { Service.Hades('anon/hades/getTicket', {}).then((res: any) => {
setTicket(res.result);
const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}`;
const qrcodeWrapDom: any = document.querySelector('#qrcode');
let qrnode = new qrcode({
text: redirect,
correctLevel: 2,
size: 180,
image: 'https://image.xiaomaiketang.com/xm/bFkRBz7teA.png',
imageSize: 50,
});
qrcodeWrapDom.innerHTML = '';
qrcodeWrapDom && qrcodeWrapDom.appendChild(qrnode);
// QRCode.current.innerHTML = ''
// QRCode.current.prepend(qrnode);
setLeftTime(freshTime);
timer.current = setInterval(() => {
if (leftTimeRef.current == 0) {
clearInterval(timer.current); clearInterval(timer.current);
} setStatus(1);
}, [status]) return;
}
useEffect(() => {
if (leftTime == 60 || !ticket) {
return
}
Service.Hades('anon/hades/getTicketState', {
ticket
}).then((res: any) => {
if (res.result === 'AUTH_SUCCESS') {
Service.Hades('anon/hades/getTicketWXWorkLogin', {
ticket
}).then((_res: any) => {
User.setUserId(_res.result.loginInfo.userId);
User.setToken(_res.result.loginInfo.xmToken);
User.setEnterpriseId(_res.result.enterpriseId);
User.setIdentifier(_res.result.identifier)
window.RCHistory.push({
pathname: `/switch-route`,
})
})
}
})
}, [leftTime]) setLeftTime(leftTimeRef.current - 1);
}, 1000);
});
}
return () => {
clearInterval(timer.current);
};
}, [status]);
return <div className='wechatLoginBox'> useEffect(() => {
<div className="rwm"> if (leftTime == 60 || !ticket) {
<div id="qrcode"></div> return;
}
{ Service.Hades('anon/hades/getTicketState', {
status === 1 && <div className="error"> ticket,
<div>二维码已过期 }).then((res: any) => {
<p className="ope" onClick={() => { if (res.result === 'AUTH_SUCCESS') {
setStatus(0) Service.Hades('anon/hades/getTicketWXWorkLogin', {
}}>刷新</p> ticket,
</div> }).then((_res: any) => {
</div> User.setUserId(_res.result.loginInfo.userId);
} User.setToken(_res.result.loginInfo.xmToken);
{ User.setEnterpriseId(_res.result.enterpriseId);
status === 2 && <div className="error"> User.setIdentifier(_res.result.identifier);
<div>所在企业还未注册学院 window.currentStoreUserInfo = {}
window.currentStoreUserInfo.userId = _res.result.loginInfo.userId;
window.currentStoreUserInfo.token = _res.result.loginInfo.xmToken;
window.currentStoreUserInfo.enterpriseId = _res.result.enterpriseId;
window.RCHistory.push({
pathname: `/switch-route`,
});
});
}
});
}, [leftTime]);
<p className="ope" onClick={() => { return (
setStatus(0) <div className='wechatLoginBox'>
}}>我知道了</p> <div className='rwm'>
</div> <div id='qrcode'></div>
</div>
}
{
status === 3 && <div className="error">
<div>你还不是学院员工,请联系企业管理员
<p className="ope" onClick={() => { {status === 1 && (
setStatus(0) <div className='error'>
}}>我知道了</p> <div>
</div> 二维码已过期
</div> <p
} className='ope'
</div> onClick={() => {
<p className='text'>请使用企业微信扫码登录</p> setStatus(0);
}}>
刷新
</p>
</div>
</div>
)}
{status === 2 && (
<div className='error'>
<div>
所在企业还未注册学院
<p
className='ope'
onClick={() => {
setStatus(0);
}}>
我知道了
</p>
</div>
</div>
)}
{status === 3 && (
<div className='error'>
<div>
你还不是学院员工,请联系企业管理员
<p
className='ope'
onClick={() => {
setStatus(0);
}}>
我知道了
</p>
</div>
</div>
)}
</div>
<p className='text'>请使用企业微信扫码登录</p>
</div> </div>
} );
\ No newline at end of file }
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-02-01 14:12:38 * @LastEditTime: 2021-06-21 11:17:44
* @Description: 学院装修页面 * @Description: 学院装修页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { useEffect, useState } from "react"; import React, { useState } from "react";
import { withRouter, Switch, Route } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
import { Tabs } from "antd"; import { Tabs } from "antd";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
...@@ -16,9 +16,6 @@ import StoreH5DecorationTab from "./StoreH5DecorationTab"; ...@@ -16,9 +16,6 @@ import StoreH5DecorationTab from "./StoreH5DecorationTab";
import StoreWebDecorationTab from "./StoreWebDecorationTab"; import StoreWebDecorationTab from "./StoreWebDecorationTab";
const { TabPane } = Tabs; const { TabPane } = Tabs;
declare var window: any;
interface StoreDecoprationProps { interface StoreDecoprationProps {
match: { match: {
url: string; url: string;
...@@ -27,7 +24,6 @@ interface StoreDecoprationProps { ...@@ -27,7 +24,6 @@ interface StoreDecoprationProps {
function StoreDecorationPage(props: StoreDecoprationProps) { function StoreDecorationPage(props: StoreDecoprationProps) {
const [currentTab, setCurrentTab] = useState("h5"); const [currentTab, setCurrentTab] = useState("h5");
const { match } = props;
return ( return (
<div className="page store-decoration-page"> <div className="page store-decoration-page">
...@@ -36,7 +32,6 @@ function StoreDecorationPage(props: StoreDecoprationProps) { ...@@ -36,7 +32,6 @@ function StoreDecorationPage(props: StoreDecoprationProps) {
<Tabs <Tabs
onChange={(key) => { onChange={(key) => {
setCurrentTab(key); setCurrentTab(key);
// window.RCHistory.push(`${match.url}/store-decoration/${key}`);
}} }}
activeKey={currentTab} activeKey={currentTab}
> >
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-28 16:20:26 * @LastEditTime: 2021-06-21 11:16:21
* @Description: web学院banner页面 * @Description: web学院banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
import React from "react"; import React from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
// import PhotoClip from 'photoclip' import { Modal, message, Button } from "antd";
import { Table, Modal, message, Button } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import { import {
sortableContainer, sortableContainer,
...@@ -24,6 +23,8 @@ import User from "@/common/js/user"; ...@@ -24,6 +23,8 @@ import User from "@/common/js/user";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
import Upload from "@/core/upload"; import Upload from "@/core/upload";
import { XMTable } from '@/components';
import college from '@/common/lottie/college';
const { confirm } = Modal; const { confirm } = Modal;
const DragHandle = sortableHandle(() => ( const DragHandle = sortableHandle(() => (
...@@ -391,7 +392,11 @@ class StoreH5Decoration extends React.Component { ...@@ -391,7 +392,11 @@ class StoreH5Decoration extends React.Component {
</Button> </Button>
</div> </div>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={storeDecorationlist} dataSource={storeDecorationlist}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-28 16:21:04 * @LastEditTime: 2021-06-21 11:16:31
* @Description: web学院banner页面 * @Description: web学院banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
import React from "react"; import React from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
// import PhotoClip from 'photoclip' import { Modal, message, Button } from "antd";
import { Table, Modal, message, Button } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import { import {
sortableContainer, sortableContainer,
...@@ -24,6 +23,8 @@ import User from "@/common/js/user"; ...@@ -24,6 +23,8 @@ import User from "@/common/js/user";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
import Upload from "@/core/upload"; import Upload from "@/core/upload";
import { XMTable } from '@/components';
import college from '@/common/lottie/college';
const { confirm } = Modal; const { confirm } = Modal;
const DragHandle = sortableHandle(() => ( const DragHandle = sortableHandle(() => (
...@@ -389,7 +390,11 @@ class StoreWebDecoration extends React.Component { ...@@ -389,7 +390,11 @@ class StoreWebDecoration extends React.Component {
</Button> </Button>
</div> </div>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={storeDecorationlist} dataSource={storeDecorationlist}
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-04-08 15:50:52 * @Date: 2021-04-08 15:50:52
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-04-24 15:55:19 * @LastEditTime: 2021-06-21 11:24:48
* @Description: 助学工具-考试-答案详情 * @Description: 助学工具-考试-答案详情
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect} from 'react';
import { Route, withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import User from '@/common/js/user'; import User from '@/common/js/user';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import Lottie from 'lottie-web'; import Lottie from 'lottie-web';
...@@ -20,7 +20,6 @@ const NUM_TO_WORD_MAP = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', ...@@ -20,7 +20,6 @@ const NUM_TO_WORD_MAP = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
function AnswerDescPage(props) { function AnswerDescPage(props) {
const examId = props.match.params.testId.replace(/\?.+/, ''); const examId = props.match.params.testId.replace(/\?.+/, '');
const paperId = window.getParameterByName('paperId'); const paperId = window.getParameterByName('paperId');
const [customerId, setCustomerId] = useState('');
const [examDetail, setExamDetail] = useState({ const [examDetail, setExamDetail] = useState({
examDesc: '', examDesc: '',
examDuration: 0, examDuration: 0,
...@@ -155,68 +154,10 @@ function AnswerDescPage(props) { ...@@ -155,68 +154,10 @@ function AnswerDescPage(props) {
setIsShowErrorPage(true); setIsShowErrorPage(true);
} }
function handleChangeActiveIndex(isPre) {
if (onlyError) {
if (isPre && activeOrderIndex !== errorQuestionList[0].orderIndex) {
setActiveOrderIndex(errorQuestionList[activeIndex - 1].orderIndex);
setActiveIndex(activeIndex - 1);
} else if (!isPre && activeOrderIndex !== errorQuestionList[errorCount - 1].orderIndex) {
setActiveOrderIndex(errorQuestionList[activeIndex + 1].orderIndex);
setActiveIndex(activeIndex + 1);
}
} else {
if (isPre && activeOrderIndex !== 0) {
setActiveOrderIndex(activeIndex - 1);
setActiveIndex(activeIndex - 1);
} else if (!isPre && activeOrderIndex !== questionList.length - 1) {
setActiveOrderIndex(activeIndex + 1);
setActiveIndex(activeIndex + 1);
}
}
}
function renderFooterText() {
if (onlyError && errorCount > 0) {
// 只看错题
return (
<div className='footer-btn'>
<div className='pre-next'>
<div
className={`${activeOrderIndex === (errorQuestionList.length > 0 ? errorQuestionList[0].orderIndex : 0) ? 'disabled' : ''} pre`}
onClick={() => handleChangeActiveIndex(true)}>
<span className='icon iconfont'>&#xe79c;</span>
<div className='text'>上一题</div>
</div>
<div
className={`${activeOrderIndex === (errorQuestionList.length > 0 ? errorQuestionList[errorCount - 1].orderIndex : 0) ? 'disabled' : ''} next`}
onClick={() => handleChangeActiveIndex(false)}>
<div className='text'>下一题</div>
<span className='icon iconfont'>&#xe79b;</span>
</div>
</div>
</div>
);
} else if (!onlyError) {
return (
<div className='footer-btn'>
<div className='pre-next'>
<div className={`${activeOrderIndex === 0 ? 'disabled' : ''} pre`} onClick={() => handleChangeActiveIndex(true)}>
<span className='icon iconfont'>&#xe79c;</span>
<div className='text'>上一题</div>
</div>
<div className={`${activeOrderIndex === questionList.length - 1 ? 'disabled' : ''} next`} onClick={() => handleChangeActiveIndex(false)}>
<div className='text'>下一题</div>
<span className='icon iconfont'>&#xe79b;</span>
</div>
</div>
</div>
);
}
}
function handleRenderQuestionItem() { function handleRenderQuestionItem() {
return _.map(questionList, (questionItem, questionIndex) => { return _.map(questionList, (questionItem, questionIndex) => {
const { questionStemList, optionList, gapFillingAnswerList, questionAnswerDescList, questionType, score, questionId, orderIndex } = questionItem; const { questionStemList, optionList, gapFillingAnswerList, questionType, score, questionId, orderIndex } = questionItem;
return ( return (
<div className={`question-info-item`}> <div className={`question-info-item`}>
{renderStem(questionItem, questionStemList, questionType, score, orderIndex, questionId, gapFillingAnswerList)} {renderStem(questionItem, questionStemList, questionType, score, orderIndex, questionId, gapFillingAnswerList)}
...@@ -225,7 +166,6 @@ function AnswerDescPage(props) { ...@@ -225,7 +166,6 @@ function AnswerDescPage(props) {
return renderOption(optionItem, optionIndex, questionId); return renderOption(optionItem, optionIndex, questionId);
})} })}
{renderAnswerCompare(questionId, questionType, optionList, gapFillingAnswerList)} {renderAnswerCompare(questionId, questionType, optionList, gapFillingAnswerList)}
{/* {renderAnswerDesc(questionAnswerDescList)} */}
</div> </div>
); );
}); });
...@@ -503,133 +443,6 @@ function AnswerDescPage(props) { ...@@ -503,133 +443,6 @@ function AnswerDescPage(props) {
} }
} }
// 渲染答案解析
function renderAnswerDesc(questionAnswerDescList) {
const textContent = _.filter(questionAnswerDescList, (item) => {
return item.type === 'RICH_TEXT';
});
const mediaContent = _.filter(questionAnswerDescList, (item) => {
return item.type !== 'RICH_TEXT';
});
let content = textContent.length > 0 ? `${textContent[0].content}:` : '';
let textDom = (
<div
key={0}
className='text-dom'
dangerouslySetInnerHTML={{
__html: content,
}}
/>
);
return (
<div className='desc-line__item'>
{textDom}
{renderAnswerDescMedia(mediaContent)}
</div>
);
}
// 渲染答案解析的多媒体
function renderAnswerDescMedia(mediaContent) {
const pictureMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'PICTURE';
});
const voiceMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'VOICE';
});
const audioMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'AUDIO';
});
const videoMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'VIDEO';
});
return (
<div className='desc-media-container'>
{pictureMediaList.length > 0 && (
<div className='desc-picture-box'>
{_.map(pictureMediaList, (pictureItem, pictureIndex) => {
let { content } = pictureItem;
return (
<div className='picture-box' key={pictureIndex}>
<img className='img-box' src={content} onClick={() => handleScanFile('JPG', content)} />
</div>
);
})}
</div>
)}
{audioMediaList.length > 0 && (
<div className='desc-audio-box'>
{_.map(audioMediaList, (audioItem, audioIndex) => {
let { content, size } = audioItem;
return (
<div className='audio-box' key={audioIndex}>
<XMAudio
forbidParse
url={content}
getDuration={(durationSize) => {
size = durationSize;
}}
index={audioIndex}
size={size || 1000}
/>
</div>
);
})}
</div>
)}
{voiceMediaList.length > 0 && (
<div className='desc-audio-box'>
{_.map(voiceMediaList, (voiceItem, voiceIndex) => {
let { content, size } = voiceItem;
return (
<div className='audio-box' key={voiceIndex}>
<XMAudio
forbidParse
url={content}
getDuration={(durationSize) => {
size = durationSize;
}}
index={voiceIndex}
size={size || 1000}
/>
</div>
);
})}
</div>
)}
{videoMediaList.length > 0 && (
<div className='desc-video-box'>
{_.map(videoMediaList, (videoItem, videoIndex) => {
let { content } = videoItem;
return (
<div className='video-box' key={videoIndex}>
<img className='video-box_content' src={`${content}?x-oss-process=video/snapshot,t_0,m_fast`} />
<img className='video-box_btn' src='https://image.xiaomaiketang.com/xm/r5H8cYm4ch.png' onClick={() => handleScanFile('MP4', content)} />
</div>
);
})}
</div>
)}
</div>
);
}
// 答题卡展开和收起
function handleToggleQuestionCardShow() {
setIsShowQuestionCard(!isShowQuestionCard);
}
// 快速跳转题目
function handleQuickActiveQuestion(orderIndex, answerIndex) {
setActiveOrderIndex(orderIndex);
setActiveIndex(answerIndex);
setIsShowQuestionCard(false);
}
// 只选错题 // 只选错题
function chooseErrorAnswer() { function chooseErrorAnswer() {
...@@ -640,8 +453,6 @@ function AnswerDescPage(props) { ...@@ -640,8 +453,6 @@ function AnswerDescPage(props) {
setQuestionList(!onlyError ? errorQuestionList : allQuestionList); setQuestionList(!onlyError ? errorQuestionList : allQuestionList);
} }
const { totalQuestionCount, userCorrectQuestion } = examDetail;
let sortedAnswerList = []; let sortedAnswerList = [];
let userAnswerMap = {}; let userAnswerMap = {};
userAnswerList.forEach((item) => { userAnswerList.forEach((item) => {
...@@ -689,7 +500,6 @@ function AnswerDescPage(props) { ...@@ -689,7 +500,6 @@ function AnswerDescPage(props) {
<div className='question-list-box'>{handleRenderQuestionItem()}</div> <div className='question-list-box'>{handleRenderQuestionItem()}</div>
</div> </div>
</If> </If>
{/* {renderFooterText()} */}
</div> </div>
{showScanFile && ( {showScanFile && (
<ScanFileModal <ScanFileModal
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-23 18:28:50 * @Date: 2021-02-23 18:28:50
* @LastEditors: fusanqiasng * @LastEditors: wufan
* @LastEditTime: 2021-06-16 09:59:04 * @LastEditTime: 2021-06-24 13:39:30
* @Description: 助学工具-课程分类 * @Description: 助学工具-课程分类
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -14,9 +14,11 @@ import AidToolService from '@/domains/aid-tool-domain/AidToolService'; ...@@ -14,9 +14,11 @@ import AidToolService from '@/domains/aid-tool-domain/AidToolService';
import User from '@/common/js/user'; import User from '@/common/js/user';
import { Tree, Input, Space, Button, Menu, Dropdown, message, Modal } from 'antd'; import { Tree, Input, Space, Button, Menu, Dropdown, message, Modal } from 'antd';
import ShowTips from '@/components/ShowTips'; import ShowTips from '@/components/ShowTips';
import LottieIcon from '@/components/LottieIcon';
const { DirectoryTree } = Tree; const { DirectoryTree } = Tree;
const { Search } = Input; const { Search } = Input;
const { confirm } = Modal; const { confirm } = Modal;
class CourseCategoryManage extends Component { class CourseCategoryManage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -567,16 +569,29 @@ class CourseCategoryManage extends Component { ...@@ -567,16 +569,29 @@ class CourseCategoryManage extends Component {
<ShowTips message='为方便管理,该分类用于课程、培训计划、题库、知识库等模块,改动将同步各模块更新' /> <ShowTips message='为方便管理,该分类用于课程、培训计划、题库、知识库等模块,改动将同步各模块更新' />
</div> </div>
<div className='course-category-tree'> <div className='course-category-tree'>
<DirectoryTree {
expandedKeys={expandedKeys} <Choose>
autoExpandParent={autoExpandParent} <When condition={(treeData.length !== 0)}>
onExpand={this.onExpand} <DirectoryTree
selectedKeys={selectedKeys} expandedKeys={expandedKeys}
onSelect={this.onSelect} autoExpandParent={autoExpandParent}
draggable onExpand={this.onExpand}
blockNode selectedKeys={selectedKeys}
onDrop={this.onDrop} onSelect={this.onSelect}
treeData={treeData}></DirectoryTree> draggable
blockNode
onDrop={this.onDrop}
treeData={treeData}></DirectoryTree>
</When>
<Otherwise>
<LottieIcon
title={<span className="desc">搜索无结果</span>}
type="search"
size={150}
/>
</Otherwise>
</Choose>
}
</div> </div>
</div> </div>
{operateCourseCategoryModal} {operateCourseCategoryModal}
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
margin-top: 12px; margin-top: 12px;
width: 900px; width: 900px;
border: 1px solid #e8e8e8; border: 1px solid #e8e8e8;
.lottie-icon {
margin-top: 100px!important;
.desc {
color: #999!important;
}
}
.ant-tree.ant-tree-directory { .ant-tree.ant-tree-directory {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
......
import React, { useState, useRef, useEffect, useContext } from 'react'; import React, { useState, useRef, useEffect, useContext } from 'react';
import { Input, Select, DatePicker, Tooltip, Button, Table, Dropdown, Menu, Modal } from 'antd'; import { Input, Select, DatePicker, Tooltip, Button, Dropdown, Menu, Modal } from 'antd';
import TeacherSelect from '@/modules/common/TeacherSelect'; import TeacherSelect from '@/modules/common/TeacherSelect';
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
...@@ -14,8 +14,6 @@ import PreviewModal from './PreviewModal'; ...@@ -14,8 +14,6 @@ import PreviewModal from './PreviewModal';
import './index.less'; import './index.less';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { Search } = Input; const { Search } = Input;
const { Option } = Select;
interface sortType { interface sortType {
type: 'ascend' | 'descend' | null | undefined; type: 'ascend' | 'descend' | null | undefined;
} }
...@@ -42,9 +40,7 @@ function ExaminationManager(props: any) { ...@@ -42,9 +40,7 @@ function ExaminationManager(props: any) {
type: undefined, type: undefined,
}; };
const sortEnum = {};
const { match } = props; const { match } = props;
const sortState: any = false;
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const [query, setQuery] = useState(queryInit); const [query, setQuery] = useState(queryInit);
const [expandFilter, setExpandFilter] = useState(false); const [expandFilter, setExpandFilter] = useState(false);
...@@ -53,7 +49,6 @@ function ExaminationManager(props: any) { ...@@ -53,7 +49,6 @@ function ExaminationManager(props: any) {
const [field, setfield] = useState(''); const [field, setfield] = useState('');
const [order, setOrder] = useState(sortStatus.type); const [order, setOrder] = useState(sortStatus.type);
const [modal, setModal] = useState(null); const [modal, setModal] = useState(null);
const [questionCntSort, setQuestionCntSort] = useState(sortState);
const [openPreviewModal, setOpenPreviewModal] = useState(false); const [openPreviewModal, setOpenPreviewModal] = useState(false);
const [info, setInfo] = useState({ examDuration: 0 }); const [info, setInfo] = useState({ examDuration: 0 });
const queryRef = useRef({}); const queryRef = useRef({});
...@@ -76,7 +71,6 @@ function ExaminationManager(props: any) { ...@@ -76,7 +71,6 @@ function ExaminationManager(props: any) {
const columns = [ const columns = [
{ {
title: '考试', title: '考试',
// fixed:fixStr.left,
width: 320, width: 320,
dataIndex: 'examName', dataIndex: 'examName',
render: (text: any, record: any) => { render: (text: any, record: any) => {
...@@ -279,9 +273,6 @@ function ExaminationManager(props: any) { ...@@ -279,9 +273,6 @@ function ExaminationManager(props: any) {
function getList() { function getList() {
const _query = { ...queryRef.current }; const _query = { ...queryRef.current };
// if(_query.examCreator){
// _query.examCreator =parseInt(_query.examCreator)
// }
Service.Hades('public/hades/queryExamPageList', { Service.Hades('public/hades/queryExamPageList', {
..._query, ..._query,
......
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