Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_aliyun_beta
杨树林 6 years ago
commit 41994149db

@ -822,9 +822,7 @@ class Fileslists extends Component{
max-height:350px; max-height:350px;
overflow-y: auto; overflow-y: auto;
} }
.drop_down_menu li {
overflow: visible;
}
.courseSecond{ .courseSecond{
margin-left: 10px; margin-left: 10px;
padding: 10px; padding: 10px;

@ -186,23 +186,26 @@ class BoardsNew extends Component{
}); });
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
confirm({ if(file.response!=undefined){
// title: '确定要删除这个附件吗?', confirm({
title: '是否确认删除?', // title: '确定要删除这个附件吗?',
title: '是否确认删除?',
okText: '确定',
cancelText: '取消', okText: '确定',
// content: 'Some descriptions', cancelText: '取消',
onOk: () => { // content: 'Some descriptions',
this.deleteAttachment(file) onOk: () => {
}, this.deleteAttachment(file)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
});
return false;
}
return false;
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
// 初次上传不能直接取uid // 初次上传不能直接取uid

@ -320,8 +320,11 @@ class CommonWorkPost extends Component{
// ModalSave: ()=>this.deleteAttachment(file), // ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
this.deleteAttachment(file) if(file.response!=undefined){
return false; this.deleteAttachment(file)
return false;
}
} }
cancelAttachment=()=>{ cancelAttachment=()=>{

@ -243,19 +243,22 @@ class NewWork extends Component{
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
this.props.confirm({ if(file.response!=undefined){
content: '是否确认删除?', this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
return false;
} }
deleteAttachment = (file, stateName) => { deleteAttachment = (file, stateName) => {
// 初次上传不能直接取uid // 初次上传不能直接取uid

@ -73,8 +73,9 @@ class AccessoryModal extends Component{
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
// return false; // return false;
if(file.response!=undefined){
this.deleteAttachment(file); this.deleteAttachment(file);
}
} }

@ -64,8 +64,10 @@ class AccessoryModal2 extends Component{
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
// return false; // return false;
if(file.response!=undefined){
this.deleteAttachment(file);
}
this.deleteAttachment(file);
} }

@ -296,37 +296,44 @@ class Selectsetting extends Component{
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
const { status } = response.data;
if (status == 0) {
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json` this.setState({
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` fileListtype:false,
axios.delete(url, { fileList:[]
}) })
.then((response) => { // this.setState((state) => {
if (response.data) { // const index = state.fileList.indexOf(file);
const { status } = response.data; // const newFileList = state.fileList.slice();
if (status == 0) { // newFileList.splice(index, 1);
// return {
this.setState({ // fileList: newFileList,
fileListtype:false, // };
fileList:[] // });
}) }
// this.setState((state) => {
// const index = state.fileList.indexOf(file);
// const newFileList = state.fileList.slice();
// newFileList.splice(index, 1);
// return {
// fileList: newFileList,
// };
// });
} }
} })
.catch(function (error) {
console.log(error);
});
this.setState({
fileListtype:false,
}) })
.catch(function (error) { }else{
console.log(error); this.setState({
}); fileListtype:false,
this.setState({ fileList:[]
fileListtype:false, })
}) }
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
} }
onChangeTimepublishs= (date, dateString,key) => { onChangeTimepublishs= (date, dateString,key) => {

@ -132,28 +132,34 @@ class Sendresource extends Component{
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
debugger if(file.response!=undefined){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
if (response.data) { if (response.data) {
const { status } = response.data; const { status } = response.data;
if (status == 0) { if (status == 0) {
this.setState({ this.setState({
fileListtype:false, fileListtype:false,
fileList:[] fileList:[]
}) })
} }
} }
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
this.setState({ this.setState({
fileListtype:false, fileListtype:false,
}) })
}else{
this.setState({
fileListtype:false,
fileList:[]
})
}
} }
ModalCancelModalCancel=()=>{ ModalCancelModalCancel=()=>{

@ -157,49 +157,52 @@ class GraduationTasksSubmitedit extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
let {attachments,fileList}=this.state; if(file.response!=undefined){
const url = `/attachments/${file}.json` let {attachments,fileList}=this.state;
axios.delete(url, { const url = `/attachments/${file}.json`
}) axios.delete(url, {
.then((response) => { })
if (response.data) { .then((response) => {
// const { status } = response.data; if (response.data) {
if (response.data.status === 0) { // const { status } = response.data;
console.log('--- success') if (response.data.status === 0) {
let newattachments=attachments; console.log('--- success')
if(file.uid===undefined){ let newattachments=attachments;
for(var i=0; i<newattachments.length; i++){ if(file.uid===undefined){
if(newattachments[i].id===file.id){ for(var i=0; i<newattachments.length; i++){
newattachments.splice(i, 1); if(newattachments[i].id===file.id){
} newattachments.splice(i, 1);
} }
}
} }
this.setState({ this.setState({
Modalstype:true, Modalstype:true,
Modalstopval:response.data.message, Modalstopval:response.data.message,
ModalSave:this.cancelAttachment, ModalSave:this.cancelAttachment,
Loadtype:true, Loadtype:true,
attachments:newattachments attachments:newattachments
}) })
this.setState((state) => { this.setState((state) => {
const index = state.fileList.indexOf(file); const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice(); const newFileList = state.fileList.slice();
newFileList.splice(index, 1); newFileList.splice(index, 1);
return { return {
fileList: newFileList, fileList: newFileList,
}; };
}); });
} }
} }
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
}
} }
inputSearchValue=(e)=>{ inputSearchValue=(e)=>{

@ -146,14 +146,16 @@ class GraduationTasksSubmitnew extends Component{
// }, // },
// }); // });
// return false; // return false;
if(file.response!=undefined){
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment
})
return false;
}
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment
})
return false;
} }
cancelAttachment=()=>{ cancelAttachment=()=>{

@ -88,21 +88,24 @@ class GraduationTasksappraiseMainEditor extends Component{
this.setState({ fileList }); this.setState({ fileList });
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
this.props.confirm({ if(file.response!=undefined){
content: '确定要删除这个附件吗?', this.props.confirm({
okText: '确定', content: '确定要删除这个附件吗?',
cancelText: '取消', okText: '确定',
// content: 'Some descriptions', cancelText: '取消',
onOk: () => { // content: 'Some descriptions',
this.deleteAttachment(file, stateName) onOk: () => {
}, this.deleteAttachment(file, stateName)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
});
return false;
}
return false;
} }
deleteAttachment = (file, stateName) => { deleteAttachment = (file, stateName) => {
// 初次上传不能直接取uid // 初次上传不能直接取uid

@ -148,39 +148,42 @@ class GraduationTasksedit extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
// debugger if(file.response!=undefined){
this.cancelAttachment(); // debugger
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` this.cancelAttachment();
// const url = `/attachments/${file}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { // const url = `/attachments/${file}.json`
}) axios.delete(url, {
.then((response) => { })
if (response.data) { .then((response) => {
if (response.data) {
if ( response.data.status === 0) {
if ( response.data.status === 0) {
this.setState({
Modalstype:false, this.setState({
Modalstopval:response.data.message, Modalstype:false,
ModalSave:this.cancelAttachment, Modalstopval:response.data.message,
Loadtype:true, ModalSave:this.cancelAttachment,
}) Loadtype:true,
})
this.setState((state) => {
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice(); const index = state.fileList.indexOf(file);
newFileList.splice(index, 1); const newFileList = state.fileList.slice();
return { newFileList.splice(index, 1);
fileList: newFileList, return {
}; fileList: newFileList,
}); };
} });
} }
}) }
.catch(function (error) { })
console.log(error); .catch(function (error) {
}); console.log(error);
});
}
} }
Commoninterface=(fileList)=>{ Commoninterface=(fileList)=>{

@ -173,30 +173,33 @@ class GraduationTasksnew extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` if(file.response!=undefined){
// const url = `/attachments/${file}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {}) // const url = `/attachments/${file}.json`
.then((response) => { axios.delete(url, {})
if (response.data) { .then((response) => {
const {status} = response.data; if (response.data) {
if (status == 0) { const {status} = response.data;
console.log('--- success') if (status == 0) {
console.log('--- success')
this.setState((state) => {
const index = state.fileList.indexOf(file); this.setState((state) => {
const newFileList = state.fileList.slice(); const index = state.fileList.indexOf(file);
newFileList.splice(index, 1); const newFileList = state.fileList.slice();
return { newFileList.splice(index, 1);
fileList: newFileList, return {
}; fileList: newFileList,
}); };
this.cancelAttachment() });
this.cancelAttachment()
}
} }
} })
}) .catch(function (error) {
.catch(function (error) { console.log(error);
console.log(error); });
}); }
} }
//滚动 //滚动

