zhengpengju 3 years ago
commit fe2ab589a1

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

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

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

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

Loading…
Cancel
Save