单击react-admin中的显示按钮后,我无法显示图像吗?

时间:2019-06-17 14:12:03

标签: reactjs react-admin

我是新来反应js的人。我正在为我们的项目之一使用react-admin神庙。问题是,我正在使用API​​显示记录列表,对于每个记录,有多个文档上传。我为每个记录都指定了显示按钮,一旦单击按钮,与该记录相关的所有文档(图像)都应显示。我面临的问题是图像出现了一秒钟并消失了。我已附上屏幕截图以供参考。 谁能帮我解决这个问题?

导出类ReportsList扩展了React.Component {

constructor(props) {
    super(props);
    this.state = {
        appointments: []
    }
}




componentDidMount() {


    const id = this.props.match.params.id;
    this.loadConstruction(id);

    console.log(this.props);

}

render() {

    const {
        appointments = [],
        record = []
    } = this.state;

    let appointmentsArr = appointments.map((appointment) => {
        return (
            {
                id: appointment.id,

            }
        )
    });
    return (

        <List filters={<ReportListFilter />}  {...this.props} bulkActionButtons={false} actions={null} pagination={null} >

            <Datagrid rowClick="edit">
                <TextField label="Id" source="id" sortable={false} />
                <TextField label="Type" source="record_type.name" sortable={false} />
                <TextField label="Hospital" source="hospital.name" sortable={false} />

                <TextField label="Uploaded By" source="patient.user_profile.full_name" sortable={false} />

                <ChipField source="approval_status" sortable={false} />


                <ArrayField source="tags">
                    <SingleFieldList>
                        <TextField source="tags.name" />
                    </SingleFieldList>
                </ArrayField>

                <TextField label="Purpose" source="appointment.purpose" sortable={false} />
          <ShowButton />
            </Datagrid>
        </List>


    );
}

}

export const ReportsListShow = props =>(     

            <SimpleShowLayout>

            <ImageField source="documents" src="record_full_path"  />

            </SimpleShowLayout>


</Show>

);

List view Show List

0 个答案:

没有答案