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