|
|
|
@ -6,6 +6,8 @@ import { appUi } from '../../Layout/ApplicationLayout';
|
|
|
|
|
import { AppToaster } from '../Toaster';
|
|
|
|
|
import { inflate, MaterialIn, MaterialInAndAppendAppData } from '../../../Common/SerializeMaterial';
|
|
|
|
|
import { MaterialUrls, CURRENT_HOST } from '../../../Common/HostUrl';
|
|
|
|
|
import { observable } from 'mobx';
|
|
|
|
|
import { getFileSize } from '../../../Common/Utils';
|
|
|
|
|
|
|
|
|
|
export interface IImgListProps
|
|
|
|
|
{
|
|
|
|
@ -17,6 +19,7 @@ export interface IImgListProps
|
|
|
|
|
|
|
|
|
|
@observer
|
|
|
|
|
export class MaterialList extends React.Component<IImgListProps, {}> {
|
|
|
|
|
@observable private isShowSize = false;
|
|
|
|
|
private readyMtl;
|
|
|
|
|
private handleGetMtlJson = async (mat: { material_id: string }): Promise<string | undefined> =>
|
|
|
|
|
{
|
|
|
|
@ -71,6 +74,7 @@ export class MaterialList extends React.Component<IImgListProps, {}> {
|
|
|
|
|
public render()
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<ul
|
|
|
|
|
className="mat-list"
|
|
|
|
|
>
|
|
|
|
@ -88,6 +92,15 @@ export class MaterialList extends React.Component<IImgListProps, {}> {
|
|
|
|
|
>
|
|
|
|
|
<img src={`${CURRENT_HOST}/${mtl.logo}`} />
|
|
|
|
|
</div>
|
|
|
|
|
{
|
|
|
|
|
this.isShowSize &&
|
|
|
|
|
<div style={{
|
|
|
|
|
position: "absolute",
|
|
|
|
|
left: 5,
|
|
|
|
|
bottom: 25,
|
|
|
|
|
background: "#fff"
|
|
|
|
|
}}>{getFileSize(parseFloat(mtl.size))}</div>
|
|
|
|
|
}
|
|
|
|
|
<p title={mtl.name}>{mtl.name}</p>
|
|
|
|
|
<Popover
|
|
|
|
|
position={Position.RIGHT}
|
|
|
|
@ -125,6 +138,13 @@ export class MaterialList extends React.Component<IImgListProps, {}> {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
<Checkbox
|
|
|
|
|
checked={this.isShowSize}
|
|
|
|
|
style={{ position: "absolute", left: 20, bottom: 50 }}
|
|
|
|
|
label="显示文件大小"
|
|
|
|
|
onChange={() => this.isShowSize = !this.isShowSize}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|