|
|
|
@ -200,7 +200,7 @@ |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="moveVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="moveSubmit">确定</el-button> |
|
|
|
|
<el-button type="primary" @click="moveConfirm">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -255,10 +255,19 @@ export default { |
|
|
|
|
showProgress: false, |
|
|
|
|
progressPercent: 0, |
|
|
|
|
moveVisible: false, |
|
|
|
|
sortList: [], |
|
|
|
|
sortList: [ |
|
|
|
|
{ |
|
|
|
|
id: 'bottom', |
|
|
|
|
name: '置末' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 'top', |
|
|
|
|
name: '置顶' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
moveForm: { |
|
|
|
|
id: '', |
|
|
|
|
sort: '' |
|
|
|
|
sort: 'bottom' |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
@ -292,9 +301,13 @@ export default { |
|
|
|
|
goBack() { |
|
|
|
|
if (this.previewing) { |
|
|
|
|
this.closeIframe(); |
|
|
|
|
} else { |
|
|
|
|
if (this.sorting) { |
|
|
|
|
this.sorting = false |
|
|
|
|
} else { |
|
|
|
|
this.$router.back() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
iframeOnload() { |
|
|
|
|
document.querySelector("#fileIframe").onload = e => { |
|
|
|
@ -413,9 +426,18 @@ export default { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
this.moveForm = { |
|
|
|
|
id: '', |
|
|
|
|
sort: '' |
|
|
|
|
sort: 'bottom' |
|
|
|
|
} |
|
|
|
|
this.sortList = [] |
|
|
|
|
this.sortList = [ |
|
|
|
|
{ |
|
|
|
|
id: 'bottom', |
|
|
|
|
name: '置末' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 'top', |
|
|
|
|
name: '置顶' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.moveVisible = true |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning('请选择小节!') |
|
|
|
@ -448,8 +470,6 @@ export default { |
|
|
|
|
moveSubmit() { |
|
|
|
|
const { moveForm } = this |
|
|
|
|
let { id, sort } = moveForm |
|
|
|
|
if (!id) return this.$message.warning('请选择目标章节') |
|
|
|
|
if (sort === '') return this.$message.warning('请选择目标排序') |
|
|
|
|
if (typeof sort === 'string') sort = sort === 'top' ? 0 : this.sortList.length - 2 // 置顶和置末直接给排序 |
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
const promises = [] |
|
|
|
@ -481,12 +501,19 @@ export default { |
|
|
|
|
chapterVOList: chapterList |
|
|
|
|
}).then(res => { |
|
|
|
|
this.$message.success('移动成功!') |
|
|
|
|
this.moveVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 资源移动校验 |
|
|
|
|
moveConfirm() { |
|
|
|
|
const { moveForm } = this |
|
|
|
|
let { id, sort } = moveForm |
|
|
|
|
if (!id) return this.$message.warning('请选择目标章节') |
|
|
|
|
if (sort === '') return this.$message.warning('请选择目标排序') |
|
|
|
|
this.moveVisible = false |
|
|
|
|
}, |
|
|
|
|
cancelSort() { |
|
|
|
|
this.sorting = false; |
|
|
|
|
}, |
|
|
|
@ -502,9 +529,8 @@ export default { |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.reorder, data).then(res => { |
|
|
|
|
this.sorting = false; |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
this.moveSubmit() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
editChapter(item) { |
|
|
|
|
this.chapterId = item.id; |
|
|
|
|