diff --git a/package-lock.json b/package-lock.json index 372a0ba..3146368 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2164,6 +2164,11 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, + "blueimp-md5": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", + "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==" + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", diff --git a/package.json b/package.json index bb6b76f..0b43014 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "dependencies": { "axios": "^0.18.0", "babel-polyfill": "^6.26.0", + "blueimp-md5": "^2.19.0", "element-theme": "^2.0.1", "element-ui": "^2.13.0", "js-cookie": "^3.0.1", diff --git a/src/utils/api.js b/src/utils/api.js index ca10056..c5f3b38 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,12 +1,12 @@ import Setting from "@/setting"; +const host = Setting.apiBaseURL const uploadURL = Setting.uploadURL -const host = 'http://39.108.250.202:9000/' export default { logins: `users/users/user/login`, //登录 - verification: `${Setting.host}users/users/user/captcha`,// 验证码图片 + verification: `${host}users/users/user/captcha`,// 验证码图片 bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机 sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 @@ -50,19 +50,21 @@ export default { // 用户管理 delUserAccounts: `users/users/userAccount/delUserAccounts`, queryUserInfoDetails: `users/users/userAccount/queryUserInfoDetails`, + personalFile: `users/users/userAccount/personalFile`, queryUserInfoList: `users/users/userAccount/queryUserInfoList`, resetPwd: `users/users/userAccount/resetPwd`, selectAccountDetail: `users/users/userAccount/selectAccountDetail`, selectUserSysBind: `users/users/userAccount/selectUserSysBind`, updatePersonCenter: `users/users/userAccount/updatePersonCenter`, - updateUserAvatars: `${Setting.host}users/users/userAccount/updateUserAvatars`, + updateUserAvatars: `${host}users/users/userAccount/updateUserAvatars`, userInfo: `users/users/userAccount/userInfo`, - // bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`, - // sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`, + unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`, updateAccountEnable: `users/users/userAccount/updateAccountEnable`, updateAccountAllEnable: `users/users/userAccount/updateAccountAllEnable`, examinePassword: `users/users/userAccount/examinePassword`, + viewUserDetailsforNakadai: `users/users/userAccount/viewUserDetailsforNakadai`, + oneClickEnableVerification: `users/users/userAccount/oneClickEnableVerification`, queryOrder: `liuwanr/order/queryOrder`, //查询订单 queryOrderDetails: `liuwanr/order/queryOrderDetails`, //查询订单详情 @@ -227,8 +229,8 @@ export default { saveStaff: `nakadai/backstageStaff/saveStaff`, staffDetail: `nakadai/backstageStaff/staffDetail`, staffList: `nakadai/backstageStaff/staffList`, - importStaff: `${Setting.host}nakadai/backstageStaff/importStaff`, - exportFailure: `${Setting.host}nakadai/backstageStaff/exportFailure`, + importStaff: `${host}nakadai/backstageStaff/importStaff`, + exportFailure: `${host}nakadai/backstageStaff/exportFailure`, // 角色管理 batchRemove: `users/role/batchRemove`, //批量删除角色 diff --git a/src/views/course/contentSettings.vue b/src/views/course/contentSettings.vue index 269d5d2..1956535 100644 --- a/src/views/course/contentSettings.vue +++ b/src/views/course/contentSettings.vue @@ -16,6 +16,7 @@ 编辑顺序 @@ -39,7 +40,8 @@ - + + @@ -182,6 +184,25 @@
+ + + + + + + + + + + + + + + + 取消 + 确定 + + @@ -198,6 +219,7 @@ export default { }, id: this.$route.query.cid, chapters: [], + multipleSelection: [], sorting: false, uploading: false, uploadList: [], @@ -231,7 +253,13 @@ export default { pdfSrc: "", previewing: false, showProgress: false, - progressPercent: 0 + progressPercent: 0, + moveVisible: false, + sortList: [], + moveForm: { + id: '', + sort: '' + } }; }, components: { pdf }, @@ -257,6 +285,10 @@ export default { }); }, + // 处理多选 + handleSelectionChange(val) { + this.multipleSelection = val + }, goBack() { if (this.previewing) { this.closeIframe(); @@ -376,6 +408,85 @@ export default { sort() { this.sorting = true; }, + // 批量移动 + move() { + if (this.multipleSelection.length) { + this.moveForm = { + id: '', + sort: '' + } + this.sortList = [] + this.moveVisible = true + } else { + this.$message.warning('请选择小节!') + } + }, + // 目标章节选择回调 + chapterChange(id) { + const list = [] + // 获取多少个小节 + this.chapters.find(e => e.id === id).subsectionList.map((e, i) => { + list.push({ + id: i, + name: i+1 + }) + }) + // 置末和置顶写死 + this.sortList = [ + { + id: 'bottom', + name: '置末' + }, + ...list, + { + id: 'top', + name: '置顶' + } + ] + }, + // 资源移动保存 + 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 = [] + // 多选,所以循环调编辑接口 + list.map(e => { + promises.push(new Promise((resolve, reject) => { + this.$put(this.api.editSubsection, { + id: e.id, + cid: this.id, + chapterId: id, + sort + }).then(res => { + resolve() + }).catch(err => { + reject() + }) + })) + }) + // 编辑完后再获取列表,重新排sort,然后再调排序接口 + Promise.all(promises).then(() => { + this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`).then(({ chapterList }) => { + chapterList.forEach((n, k) => { + n.sort = k + 1 + n.subsectionList.forEach((j, i) => { + j.sort = i + 1 + }) + }) + this.$post(this.api.reorder, { + chapterVOList: chapterList + }).then(res => { + this.$message.success('移动成功!') + this.moveVisible = false + this.getData() + }).catch(res => {}) + }).catch(err => {}) + }) + }, cancelSort() { this.sorting = false; }, diff --git a/src/views/setting/info.vue b/src/views/setting/info.vue index df4b14c..0c8a4c2 100644 --- a/src/views/setting/info.vue +++ b/src/views/setting/info.vue @@ -1,6 +1,6 @@