58 lines
1.4 KiB
JavaScript
58 lines
1.4 KiB
JavaScript
const { WeaUpload } = ecCom;
|
|
|
|
class MinXiUDowm extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
...props,
|
|
};
|
|
}
|
|
componentDidMount() {
|
|
let datas=this.state.datas.length>0 ?[this.state.datas[`${this.props.rowIndex}`]]:[{}]
|
|
console.log(this.state.datas)
|
|
let value=this.state.datas.length>0 ?this.state.datas[this.props.rowIndex]['fileid'] :''
|
|
let onFileNameEdit=(newName, data)=> {
|
|
let datas=this.state.datas[0]
|
|
datas.filename=newName
|
|
datas=[datas]
|
|
this.setState({datas:datas})
|
|
}
|
|
let onDelete=(list,lists)=> {
|
|
let a=this.props.info[0].detailId
|
|
let b=this.props.rowIndex
|
|
WfForm.delDetailRow(`${a}`, `${b}`);
|
|
}
|
|
const base=WfForm.getBaseInfo()
|
|
|
|
if(base.nodeid!=this.props.info[0].nodeid){
|
|
datas[0].showDelete=false
|
|
}
|
|
this.setState({datas:datas,value:value,onFileNameEdit:onFileNameEdit,onDelete:onDelete})
|
|
}
|
|
reName = async (id,name) => {
|
|
let options = {
|
|
url: '/api/doc/acc/rename',
|
|
method: 'POST',
|
|
params: {
|
|
imagefileid: id,
|
|
imagefilename:name
|
|
},
|
|
};
|
|
let info = await window.weaJs.callApi(options);
|
|
}
|
|
render() {
|
|
const newProps = {
|
|
...this.state,
|
|
};
|
|
return (
|
|
<div style={{ width: '100%' }}>
|
|
<WeaUpload {...newProps} datas={newProps.datas} _noOverwrite={true} />
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
//发布模块
|
|
ecodeSDK.setCom('${appId}', 'MinXiUDowm', MinXiUDowm);
|
|
|