@ -215,19 +215,23 @@ class GraduateTopicNew extends Component{
this.setState({ fileList }); this.setState({ fileList });
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
confirm({
title: '确定要删除这个附件吗?', if(file.response!=undefined){
okText: '确定', confirm({
cancelText: '取消', title: '确定要删除这个附件吗?',
// content: 'Some descriptions', okText: '确定',
onOk: () => { cancelText: '取消',
this.deleteAttachment(file) // content: 'Some descriptions',
}, onOk: () => {
onCancel() { this.deleteAttachment(file)
console.log('Cancel'); },
}, onCancel() {
}); console.log('Cancel');
return false; },
});
return false;
}
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
console.log(file); console.log(file);

@ -163,21 +163,25 @@ class GraduateTopicPostWorksNew extends Component{
this.setState({ fileList }); this.setState({ fileList });
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
confirm({ if(file.response!=undefined){
title: '确定要删除这个附件吗?', confirm({
okText: '确定', title: '确定要删除这个附件吗?',
cancelText: '取消', okText: '确定',
// content: 'Some descriptions', cancelText: '取消',
onOk: () => { // content: 'Some descriptions',
this.deleteAttachment(file) onOk: () => {
}, this.deleteAttachment(file)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
});
return false;
}
return false;
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
const url = `/attachments/${file.id}.json` const url = `/attachments/${file.id}.json`

@ -73,18 +73,21 @@ class CreateGroupByImportModal extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
this.props.confirm({ if(file.response!=undefined){
content: '是否确认删除?', this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file) onOk: () => {
}, this.deleteAttachment(file)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
});
return false;
}
return false;
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`

@ -561,21 +561,24 @@ class MemoNew extends Component {
} }
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
this.props.confirm({ if(file.response!=undefined){
// title: '确定要删除这个附件吗?', this.props.confirm({
content: '是否确认删除?', // title: '确定要删除这个附件吗?',
content: '是否确认删除?',
okText: '确定',
cancelText: '取消', okText: '确定',
// content: 'Some descriptions', cancelText: '取消',
onOk: () => { // content: 'Some descriptions',
this.deleteAttachment(file) onOk: () => {
}, this.deleteAttachment(file)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
return false; });
return false;
}
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
// 初次上传不能直接取uid // 初次上传不能直接取uid

@ -47,16 +47,19 @@ class CaseNew extends Component{
// 上传附件-删除确认框 // 上传附件-删除确认框
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
this.props.confirm({ if(file.response!=undefined){
content: '是否确认删除?', this.props.confirm({
onOk: () => { content: '是否确认删除?',
this.deleteAttachment(file, stateName) onOk: () => {
}, this.deleteAttachment(file, stateName)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
return false; });
return false;
}
} }
// 上传附件-确认删除 // 上传附件-确认删除

@ -1384,20 +1384,23 @@ export default class TPMsettings extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
confirm({ if(file.response!=undefined){
title: '确定要删除这个附件吗?', confirm({
okText: '确定', title: '确定要删除这个附件吗?',
cancelText: '取消', okText: '确定',
// content: 'Some descriptions', cancelText: '取消',
onOk: () => { // content: 'Some descriptions',
console.log("665") onOk: () => {
this.deleteAttachment(file) console.log("665")
}, this.deleteAttachment(file)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
return false; });
return false;
}
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {

@ -772,20 +772,23 @@ class Newshixuns extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
confirm({ if(file.response!=undefined){
title: '确定要删除这个附件吗?', confirm({
okText: '确定', title: '确定要删除这个附件吗?',
cancelText: '取消', okText: '确定',
// content: 'Some descriptions', cancelText: '取消',
onOk: () => { // content: 'Some descriptions',
console.log("665") onOk: () => {
this.deleteAttachment(file) console.log("665")
}, this.deleteAttachment(file)
onCancel() { },
console.log('Cancel'); onCancel() {
}, console.log('Cancel');
}); },
return false; });
return false;
}
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
console.log(file); console.log(file);

Loading…
Cancel
Save