mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
材质资源管理权限测试,没有bug。
This commit is contained in:
parent
0e74da0c16
commit
b41ffb65d0
@ -18,6 +18,7 @@ Supported Languages: 中文 / [繁體中文](README-tw.md) / [English](README-en
|
||||
5. 音频资源管理权限测试,没有bug。
|
||||
6. 人物资源管理权限测试,没有bug。(没完成,忽视)
|
||||
7. 贴图资源管理权限测试,没有bug。
|
||||
8. 材质资源管理权限测试,没有bug。
|
||||
|
||||
## v0.3.7更新
|
||||
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
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 Ajax from '../../utils/Ajax';
|
||||
import UploadUtils from '../../utils/UploadUtils';
|
||||
import MaterialsSerializer from '../../serialization/material/MaterialsSerializer';
|
||||
|
||||
/**
|
||||
@ -31,6 +28,7 @@ class MaterialPanel extends React.Component {
|
||||
render() {
|
||||
const { className, style } = this.props;
|
||||
const { data, categoryData, name, categories } = this.state;
|
||||
const { enableAuthority, authorities } = app.server;
|
||||
|
||||
let list = data;
|
||||
|
||||
@ -69,6 +67,8 @@ class MaterialPanel extends React.Component {
|
||||
/>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
showEditButton={!enableAuthority || authorities.includes('EDIT_MATERIAL')}
|
||||
showDeleteButton={!enableAuthority || authorities.includes('DELETE_MATERIAL')}
|
||||
onClick={this.handleClick}
|
||||
onEdit={this.handleEdit}
|
||||
onDelete={this.handleDelete}
|
||||
|
||||
@ -207,6 +207,7 @@ class MaterialComponent extends React.Component {
|
||||
displacementScale, showRoughnessMap, roughnessMap, showMetalnessMap, metalnessMap, showSpecularMap, specularMap, showEnvMap, envMap,
|
||||
reflectivity, showLightMap, lightMap, showAoMap, aoMap, aoScale, showEmissiveMap, emissiveMap, side, flatShading, blending, opacity, transparent,
|
||||
alphaTest, wireframe, wireframeLinewidth } = this.state;
|
||||
const { enableAuthority, authorities } = app.server;
|
||||
|
||||
if (!show) {
|
||||
return null;
|
||||
@ -218,8 +219,12 @@ class MaterialComponent extends React.Component {
|
||||
onExpand={this.handleExpand}
|
||||
>
|
||||
<ButtonsProperty label={''}>
|
||||
<Button onClick={this.onSave}>{_t('Save')}</Button>
|
||||
<Button onClick={this.onLoad}>{_t('Select')}</Button>
|
||||
<Button show={!enableAuthority || authorities.includes('SAVE_MATERIAL')}
|
||||
onClick={this.onSave}
|
||||
>{_t('Save')}</Button>
|
||||
<Button show={!enableAuthority || authorities.includes('LIST_MATERIAL')}
|
||||
onClick={this.onLoad}
|
||||
>{_t('Select')}</Button>
|
||||
</ButtonsProperty>
|
||||
<SelectProperty label={_t('Type')}
|
||||
options={this.materials}
|
||||
@ -993,6 +998,7 @@ class MaterialComponent extends React.Component {
|
||||
}, result => {
|
||||
obj = JSON.parse(result);
|
||||
if (obj.Code === 200) {
|
||||
// TODO: 保存材质时,没有刷新材质面板。
|
||||
app.call(`showBottomPanel`, this, 'material');
|
||||
}
|
||||
app.toast(_t(obj.Msg));
|
||||
|
||||
@ -14,10 +14,10 @@ class Button extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { className, style, children, color, disabled } = this.props;
|
||||
const { className, style, children, color, disabled, show } = this.props;
|
||||
|
||||
return <button
|
||||
className={classNames('Button', color, disabled && 'disabled', className)}
|
||||
className={classNames('Button', color, disabled && 'disabled', !show && 'hidden', className)}
|
||||
style={style}
|
||||
disabled={disabled}
|
||||
onClick={this.handleClick}
|
||||
@ -39,6 +39,7 @@ Button.propTypes = {
|
||||
children: PropTypes.node,
|
||||
color: PropTypes.oneOf(['primary', 'success', 'warn', 'danger']),
|
||||
disabled: PropTypes.bool,
|
||||
show: PropTypes.bool,
|
||||
onClick: PropTypes.func
|
||||
};
|
||||
|
||||
@ -49,6 +50,7 @@ Button.defaultProps = {
|
||||
children: null,
|
||||
color: null,
|
||||
disabled: false,
|
||||
show: true,
|
||||
onClick: null
|
||||
};
|
||||
|
||||
|
||||
@ -29,4 +29,8 @@
|
||||
.Button.disabled {
|
||||
color: #fff;
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
|
||||
.Button.hidden {
|
||||
display: none;
|
||||
}
|
||||
@ -14,20 +14,22 @@ class ButtonsProperty extends React.Component {
|
||||
render() {
|
||||
const { className, style, children } = this.props;
|
||||
|
||||
return <div className={classNames('buttons', className)} style={style}>{children}</div>;
|
||||
return <div className={classNames('buttons', className)}
|
||||
style={style}
|
||||
>{children}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
ButtonsProperty.propTypes = {
|
||||
className: PropTypes.string,
|
||||
style: PropTypes.object,
|
||||
children: PropTypes.node,
|
||||
children: PropTypes.node
|
||||
};
|
||||
|
||||
ButtonsProperty.defaultProps = {
|
||||
className: null,
|
||||
style: null,
|
||||
children: null,
|
||||
children: null
|
||||
};
|
||||
|
||||
export default ButtonsProperty;
|
||||
Loading…
x
Reference in New Issue
Block a user