Commit 66fa34f4 by guomingpang

fix:修改测试bug

parent a0744081
/* /*
* @Author: 陈剑宇 * @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01 * @Date: 2020-05-07 14:43:01
* @LastEditTime: 2021-04-19 16:42:24 * @LastEditTime: 2021-05-28 15:20:40
* @LastEditors: zhangleyuan * @LastEditors: fusanqiasng
* @Description: * @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts * @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
*/ */
import { MapInterface } from '@/domains/basic-domain/interface' import { MapInterface } from '@/domains/basic-domain/interface'
// 默认是 dev 环境 // 默认是 dev 环境
const ENV: string = process.env.DEPLOY_ENV || 'dev'; const ENV: string = process.env.DEPLOY_ENV || 'dev'
console.log("process.env.DEPLOY_ENV",process) console.log('process.env.DEPLOY_ENV', process)
const BASIC_HOST_MAP: MapInterface = { const BASIC_HOST_MAP: MapInterface = {
dev: 'https://dev-heimdall.xiaomai5.com/', dev: 'https://dev-heimdall.xiaomai5.com/',
dev1: 'https://dev1-heimdall.xiaomai5.com/', dev1: 'https://dev1-heimdall.xiaomai5.com/',
rc: 'https://rc-heimdall.xiaomai5.com/', rc: 'https://rc-heimdall.xiaomai5.com/',
gray: 'https://gray-heimdall.xiaomai5.com/', gray: 'https://gray-heimdall.xiaomai5.com/',
prod: 'https://gateway.xiaomai5.com/' prod: 'https://gateway.xiaomai5.com/',
}; }
const PATH_MAP: MapInterface = { const PATH_MAP: MapInterface = {
dev: 'https://dev.xiaomai5.com/xiaomai-cloud-class-web/h5.html', dev: 'https://dev.xiaomai5.com/xiaomai-cloud-class-web/h5.html',
dev1: 'https://dev.xiaomai5.com/xiaomai-cloud-class-web/h5.html', dev1: 'https://dev.xiaomai5.com/xiaomai-cloud-class-web/h5.html',
rc: 'https://rc.xiaomai5.com/xiaomai-cloud-class-web/h5.html', rc: 'https://rc.xiaomai5.com/xiaomai-cloud-class-web/h5.html',
gray: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/gray/h5.html', gray: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/gray/h5.html',
prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html' prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html',
}; }
// axios headers config // axios headers config
export const TIME_OUT: number = 20000; export const TIME_OUT: number = 20000
export const USER_TYPE: string = 'B'; export const USER_TYPE: string = 'B'
export const PROJECT = 'xmzj-web-b'; export const PROJECT = 'xmzj-web-b'
export const VERSION = '5.4.8'; export const VERSION = '5.4.8'
export const PREFIX = 'cloud-class'; export const PREFIX = 'cloud-class'
export const USER_PREFIX = 'store-live'; export const USER_PREFIX = 'store-live'
// host // host
export const BASIC_HOST: string = BASIC_HOST_MAP[ENV]; export const BASIC_HOST: string = BASIC_HOST_MAP[ENV]
export const PATH: string = PATH_MAP[ENV]; export const PATH: string = PATH_MAP[ENV]
import React from 'react'; import React from 'react'
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'
import './OfflineCourseFilter.less'; import './OfflineCourseFilter.less'
import moment from 'moment'; import moment from 'moment'
import StoreService from "@/domains/store-domain/storeService"; import StoreService from '@/domains/store-domain/storeService'
const { Search } = Input; const { Search } = Input
const { Option } = Select; const { Option } = Select
const DEFAULT_QUERY = { const DEFAULT_QUERY = {
courseName: null, // 课程名称 courseName: null, // 课程名称
operatorId: null, // 创建人 operatorId: null, // 创建人
beginTime: null, // 开始日期 beginTime: null, // 开始日期
endTime: null, // 结束日期 endTime: null, // 结束日期
shelfState:null, shelfState: null,
} }
const defaultTeacherQuery = { const defaultTeacherQuery = {
size: 10, size: 10,
current: 1, current: 1,
nickName:null nickName: null,
} }
class OfflineCourseFilter extends React.Component { class OfflineCourseFilter extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {
query: { ...DEFAULT_QUERY }, // 使用扩展运算符,避免浅拷贝 query: { ...DEFAULT_QUERY }, // 使用扩展运算符,避免浅拷贝
teacherQuery: defaultTeacherQuery, teacherQuery: defaultTeacherQuery,
teacherList:[], teacherList: [],
expandFilter:false expandFilter: false,
} }
} }
componentDidMount() { componentDidMount() {
this.getTeacherList(); this.getTeacherList()
} }
getTeacherList(current = 1, selectList){ getTeacherList(current = 1, selectList) {
const { teacherQuery,teacherList} = this.state; const { teacherQuery, teacherList } = this.state
const _query = { const _query = {
...teacherQuery, ...teacherQuery,
current, current,
size:10 size: 10,
}; }
StoreService.getStoreUserBasicPage( _query).then((res) => { StoreService.getStoreUserBasicPage(_query).then((res) => {
const { result = {} } = res; const { result = {} } = res
const { records = [], total = 0, hasNext } = result; const { records = [], total = 0, hasNext } = result
const list = current > 1 ? teacherList.concat(records) : records; const list = current > 1 ? teacherList.concat(records) : records
this.setState({ this.setState({
hasNext, hasNext,
teacherList: list, teacherList: list,
}) })
}); })
} }
// 滑动加载更多讲师列表 // 滑动加载更多讲师列表
handleScrollTeacherList = (e) => { handleScrollTeacherList = (e) => {
const { hasNext } = this.state; const { hasNext } = this.state
const container = e.target; const container = e.target
const scrollToBottom = container && container.scrollHeight <= container.clientHeight + container.scrollTop; const scrollToBottom = container && container.scrollHeight <= container.clientHeight + container.scrollTop
if (scrollToBottom && hasNext) { if (scrollToBottom && hasNext) {
const { teacherQuery } = this.state; const { teacherQuery } = this.state
let _teacherQuery = teacherQuery; let _teacherQuery = teacherQuery
_teacherQuery.current = _teacherQuery.current + 1 _teacherQuery.current = _teacherQuery.current + 1
this.setState({ this.setState(
teacherQuery:{..._teacherQuery} {
},()=>{this.getTeacherList(_teacherQuery.current)}) teacherQuery: { ..._teacherQuery },
},
() => {
this.getTeacherList(_teacherQuery.current)
}
)
} }
} }
// 改变搜索条件 // 改变搜索条件
handleChangeQuery = (field, value) => { handleChangeQuery = (field, value) => {
this.setState({ this.setState(
{
query: { query: {
...this.state.query, ...this.state.query,
[field]: value, [field]: value,
current: 1, current: 1,
} },
}, () => { },
if (field === 'courseName') return; () => {
if (field === 'courseName') return
this.props.onChange(this.state.query) this.props.onChange(this.state.query)
}); }
)
} }
handleChangeDates = (dates) => { handleChangeDates = (dates) => {
const query = _.clone(this.state.query); const query = _.clone(this.state.query)
if (_.isEmpty(dates)) { if (_.isEmpty(dates)) {
delete query.beginTime; delete query.beginTime
delete query.endTime; delete query.endTime
} else { } else {
query.beginTime = dates[0].valueOf(); query.beginTime = dates[0]?.startOf('day').valueOf()
query.endTime = dates[1].valueOf(); query.endTime = dates[0]?.endOf('day').valueOf()
} }
this.setState({ this.setState(
query:{ {
query: {
...query, ...query,
current: 1, current: 1,
},
},
() => {
this.props.onChange(this.state.query)
} }
}, () => { )
this.props.onChange(this.state.query);
})
} }
// 重置搜索条件 // 重置搜索条件
handleReset = () => { handleReset = () => {
this.setState({ this.setState(
{
query: DEFAULT_QUERY, query: DEFAULT_QUERY,
}, () => { },
this.props.onChange(this.state.query); () => {
}) this.props.onChange(this.state.query)
}
)
} }
render() { render() {
const { const {
query: { query: { courseName, courseState, shelfState },
courseName,
courseState,
shelfState,
},
expandFilter, expandFilter,
} = this.state; } = this.state
return ( return (
<div className="video-course-filter"> <div className='video-course-filter'>
<Row type="flex" justify="space-between" align="top"> <Row type='flex' justify='space-between' align='top'>
<div className="search-condition"> <div className='search-condition'>
<div className="search-condition__item"> <div className='search-condition__item'>
<span className="search-name">线下课名称:</span> <span className='search-name'>线下课名称:</span>
<Search <Search
value={courseName} value={courseName}
placeholder="搜索线下课名称" placeholder='搜索线下课名称'
onChange={(e) => { this.handleChangeQuery('courseName', e.target.value)}} onChange={(e) => {
onSearch={ () => { this.props.onChange(this.state.query) } } this.handleChangeQuery('courseName', e.target.value)
style={{ width: "calc(100% - 84px)" }} }}
enterButton={<span className="icon iconfont" style={{fontSize: '16px'}}>&#xe832;</span>} onSearch={() => {
this.props.onChange(this.state.query)
}}
style={{ width: 'calc(100% - 84px)' }}
enterButton={
<span className='icon iconfont' style={{ fontSize: '16px' }}>
&#xe832;
</span>
}
/> />
</div> </div>
<div className="search-condition__item"> <div className='search-condition__item'>
<span className="shelf-status">学院展示:</span> <span className='shelf-status'>学院展示:</span>
<Select <Select
style={{ width: "calc(100% - 84px)" }} style={{ width: 'calc(100% - 84px)' }}
placeholder="请选择" placeholder='请选择'
allowClear={true} allowClear={true}
value={shelfState} value={shelfState}
onChange={(value) => { this.handleChangeQuery('shelfState', value) }} onChange={(value) => {
suffixIcon={<span className="icon iconfont" style={{fontSize:'12px',color:'#BFBFBF'}}>&#xe835;</span>} this.handleChangeQuery('shelfState', value)
> }}
<Option value="YES">开启</Option> suffixIcon={
<Option value="NO">关闭</Option> <span className='icon iconfont' style={{ fontSize: '12px', color: '#BFBFBF' }}>
&#xe835;
</span>
}>
<Option value='YES'>开启</Option>
<Option value='NO'>关闭</Option>
</Select> </Select>
</div> </div>
</div> </div>
<div className="reset-fold-area"> <div className='reset-fold-area'>
<Tooltip title="清空筛选"><span className="resetBtn iconfont icon" onClick={this.handleReset}>&#xe61b; </span></Tooltip> <Tooltip title='清空筛选'>
<span className='resetBtn iconfont icon' onClick={this.handleReset}>
&#xe61b;{' '}
</span>
</Tooltip>
</div> </div>
</Row> </Row>
</div> </div>
...@@ -161,4 +187,4 @@ class OfflineCourseFilter extends React.Component { ...@@ -161,4 +187,4 @@ class OfflineCourseFilter extends React.Component {
} }
} }
export default OfflineCourseFilter; export default OfflineCourseFilter
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:11:57 * @Date: 2020-08-05 10:11:57
* @LastEditors: fusanqiasng * @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-28 14:07:37 * @LastEditTime: 2021-05-28 15:38:11
* @Description: 视频课-搜索模块 * @Description: 视频课-搜索模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -192,7 +192,6 @@ class VideoCourseFilter extends React.Component { ...@@ -192,7 +192,6 @@ class VideoCourseFilter extends React.Component {
teacherList, teacherList,
teacherQuery, teacherQuery,
categoryList, categoryList,
categoryName,
} = this.state } = this.state
console.log('categoryList', categoryList) console.log('categoryList', categoryList)
...@@ -276,10 +275,11 @@ class VideoCourseFilter extends React.Component { ...@@ -276,10 +275,11 @@ class VideoCourseFilter extends React.Component {
<TreeSelect <TreeSelect
treeNodeFilterProp='categoryName' treeNodeFilterProp='categoryName'
showSearch showSearch
value={categoryId || null}
style={{ width: 'calc(100% - 75px)' }} style={{ width: 'calc(100% - 75px)' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={categoryList} treeData={categoryList}
placeholder='请选择课程类型' placeholder='请选择课程分类'
allowClear allowClear
onChange={(value) => { onChange={(value) => {
this.handleChangeQuery('categoryId', value) this.handleChangeQuery('categoryId', value)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: zangsuyun * @Author: zangsuyun
* @Date: 2021-03-13 09:54:26 * @Date: 2021-03-13 09:54:26
* @LastEditors: fusanqiasng * @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-28 14:21:22 * @LastEditTime: 2021-05-28 15:35:33
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -453,10 +453,17 @@ class AddCourse extends React.Component { ...@@ -453,10 +453,17 @@ class AddCourse extends React.Component {
dataIndex: 'categoryName', dataIndex: 'categoryName',
render: (val, record) => { render: (val, record) => {
return ( return (
<Choose>
<When condition={videoCourseDivision === 'internal'}>
<div className='record__item'> <div className='record__item'>
{record.categoryOneName} {record.categoryOneName}
{record.categoryTwoName ? `-${record.categoryTwoName}` : ''} {record.categoryTwoName ? `-${record.categoryTwoName}` : ''}
</div> </div>
</When>
<Otherwise>
<div className='record__item'>{record.categorySonName}</div>
</Otherwise>
</Choose>
) )
}, },
}, },
......
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