截图资源管理权限测试,没有bug。

This commit is contained in:
tengge1 2019-11-19 22:03:32 +08:00
parent df439e6a31
commit 833084ffaf
4 changed files with 14 additions and 10 deletions

View File

@ -22,6 +22,7 @@ Supported Languages: 中文 / [繁體中文](README-tw.md) / [English](README-en
9. 模型资源管理权限测试没有bug。
10. 粒子资源管理权限测试没有bug。没完成忽视
11. 预设体资源管理权限测试没有bug。没完成忽视
12. 截图资源管理权限测试没有bug。
## v0.3.7更新

View File

@ -1,8 +1,5 @@
import { classNames, PropTypes, SearchField, ImageList } from '../../third_party';
import EditWindow from './window/EditWindow.jsx';
import ModelLoader from '../../loader/ModelLoader';
import AddObjectCommand from '../../command/AddObjectCommand';
import UploadUtils from '../../utils/UploadUtils';
/**
* 截图面板
@ -30,6 +27,7 @@ class ScreenshotPanel extends React.Component {
render() {
const { className, style } = this.props;
const { data, categoryData, name, categories } = this.state;
const { enableAuthority, authorities } = app.server;
let list = data;
@ -67,6 +65,8 @@ class ScreenshotPanel extends React.Component {
/>
<ImageList
data={imageListData}
showEditButton={!enableAuthority || authorities.includes('EDIT_SCREENSHOT')}
showDeleteButton={!enableAuthority || authorities.includes('DELETE_SCREENSHOT')}
onClick={this.handleClick}
onEdit={this.handleEdit}
onDelete={this.handleDelete}
@ -106,7 +106,7 @@ class ScreenshotPanel extends React.Component {
});
}
handleSearch(name, categories, event) {
handleSearch(name, categories) {
this.setState({
name,
categories

View File

@ -37,6 +37,7 @@ class GeneralTools extends React.Component {
render() {
const { mode, view, isGridMode, isRecording } = this.state;
const { enableAuthority, authorities } = app.server;
return <>
<IconButton
@ -99,6 +100,7 @@ class GeneralTools extends React.Component {
<IconButton
icon={'camera'}
title={_t('Screenshot')}
show={!enableAuthority || authorities.includes('ADD_SCREENSHOT')}
onClick={this.handleScreenshot}
/>
<IconButton

View File

@ -14,20 +14,21 @@ class IconButton extends React.Component {
}
render() {
const { className, style, icon, name, title, show, selected } = this.props;
const { className, style, icon, title, show, selected } = this.props;
return <button
className={classNames('IconButton', selected && 'selected', !show && 'hidden', className)}
style={style}
title={title}
onClick={this.handleClick}>
<i className={classNames('iconfont', icon && 'icon-' + icon)}></i>
onClick={this.handleClick}
>
<i className={classNames('iconfont', icon && 'icon-' + icon)} />
</button>;
}
handleClick(event) {
const { name, onClick } = this.props;
onClick && onClick(name, event);
};
}
}
IconButton.propTypes = {
@ -38,7 +39,7 @@ IconButton.propTypes = {
title: PropTypes.string,
show: PropTypes.bool,
selected: PropTypes.bool,
onClick: PropTypes.func,
onClick: PropTypes.func
};
IconButton.defaultProps = {
@ -49,7 +50,7 @@ IconButton.defaultProps = {
title: null,
show: true,
selected: false,
onClick: null,
onClick: null
};
export default IconButton;