qm-bus
Version:
千米公有云业务组件库
38 lines (34 loc) • 972 B
JavaScript
import React, { Component } from 'react'
import { Relax } from 'iflux2'
import CategoryBar from './CategoryBar'
import GalleryBody from './GalleryBody'
import { scopeQL, fileTypeQL } from '../ql'
const noop = () => {}
export default class GalleryComponent extends Component {
static defaultProps = {
scope: scopeQL,
fileType: fileTypeQL,
onFormReset: noop,
elementOnChange: noop,
onRefresh: noop,
}
componentWillMount() {
let value = this.props.fileType || 'pic'
this.props.onFormReset('simple')
this.props.elementOnChange({
index: 'fileType',
source: { index: 'fileType', value: value, group: 'simple' },
})
}
render() {
const { scope, JudgementPlatform } = this.props
const isPersonal = scope === 'personal'
return (
<div className="picture-library">
{isPersonal ? null : <CategoryBar />}
<GalleryBody JudgementPlatform={JudgementPlatform} />
</div>
)
}
}