|
@@ -385,7 +385,7 @@ export default class Edit extends React.PureComponent {
|
|
|
{item.isTemplate ? <IconFont type="iconmu" />:<IconFont type="iconkongbai" />}
|
|
|
</div>
|
|
|
{((item.type === 'pic'||item.type === 'mat') ? item.path : item.t || '').toString().replace(/#/g, '')}
|
|
|
- <Popover placement="right" content={<div><p onClick={() => this.setState({ visible: true, editIndex: item.index, editType: item.type, editName: item.type === 'pic' ? item.path : item.t || '' })}>重命名</p><p onClick={() => this.delElement(item.index, item.type === 'pic' ? item.path : item.t)}>删除</p></div>}>
|
|
|
+ <Popover placement="right" content={<div><p onClick={() => this.setState({ visible: true, editIndex: item.index, editType: item.type, editName: (item.type === 'pic'||item.type === 'mat' )? item.path : item.t || '' })}>重命名</p><p onClick={() => this.delElement(item.index, item.type === 'pic' ? item.path : item.t)}>删除</p></div>}>
|
|
|
<Icon type="setting" theme="filled" />
|
|
|
</Popover>
|
|
|
</li>
|
|
@@ -802,7 +802,7 @@ export default class Edit extends React.PureComponent {
|
|
|
title="重命名"
|
|
|
visible={this.state.visible}
|
|
|
onOk={() => {
|
|
|
- this.updateElement(this.state.editIndex, { [this.state.editType === 'pic' ? 'path' : 't']: '#' + this.state.editName + '#' })
|
|
|
+ this.updateElement(this.state.editIndex, { [(this.state.editType === 'pic'||this.state.editType === 'mat') ? 'path' : 't']: '#' + this.state.editName + '#' })
|
|
|
this.setState({ visible: false })
|
|
|
}}
|
|
|
onCancel={() => this.setState({ visible: false })}
|