Commit 66fa34f4 by guomingpang

fix:修改测试bug

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