Commit 15b67f61 by maolipeng

Merge branch 'master' into feature/maolipeng/youhua

# Conflicts:
#	src/modules/root/Menu.tsx
parents affc1e0a 84416698
...@@ -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';
......
...@@ -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) {
......
...@@ -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);
......
import React, { Key, useContext, useEffect, useRef, useState } from 'react'; import React, { Key, useContext, useEffect, useRef, useState, useMemo } from 'react';
import { import {
withRouter, withRouter,
} from 'react-router-dom'; } from 'react-router-dom';
import { Menu} from 'antd'; import { Menu } from 'antd';
import { menuList } from '../../routes//config/menuList' import { menuList } from '../../routes//config/menuList'
import { XMContext } from '../../store/context'; import { XMContext } from '../../store/context';
import Service from "@/common/js/service"; import Service from "@/common/js/service";
...@@ -14,13 +14,14 @@ import Bus from '@/core/tbus'; ...@@ -14,13 +14,14 @@ import Bus from '@/core/tbus';
const { SubMenu } = Menu; const { SubMenu } = Menu;
function Aside(props: any) { function Aside(props: any) {
const {menuType,handleMenuType}= props const { menuType, handleMenuType } = props
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const [selectKey, setSelectKey] = useState(); const [selectKey, setSelectKey] = useState();
const [openKeys, setOpenKeys] = useState(['']); const [openKeys, setOpenKeys] = useState(['']);
const [topLogoUrl, setTopLogoUrl] = useState("") const [topLogoUrl, setTopLogoUrl] = useState("")
const [collapsed, setCollapsed] = useState(false) const [collapsed, setCollapsed] = useState(false)
const rootSubmenuKeys = _.pluck(menuList, 'groupCode'); const rootSubmenuKeys = _.pluck(menuList, 'groupCode');
useEffect(() => { useEffect(() => {
const link = props.location.pathname; const link = props.location.pathname;
menuList.map((item: any, index: any) => { menuList.map((item: any, index: any) => {
...@@ -52,24 +53,26 @@ function Aside(props: any) { ...@@ -52,24 +53,26 @@ function Aside(props: any) {
function getTopLeftLogo() { function getTopLeftLogo() {
if (User.getToken()) { if (User.getToken()) {
StoreService.getStoreDetail({storeId:User.getStoreId()}) StoreService.getStoreDetail({ storeId: User.getStoreId() })
.then(res=> { .then(res => {
if (_.isEmpty(res.result.logo)) { if (_.isEmpty(res.result.logo)) {
setTopLogoUrl("https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png") setTopLogoUrl("https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png")
} else { } else {
setTopLogoUrl(res.result.logo) setTopLogoUrl(res.result.logo)
} }
}) })
} }
} }
function toggleMenu(item: any) { function toggleMenu(item: any) {
window.RCHistory.push(item.link) window.RCHistory.push(item.link)
if (!menuType) { if (!menuType) {
setOpenKeys([]) setOpenKeys([])
} }
} }
function onOpenChange(key: any) {
function onOpenChange(key: Key[]) {
if (typeof key === "string") { if (typeof key === "string") {
if (openKeys.includes(key)) { if (openKeys.includes(key)) {
setOpenKeys([]); setOpenKeys([]);
...@@ -97,20 +100,27 @@ function Aside(props: any) { ...@@ -97,20 +100,27 @@ function Aside(props: any) {
setCollapsed(!collapsed) setCollapsed(!collapsed)
} }
const openKeysConstrol = useMemo(() => {
return {
[menuType ? 'openKeys' : 'defaultOpenKeys']: openKeys
};
}, [menuType, openKeys])
return ( return (
<div <div
id="left-container" id="left-container"
className={ className={
menuType menuType
? "left-container" ? "left-container"
: "left-container left-container-vertical" : "left-container left-container-vertical"
} }
> >
<div className="top-ctrl"> <div className="top-ctrl">
<div className="topLogo"> <div className="topLogo">
{ menuType && <img src={topLogoUrl} alt="" className="img1"></img> } {menuType && <img src={topLogoUrl} alt="" className="img1"></img>}
</div> </div>
<div className="menu-type-icon" onClick={handleMenu}> <div className="menu-type-icon" onClick={handleMenu}>
{menuType ? ( {menuType ? (
<span <span
className="icon iconfont" className="icon iconfont"
...@@ -125,57 +135,58 @@ function Aside(props: any) { ...@@ -125,57 +135,58 @@ function Aside(props: any) {
</span> </span>
)} )}
</div> </div>
</div>
<div className="left">
<div className="nav">
<Menu
style={menuType ? { minHeight: "100%", background: '#0E1935' }:{minHeight: "100%", background: '#0E1935',width:"56px" }}
selectedKeys={selectKey}
openKeys={menuType ? openKeys : undefined}
onOpenChange={onOpenChange}
inlineCollapsed={collapsed}
mode={menuType ? "inline" : "vertical"}
>
{
menuList.map((item: any, index: any) => {
if (ctx.xmState.storeUserPermissionList.indexOf(item.groupCode) === -1) {
return null;
}
if (item.children) {
return <SubMenu
key={item.groupCode}
style={{ marginTop: 0 }}
icon={<img src={item.img} className="icon-img"></img>}
title={menuType ? <span>{item.groupName}</span> : ""}
onTitleClick={() => onOpenChange(item.groupCode)}
>
{
item.children.map((_item: any, _index: any) => {
if (ctx.xmState.storeUserPermissionList.indexOf(_item.groupCode) === -1) {
return null;
}
return <Menu.Item onClick={() => { toggleMenu(_item) }} style={{ marginTop: 0 }} key={_item.groupCode + index + _index} >
<span className="name">{_item.groupName}</span>
</Menu.Item>
})
}
</SubMenu>
} else {
return <Menu.Item
onClick={() => { toggleMenu(item) }}
key={item.groupCode}
icon={<img src={selectKey === item.groupCode ? item.selectImg : item.img} className="icon-img"></img>}
>
{menuType ? item.groupName : ""}
</Menu.Item>
}
})
}
</Menu>
</div> </div>
<div className="left">
<div className="nav">
<Menu
{...openKeysConstrol}
style={menuType ? { minHeight: "100%", background: '#0E1935' } : { minHeight: "100%", background: '#0E1935', width: "56px" }}
selectedKeys={selectKey}
onOpenChange={onOpenChange}
inlineCollapsed={collapsed}
mode={menuType ? "inline" : "vertical"}
>
{
menuList.map((item: any, index: any) => {
if (ctx.xmState.storeUserPermissionList.indexOf(item.groupCode) === -1) {
return null;
}
if (item.children) {
return <SubMenu
key={item.groupCode}
style={{ marginTop: 0 }}
icon={<img src={item.img} className="icon-img"></img>}
title={menuType ? <span>{item.groupName}</span> : ""}
onTitleClick={() => onOpenChange(item.groupCode)}
>
{
item.children.map((_item: any, _index: any) => {
if (ctx.xmState.storeUserPermissionList.indexOf(_item.groupCode) === -1) {
return null;
}
return <Menu.Item onClick={() => { toggleMenu(_item) }} style={{ marginTop: 0 }} key={_item.groupCode + index + _index} >
<span className="name">{_item.groupName}</span>
</Menu.Item>
})
}
</SubMenu>
} else {
return <Menu.Item
onClick={() => { toggleMenu(item) }}
key={item.groupCode}
icon={<img src={selectKey === item.groupCode ? item.selectImg : item.img} className="icon-img"></img>}
>
{menuType ? item.groupName : ""}
</Menu.Item>
}
})
}
</Menu>
</div>
</div> </div>
</div> </div>
); );
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-02-01 14:12:38 * @LastEditTime: 2021-06-21 11:17:44
* @Description: 学院装修页面 * @Description: 学院装修页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { useEffect, useState } from "react"; import React, { useState } from "react";
import { withRouter, Switch, Route } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
import { Tabs } from "antd"; import { Tabs } from "antd";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
...@@ -16,9 +16,6 @@ import StoreH5DecorationTab from "./StoreH5DecorationTab"; ...@@ -16,9 +16,6 @@ import StoreH5DecorationTab from "./StoreH5DecorationTab";
import StoreWebDecorationTab from "./StoreWebDecorationTab"; import StoreWebDecorationTab from "./StoreWebDecorationTab";
const { TabPane } = Tabs; const { TabPane } = Tabs;
declare var window: any;
interface StoreDecoprationProps { interface StoreDecoprationProps {
match: { match: {
url: string; url: string;
...@@ -27,7 +24,6 @@ interface StoreDecoprationProps { ...@@ -27,7 +24,6 @@ interface StoreDecoprationProps {
function StoreDecorationPage(props: StoreDecoprationProps) { function StoreDecorationPage(props: StoreDecoprationProps) {
const [currentTab, setCurrentTab] = useState("h5"); const [currentTab, setCurrentTab] = useState("h5");
const { match } = props;
return ( return (
<div className="page store-decoration-page"> <div className="page store-decoration-page">
...@@ -36,7 +32,6 @@ function StoreDecorationPage(props: StoreDecoprationProps) { ...@@ -36,7 +32,6 @@ function StoreDecorationPage(props: StoreDecoprationProps) {
<Tabs <Tabs
onChange={(key) => { onChange={(key) => {
setCurrentTab(key); setCurrentTab(key);
// window.RCHistory.push(`${match.url}/store-decoration/${key}`);
}} }}
activeKey={currentTab} activeKey={currentTab}
> >
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-28 16:20:26 * @LastEditTime: 2021-06-21 11:16:21
* @Description: web学院banner页面 * @Description: web学院banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
import React from "react"; import React from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
// import PhotoClip from 'photoclip' import { Modal, message, Button } from "antd";
import { Table, Modal, message, Button } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import { import {
sortableContainer, sortableContainer,
...@@ -24,6 +23,8 @@ import User from "@/common/js/user"; ...@@ -24,6 +23,8 @@ import User from "@/common/js/user";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
import Upload from "@/core/upload"; import Upload from "@/core/upload";
import { XMTable } from '@/components';
import college from '@/common/lottie/college';
const { confirm } = Modal; const { confirm } = Modal;
const DragHandle = sortableHandle(() => ( const DragHandle = sortableHandle(() => (
...@@ -391,7 +392,11 @@ class StoreH5Decoration extends React.Component { ...@@ -391,7 +392,11 @@ class StoreH5Decoration extends React.Component {
</Button> </Button>
</div> </div>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={storeDecorationlist} dataSource={storeDecorationlist}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-28 16:21:04 * @LastEditTime: 2021-06-21 11:16:31
* @Description: web学院banner页面 * @Description: web学院banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
import React from "react"; import React from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
// import PhotoClip from 'photoclip' import { Modal, message, Button } from "antd";
import { Table, Modal, message, Button } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import { import {
sortableContainer, sortableContainer,
...@@ -24,6 +23,8 @@ import User from "@/common/js/user"; ...@@ -24,6 +23,8 @@ import User from "@/common/js/user";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
import Upload from "@/core/upload"; import Upload from "@/core/upload";
import { XMTable } from '@/components';
import college from '@/common/lottie/college';
const { confirm } = Modal; const { confirm } = Modal;
const DragHandle = sortableHandle(() => ( const DragHandle = sortableHandle(() => (
...@@ -389,7 +390,11 @@ class StoreWebDecoration extends React.Component { ...@@ -389,7 +390,11 @@ class StoreWebDecoration extends React.Component {
</Button> </Button>
</div> </div>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={storeDecorationlist} dataSource={storeDecorationlist}
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-04-08 15:50:52 * @Date: 2021-04-08 15:50:52
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-04-24 15:55:19 * @LastEditTime: 2021-06-21 11:24:48
* @Description: 助学工具-考试-答案详情 * @Description: 助学工具-考试-答案详情
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect} from 'react';
import { Route, withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import User from '@/common/js/user'; import User from '@/common/js/user';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import Lottie from 'lottie-web'; import Lottie from 'lottie-web';
...@@ -20,7 +20,6 @@ const NUM_TO_WORD_MAP = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', ...@@ -20,7 +20,6 @@ const NUM_TO_WORD_MAP = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
function AnswerDescPage(props) { function AnswerDescPage(props) {
const examId = props.match.params.testId.replace(/\?.+/, ''); const examId = props.match.params.testId.replace(/\?.+/, '');
const paperId = window.getParameterByName('paperId'); const paperId = window.getParameterByName('paperId');
const [customerId, setCustomerId] = useState('');
const [examDetail, setExamDetail] = useState({ const [examDetail, setExamDetail] = useState({
examDesc: '', examDesc: '',
examDuration: 0, examDuration: 0,
...@@ -155,68 +154,10 @@ function AnswerDescPage(props) { ...@@ -155,68 +154,10 @@ function AnswerDescPage(props) {
setIsShowErrorPage(true); setIsShowErrorPage(true);
} }
function handleChangeActiveIndex(isPre) {
if (onlyError) {
if (isPre && activeOrderIndex !== errorQuestionList[0].orderIndex) {
setActiveOrderIndex(errorQuestionList[activeIndex - 1].orderIndex);
setActiveIndex(activeIndex - 1);
} else if (!isPre && activeOrderIndex !== errorQuestionList[errorCount - 1].orderIndex) {
setActiveOrderIndex(errorQuestionList[activeIndex + 1].orderIndex);
setActiveIndex(activeIndex + 1);
}
} else {
if (isPre && activeOrderIndex !== 0) {
setActiveOrderIndex(activeIndex - 1);
setActiveIndex(activeIndex - 1);
} else if (!isPre && activeOrderIndex !== questionList.length - 1) {
setActiveOrderIndex(activeIndex + 1);
setActiveIndex(activeIndex + 1);
}
}
}
function renderFooterText() {
if (onlyError && errorCount > 0) {
// 只看错题
return (
<div className='footer-btn'>
<div className='pre-next'>
<div
className={`${activeOrderIndex === (errorQuestionList.length > 0 ? errorQuestionList[0].orderIndex : 0) ? 'disabled' : ''} pre`}
onClick={() => handleChangeActiveIndex(true)}>
<span className='icon iconfont'>&#xe79c;</span>
<div className='text'>上一题</div>
</div>
<div
className={`${activeOrderIndex === (errorQuestionList.length > 0 ? errorQuestionList[errorCount - 1].orderIndex : 0) ? 'disabled' : ''} next`}
onClick={() => handleChangeActiveIndex(false)}>
<div className='text'>下一题</div>
<span className='icon iconfont'>&#xe79b;</span>
</div>
</div>
</div>
);
} else if (!onlyError) {
return (
<div className='footer-btn'>
<div className='pre-next'>
<div className={`${activeOrderIndex === 0 ? 'disabled' : ''} pre`} onClick={() => handleChangeActiveIndex(true)}>
<span className='icon iconfont'>&#xe79c;</span>
<div className='text'>上一题</div>
</div>
<div className={`${activeOrderIndex === questionList.length - 1 ? 'disabled' : ''} next`} onClick={() => handleChangeActiveIndex(false)}>
<div className='text'>下一题</div>
<span className='icon iconfont'>&#xe79b;</span>
</div>
</div>
</div>
);
}
}
function handleRenderQuestionItem() { function handleRenderQuestionItem() {
return _.map(questionList, (questionItem, questionIndex) => { return _.map(questionList, (questionItem, questionIndex) => {
const { questionStemList, optionList, gapFillingAnswerList, questionAnswerDescList, questionType, score, questionId, orderIndex } = questionItem; const { questionStemList, optionList, gapFillingAnswerList, questionType, score, questionId, orderIndex } = questionItem;
return ( return (
<div className={`question-info-item`}> <div className={`question-info-item`}>
{renderStem(questionItem, questionStemList, questionType, score, orderIndex, questionId, gapFillingAnswerList)} {renderStem(questionItem, questionStemList, questionType, score, orderIndex, questionId, gapFillingAnswerList)}
...@@ -225,7 +166,6 @@ function AnswerDescPage(props) { ...@@ -225,7 +166,6 @@ function AnswerDescPage(props) {
return renderOption(optionItem, optionIndex, questionId); return renderOption(optionItem, optionIndex, questionId);
})} })}
{renderAnswerCompare(questionId, questionType, optionList, gapFillingAnswerList)} {renderAnswerCompare(questionId, questionType, optionList, gapFillingAnswerList)}
{/* {renderAnswerDesc(questionAnswerDescList)} */}
</div> </div>
); );
}); });
...@@ -503,133 +443,6 @@ function AnswerDescPage(props) { ...@@ -503,133 +443,6 @@ function AnswerDescPage(props) {
} }
} }
// 渲染答案解析
function renderAnswerDesc(questionAnswerDescList) {
const textContent = _.filter(questionAnswerDescList, (item) => {
return item.type === 'RICH_TEXT';
});
const mediaContent = _.filter(questionAnswerDescList, (item) => {
return item.type !== 'RICH_TEXT';
});
let content = textContent.length > 0 ? `${textContent[0].content}:` : '';
let textDom = (
<div
key={0}
className='text-dom'
dangerouslySetInnerHTML={{
__html: content,
}}
/>
);
return (
<div className='desc-line__item'>
{textDom}
{renderAnswerDescMedia(mediaContent)}
</div>
);
}
// 渲染答案解析的多媒体
function renderAnswerDescMedia(mediaContent) {
const pictureMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'PICTURE';
});
const voiceMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'VOICE';
});
const audioMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'AUDIO';
});
const videoMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'VIDEO';
});
return (
<div className='desc-media-container'>
{pictureMediaList.length > 0 && (
<div className='desc-picture-box'>
{_.map(pictureMediaList, (pictureItem, pictureIndex) => {
let { content } = pictureItem;
return (
<div className='picture-box' key={pictureIndex}>
<img className='img-box' src={content} onClick={() => handleScanFile('JPG', content)} />
</div>
);
})}
</div>
)}
{audioMediaList.length > 0 && (
<div className='desc-audio-box'>
{_.map(audioMediaList, (audioItem, audioIndex) => {
let { content, size } = audioItem;
return (
<div className='audio-box' key={audioIndex}>
<XMAudio
forbidParse
url={content}
getDuration={(durationSize) => {
size = durationSize;
}}
index={audioIndex}
size={size || 1000}
/>
</div>
);
})}
</div>
)}
{voiceMediaList.length > 0 && (
<div className='desc-audio-box'>
{_.map(voiceMediaList, (voiceItem, voiceIndex) => {
let { content, size } = voiceItem;
return (
<div className='audio-box' key={voiceIndex}>
<XMAudio
forbidParse
url={content}
getDuration={(durationSize) => {
size = durationSize;
}}
index={voiceIndex}
size={size || 1000}
/>
</div>
);
})}
</div>
)}
{videoMediaList.length > 0 && (
<div className='desc-video-box'>
{_.map(videoMediaList, (videoItem, videoIndex) => {
let { content } = videoItem;
return (
<div className='video-box' key={videoIndex}>
<img className='video-box_content' src={`${content}?x-oss-process=video/snapshot,t_0,m_fast`} />
<img className='video-box_btn' src='https://image.xiaomaiketang.com/xm/r5H8cYm4ch.png' onClick={() => handleScanFile('MP4', content)} />
</div>
);
})}
</div>
)}
</div>
);
}
// 答题卡展开和收起
function handleToggleQuestionCardShow() {
setIsShowQuestionCard(!isShowQuestionCard);
}
// 快速跳转题目
function handleQuickActiveQuestion(orderIndex, answerIndex) {
setActiveOrderIndex(orderIndex);
setActiveIndex(answerIndex);
setIsShowQuestionCard(false);
}
// 只选错题 // 只选错题
function chooseErrorAnswer() { function chooseErrorAnswer() {
...@@ -640,8 +453,6 @@ function AnswerDescPage(props) { ...@@ -640,8 +453,6 @@ function AnswerDescPage(props) {
setQuestionList(!onlyError ? errorQuestionList : allQuestionList); setQuestionList(!onlyError ? errorQuestionList : allQuestionList);
} }
const { totalQuestionCount, userCorrectQuestion } = examDetail;
let sortedAnswerList = []; let sortedAnswerList = [];
let userAnswerMap = {}; let userAnswerMap = {};
userAnswerList.forEach((item) => { userAnswerList.forEach((item) => {
...@@ -689,7 +500,6 @@ function AnswerDescPage(props) { ...@@ -689,7 +500,6 @@ function AnswerDescPage(props) {
<div className='question-list-box'>{handleRenderQuestionItem()}</div> <div className='question-list-box'>{handleRenderQuestionItem()}</div>
</div> </div>
</If> </If>
{/* {renderFooterText()} */}
</div> </div>
{showScanFile && ( {showScanFile && (
<ScanFileModal <ScanFileModal
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-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