zhengpengju 3 years ago
commit fe2ab589a1

@ -44,7 +44,7 @@ const chapterColumns: ProColumns<TableListItem>[] = [
{ {
title: '课程', title: '课程',
valueType: 'select', valueType: 'select',
dataIndex: 'course_ids', dataIndex: 'course_names',
sorter: false, sorter: false,
hideInTable: false, hideInTable: false,
hideInForm: false, hideInForm: false,

@ -27,11 +27,11 @@ const TrainingRow = () => {
<Col {...topColResponsiveProps}> <Col {...topColResponsiveProps}>
<div className={styles.salesBar}> <div className={styles.salesBar}>
<ChartCard loading={courseBrowseTimesLoading} bordered={false} bodyStyle={{ padding: '20px 24px 8px', marginBottom: '24px' }} title="课程浏览量"> <ChartCard loading={courseBrowseTimesLoading} bordered={false} bodyStyle={{ padding: '20px 24px 8px', marginBottom: '24px' }} title="课程浏览量">
<div className={styles.salesBar}>111 <div className={styles.salesBar}>
<Column <Column
height={300} height={300}
forceFit forceFit
padding={[10, 10, 120, 20]} padding={[30, 30, 120, 60]}
data={courseBrowseTimesData as any} data={courseBrowseTimesData as any}
xField="course_name" xField="course_name"
yField="browse_times" yField="browse_times"
@ -39,7 +39,7 @@ const TrainingRow = () => {
formatter: (name, value: number) => { formatter: (name, value: number) => {
// const {name, value} = args; // const {name, value} = args;
console.log('args', name) console.log('args', name)
return { name: '浏览量', value: value }; return { name: '浏览量', value: name.browse_times };
} }
}} }}
xAxis={{ xAxis={{
@ -49,7 +49,7 @@ const TrainingRow = () => {
visible: false, visible: false,
}, },
label: { label: {
interval: 0,//横轴信息全部显示 interval: 0,//横轴信息全部显示
rotate: 0.3, rotate: 0.3,
autoEllipsis: true, autoEllipsis: true,
style: { style: {

@ -60,7 +60,8 @@ const IntroduceRow = () => {
formatter: (name, value: number) => { formatter: (name, value: number) => {
// const {name, value} = args; // const {name, value} = args;
console.log('args', name) console.log('args', name)
return { name: '关联培训数量', value: value }; console.log('value', value)
return { name: '关联培训数量', value: name.train_number};
} }
}} }}
xAxis={{ xAxis={{
@ -70,7 +71,7 @@ const IntroduceRow = () => {
visible: false, visible: false,
}, },
label: { label: {
interval: 0,//横轴信息全部显示 interval: 0,//横轴信息全部显示
rotate: 0.3,//-30度角倾斜显示 \ rotate: 0.3,//-30度角倾斜显示 \
autoEllipsis: true, autoEllipsis: true,
style: { style: {

@ -36,14 +36,15 @@ let school=0;
const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: DataItem[] }) => { const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: DataItem[] }) => {
const [provinceId, setProvinceId] = useState(cookie.load('background_province_id') ) const [provinceId, setProvinceId] = useState(cookie.load('background_province_id') )
const [cityList, setCityList] = useState([]); const [cityList, setCityList] = useState([]);
const [areaList, setAreaList] = useState([]); const [areaList, setAreaList] = useState([{id:0,name:'全部'}]);
const [schoolList, setSchoolList] = useState([]); const [schoolList, setSchoolList] = useState([]);
const [area, setArea] = useState(0);
const [options, setOptions] = useState([]); const [options, setOptions] = useState([]);
const [fetching, setFetching] = useState(false); const [fetching, setFetching] = useState(false);
const fetchRef = useRef(0); const fetchRef = useRef(0);
console.log('areaareaarea',area)
const { loading: courseBrowseTimesLoading, data: eduUnitList = null } = useRequest(() => getEduUnitList({ const { loading: courseBrowseTimesLoading, data: eduUnitList = null } = useRequest(() => getEduUnitList({
random_num: 277470, random_num: 277470,
area_id: provinceId, area_id: provinceId,
@ -114,7 +115,10 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
get_next: 1 get_next: 1
}); });
form.setFieldsValue({ area: 0 }) form.setFieldsValue({ area: 0 })
setAreaList(areaData || []); const list=[{id:0,name:'全部'}];
const areaList=list.concat(areaData);
setAreaList(areaList);
console.log('areaareaListareaListareaListList',areaList)
run() run()
} }
@ -200,7 +204,18 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
defaultValue={0} defaultValue={0}
onChange={(id) => { onChange={(id) => {
city_id=id; city_id=id;
getAreaData(id) if(id!==0){
getAreaData(id)
}else {
area_id=0;
setArea(0)
setAreaList([{id:0,name:'全部'}])
run();
console.log('area-----',area);
console.log('areaList-----',areaList);
}
}} }}
// defaultValue={provinceId} // defaultValue={provinceId}
@ -215,16 +230,20 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item name="area" label="区" > <Form.Item name="area" label="区" >
{console.log('')}
<Select <Select
key={area}
style={{ width: 120 }} style={{ width: 120 }}
defaultValue={0} defaultValue={0}
value={area}
onChange={(id) => { onChange={(id) => {
area_id=id; area_id=id;
setArea(id)
handleSearch(''); handleSearch('');
run() run()
}} }}
> >
<Option key={0} value={0}></Option> {/*<Option key={0} value={0}>全部</Option>*/}
{ {
areaList.length!==0? areaList.length!==0?
areaList.map((item)=>{ areaList.map((item)=>{

Loading…
Cancel
Save