From a002705fe4dd0c065ca2c4bb3ac693923c4e0554 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Tue, 15 Nov 2022 00:33:39 +0800
Subject: [PATCH 01/17] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=88=86=E9=A1=B5?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 3 +-
src/api/user.js | 4 +-
src/api/vod/teacher.js | 29 +++++++
src/router/index.js | 22 +++++
src/store/modules/user.js | 8 +-
src/views/vod/teacher/form.vue | 87 ++++++++++++++++++++
src/views/vod/teacher/list.vue | 143 +++++++++++++++++++++++++++++++++
7 files changed, 289 insertions(+), 7 deletions(-)
create mode 100644 src/api/vod/teacher.js
create mode 100644 src/views/vod/teacher/form.vue
create mode 100644 src/views/vod/teacher/list.vue
diff --git a/.env.development b/.env.development
index de583d0940..5616f1ca14 100644
--- a/.env.development
+++ b/.env.development
@@ -2,4 +2,5 @@
ENV = 'development'
# base api
-VUE_APP_BASE_API = '/dev-api'
+# VUE_APP_BASE_API = '/dev-api'
+VUE_APP_BASE_API = 'HTTP://LOCALHOST:8301'
diff --git a/src/api/user.js b/src/api/user.js
index 8ff4389dba..218db72d5d 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -2,7 +2,7 @@ import request from '@/utils/request'
export function login(data) {
return request({
- url: '/vue-admin-template/user/login',
+ url: '/admin/vod/user/login',
method: 'post',
data
})
@@ -10,7 +10,7 @@ export function login(data) {
export function getInfo(token) {
return request({
- url: '/vue-admin-template/user/info',
+ url: '/admin/vod/user/info',
method: 'get',
params: { token }
})
diff --git a/src/api/vod/teacher.js b/src/api/vod/teacher.js
new file mode 100644
index 0000000000..91b56e1a3e
--- /dev/null
+++ b/src/api/vod/teacher.js
@@ -0,0 +1,29 @@
+import request from '@/utils/request'
+
+const api_name = '/admin/vod/teacher'
+
+export default {
+ //讲师列表
+ pageList(page, limit, searchObj) {
+ return request({
+ url: `${api_name}/findQueryPage/${page}/${limit}`,
+ method: `post`,
+ data: searchObj
+ })
+ },
+ //讲师删除
+ removeById(id) {
+ return request({
+ url: `${api_name}/remove/${id}`,
+ method: `delete`
+ })
+ },
+ //讲师添加
+ saveTeacher(teacher) {
+ return request({
+ url: `${api_name}/saveTeacher`,
+ method: `post`,
+ data:teacher
+ })
+ },
+}
diff --git a/src/router/index.js b/src/router/index.js
index 13459e90e2..ca51d3259a 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -55,6 +55,28 @@ export const constantRoutes = [
}]
},
+ {
+ path: '/vod',
+ component: Layout,
+ redirect: '/vod/teacher/list',
+ name: 'vod',
+ meta: { title: '讲师管理', icon: 'el-icon-s-help' },
+ children: [
+ {
+ path: 'teacher/list',
+ name: 'TeacherList',
+ component: () => import('@/views/vod/teacher/list'),
+ meta: { title: '讲师列表', icon: 'table' }
+ },
+ {
+ path: 'teacher/create',
+ name: 'TeacherCreate',
+ component: () => import('@/views/vod/teacher/form'),
+ meta: { title: '添加讲师', icon: 'tree' }
+ }
+ ]
+ },
+
{
path: '/example',
component: Layout,
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 2f6423fa9c..550dc84488 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -67,14 +67,14 @@ const actions = {
// user logout
logout({ commit, state }) {
return new Promise((resolve, reject) => {
- logout(state.token).then(() => {
+ //logout(state.token).then(() => {
removeToken() // must remove token first
resetRouter()
commit('RESET_STATE')
resolve()
- }).catch(error => {
- reject(error)
- })
+ //}).catch(error => {
+ //reject(error)
+ //})
})
},
diff --git a/src/views/vod/teacher/form.vue b/src/views/vod/teacher/form.vue
new file mode 100644
index 0000000000..062048f103
--- /dev/null
+++ b/src/views/vod/teacher/form.vue
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
diff --git a/src/views/vod/teacher/list.vue b/src/views/vod/teacher/list.vue
new file mode 100644
index 0000000000..9095f04fd6
--- /dev/null
+++ b/src/views/vod/teacher/list.vue
@@ -0,0 +1,143 @@
+
+
+ 讲师列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 清空
+
+
+
+
+
+
+
+
+ {{ (page - 1) * limit + scope.$index + 1 }}
+
+
+
+
+
+ 高级讲师
+ 首席讲师
+
+
+
+
+
+
+
+ 删除
+
+ 修改
+
+
+
+
+
+
+
+
+
+
+
From af8e24eeebd5d4d3d7b6ae4cd9fa9be3b0d107f5 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Wed, 16 Nov 2022 10:46:31 +0800
Subject: [PATCH 02/17] =?UTF-8?q?47-49=E6=95=B0=E6=8D=AE=E5=9B=9E=E6=98=BE?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/vod/teacher.js | 13 +++++++++
src/router/index.js | 7 +++++
src/views/vod/teacher/form.vue | 49 ++++++++++++++++++++++------------
3 files changed, 52 insertions(+), 17 deletions(-)
diff --git a/src/api/vod/teacher.js b/src/api/vod/teacher.js
index 91b56e1a3e..4258d750e2 100644
--- a/src/api/vod/teacher.js
+++ b/src/api/vod/teacher.js
@@ -26,4 +26,17 @@ export default {
data:teacher
})
},
+ getById(id) {
+ return request({
+ url: `${api_name}/getTeacher/${id}`,
+ method: `get`
+ })
+ },
+ updateTeacher(teacher) {
+ return request({
+ url: `${api_name}/updateTeacher`,
+ method: `post`,
+ data: teacher
+ })
+ },
}
diff --git a/src/router/index.js b/src/router/index.js
index ca51d3259a..341fd232b6 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -73,6 +73,13 @@ export const constantRoutes = [
name: 'TeacherCreate',
component: () => import('@/views/vod/teacher/form'),
meta: { title: '添加讲师', icon: 'tree' }
+ },
+ {
+ path: 'teacher/edit/:id',
+ name: 'TeacherEdit',
+ component: () => import('@/views/vod/teacher/form'),
+ meta: { title: '编辑讲师' },
+ hidden: true
}
]
},
diff --git a/src/views/vod/teacher/form.vue b/src/views/vod/teacher/form.vue
index 062048f103..582e660f25 100644
--- a/src/views/vod/teacher/form.vue
+++ b/src/views/vod/teacher/form.vue
@@ -55,33 +55,48 @@ export default {
},
// 页面渲染成功
created() {
-
+ // 获取id,根据id查询得到数据
+ if (this.$route.params.id) {
+ this.fetchDataById(this.$route.params.id)
+ }
},
methods: {
- saveOrUpdate() {
- // 禁用保存按钮
- this.saveBtnDisabled = true
- if (!this.teacher.id) {
- this.saveData()
- } else {
- this.updateData()
- }
+ fetchDataById(id){
+ teacherApi.getById(id).then(response => {
+ this.teacher = response.data
+ })
},
- // 新增讲师
- saveData() {
- // debugger
+ //添加
+ save(){
+ // debugger
teacherApi.saveTeacher(this.teacher).then(response => {
this.$message({
type: 'success',
- message: response.message
+ message: '添加成功!'
})
this.$router.push({ path: '/vod/teacher/list' })
})
},
- // 根据id更新记录
- updateData() {
-
- }
+ //修改
+ updateData(){
+ // teacher数据的获取
+ teacherApi.updateTeacher(this.teacher).then(response => {
+ this.$message({
+ type: 'success',
+ message: '修改成功!'
+ })
+ this.$router.push({ path: '/vod/teacher/list' })
+ })
+ },
+ saveOrUpdate() {
+ // 禁用保存按钮
+ this.saveBtnDisabled = true
+ if (!this.teacher.id) {
+ this.save()
+ } else {
+ this.updateData()
+ }
+ },
}
}
From ba11a845cbcbd9476291c7e3e7dfa9a0c14ac453 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Wed, 16 Nov 2022 14:08:39 +0800
Subject: [PATCH 03/17] =?UTF-8?q?49=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/vod/teacher.js | 10 +++++++
src/views/vod/teacher/list.vue | 53 ++++++++++++++++++++++++++++++++--
2 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/src/api/vod/teacher.js b/src/api/vod/teacher.js
index 4258d750e2..97273cdc30 100644
--- a/src/api/vod/teacher.js
+++ b/src/api/vod/teacher.js
@@ -26,12 +26,14 @@ export default {
data:teacher
})
},
+ //根据id得到数据
getById(id) {
return request({
url: `${api_name}/getTeacher/${id}`,
method: `get`
})
},
+ //更新数据
updateTeacher(teacher) {
return request({
url: `${api_name}/updateTeacher`,
@@ -39,4 +41,12 @@ export default {
data: teacher
})
},
+ //批量删除
+ batchRemove(idList) {
+ return request({
+ url: `${api_name}/removeBatch`,
+ method: `delete`,
+ data: idList
+ })
+ }
}
diff --git a/src/views/vod/teacher/list.vue b/src/views/vod/teacher/list.vue
index 9095f04fd6..ef544a942d 100644
--- a/src/views/vod/teacher/list.vue
+++ b/src/views/vod/teacher/list.vue
@@ -32,7 +32,13 @@
清空
-
+
+
+
+ 数据列表
+ 添加
+ 批量删除
+
{
+ // 点击确定,远程调用ajax
+ // 遍历selection,将id取出放入id列表
+ var idList = []
+ this.multipleSelection.forEach(item => {
+ idList.push(item.id)
+ })
+ // 调用api
+ return teacherApi.batchRemove(idList)
+ }).then((response) => {
+ this.fetchData()
+ this.$message.success(response.message)
+ }).catch(error => {
+ if (error === 'cancel') {
+ this.$message.info('取消删除')
+ }
+ })
+ },
+ //复选框发生变化,调用方法,选中复选框行内容进行传递
+ handleSelectionChange(selection){
+ console.log(selection)
+ this.multipleSelection = selection
+ },
+
+ //跳转到表单添加页面
+ add(){
+ this.$router.push({path:'/vod/teacher/create'})
+ },
+
fetchData() {
// 调用api
teacherApi.pageList(this.page, this.limit, this.searchObj).then(response => {
@@ -108,6 +155,7 @@ export default {
this.total = response.data.total
})
},
+
// 每页记录数改变,size:回调参数,表示当前选中的“每页条数”
changePageSize(size) {
this.limit = size
@@ -125,6 +173,7 @@ export default {
this.searchObj = {}
this.fetchData()
},
+
// 根据id删除数据
removeById(id) {
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
From 8e29d1443f241fe005b74d63e0ceef7fafcb223e Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Fri, 18 Nov 2022 21:36:03 +0800
Subject: [PATCH 04/17] =?UTF-8?q?53=E5=A4=B4=E5=83=8F=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E6=9C=89bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
src/views/vod/teacher/form.vue | 45 ++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+)
diff --git a/.gitignore b/.gitignore
index 9ad28d23dd..0a730a8258 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ tests/**/coverage/
*.ntvs*
*.njsproj
*.sln
+.history/*
diff --git a/src/views/vod/teacher/form.vue b/src/views/vod/teacher/form.vue
index 582e660f25..713c8f0883 100644
--- a/src/views/vod/teacher/form.vue
+++ b/src/views/vod/teacher/form.vue
@@ -30,6 +30,16 @@
+
+
+
+
@@ -61,6 +71,41 @@ export default {
}
},
methods: {
+ // 上传成功回调
+ handleAvatarSuccess(res, file) {
+ console.log(res)
+ if (res.code==20000) {
+ console.log(res)
+ this.teacher.avatar = res.data
+ // 强制重新渲染
+ this.$forceUpdate()
+ } else {
+ this.$message.error('上传失败 (非0)')
+ }
+ },
+
+ // 错误处理
+ handleAvatarError() {
+ console.log('error')
+ debugger
+ this.$message.error('上传失败(http失败)')
+ },
+
+ // 上传校验
+ beforeAvatarUpload(file) {
+ const isJPG = file.type === 'image/jpeg'
+ const isLt2M = file.size / 1024 / 1024 < 2
+ debugger
+ if (!isJPG) {
+ this.$message.error('上传头像图片只能是 JPG 格式!')
+ }
+ if (!isLt2M) {
+ this.$message.error('上传头像图片大小不能超过 2MB!')
+ }
+ return isJPG && isLt2M
+ },
+
+ //根据id回显数据
fetchDataById(id){
teacherApi.getById(id).then(response => {
this.teacher = response.data
From 077b3baf73dba30234b2e8165306dc983fedadd7 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Sat, 19 Nov 2022 20:59:37 +0800
Subject: [PATCH 05/17] =?UTF-8?q?56=E8=AF=BE=E7=A8=8B=E5=88=86=E7=B1=BB?=
=?UTF-8?q?=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/vod/subject.js | 13 +++++++++
src/router/index.js | 17 ++++++++++++
src/views/vod/subject/list.vue | 50 ++++++++++++++++++++++++++++++++++
vue.config.js | 2 +-
4 files changed, 81 insertions(+), 1 deletion(-)
create mode 100644 src/api/vod/subject.js
create mode 100644 src/views/vod/subject/list.vue
diff --git a/src/api/vod/subject.js b/src/api/vod/subject.js
new file mode 100644
index 0000000000..4a3f348bce
--- /dev/null
+++ b/src/api/vod/subject.js
@@ -0,0 +1,13 @@
+import request from '@/utils/request'
+
+const api_name = '/admin/vod/subject'
+
+export default {
+ // 课程分类列表接口
+ getChildList(id) {
+ return request({
+ url: `${api_name}/getChildSubject/${id}`,
+ method: 'get'
+ })
+ }
+}
diff --git a/src/router/index.js b/src/router/index.js
index 341fd232b6..ab39f12376 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -106,6 +106,23 @@ export const constantRoutes = [
]
},
+ {
+ path: '/subject',
+ component: Layout,
+ redirect: '/subject/list',
+ name: '课程分类管理',
+ alwaysShow: true,
+ meta: { title: '课程分类管理', icon: 'example' },
+ children: [
+ {
+ path: 'list',
+ name: '课程分类列表',
+ component: () => import('@/views/vod/subject/list'),
+ meta: { title: '课程分类列表', icon: 'table' }
+ }
+ ]
+ },
+
{
path: '/form',
component: Layout,
diff --git a/src/views/vod/subject/list.vue b/src/views/vod/subject/list.vue
new file mode 100644
index 0000000000..8ceafbe8fb
--- /dev/null
+++ b/src/views/vod/subject/list.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vue.config.js b/vue.config.js
index 4856ed02a7..24fb6d5463 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -27,7 +27,7 @@ module.exports = {
publicPath: '/',
outputDir: 'dist',
assetsDir: 'static',
- lintOnSave: process.env.NODE_ENV === 'development',
+ lintOnSave: false, //process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: port,
From 83a712472a9197690706c7dc37105e397db50bc3 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Sun, 20 Nov 2022 11:10:31 +0800
Subject: [PATCH 06/17] =?UTF-8?q?59-=E8=AF=BE=E7=A8=8B=E5=AF=BC=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/vod/subject/list.vue | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/views/vod/subject/list.vue b/src/views/vod/subject/list.vue
index 8ceafbe8fb..16f3877d6b 100644
--- a/src/views/vod/subject/list.vue
+++ b/src/views/vod/subject/list.vue
@@ -18,7 +18,16 @@
label="创建时间">
+
+
+
+
+
From 8f0d6c44fa4921557140c9721dc62864dacf069f Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Tue, 22 Nov 2022 16:11:15 +0800
Subject: [PATCH 09/17] =?UTF-8?q?65-=E8=AF=BE=E7=A8=8B=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/vod/course.js | 26 ++
src/views/vod/course/chart.vue | 0
.../vod/course/components/Chapter/index.vue | 68 +++++
src/views/vod/course/components/Info.vue | 234 ++++++++++++++++++
src/views/vod/course/components/Publish.vue | 0
src/views/vod/course/form.vue | 45 ++++
src/views/vod/course/list.vue | 2 +-
7 files changed, 374 insertions(+), 1 deletion(-)
create mode 100644 src/views/vod/course/chart.vue
create mode 100644 src/views/vod/course/components/Chapter/index.vue
create mode 100644 src/views/vod/course/components/Info.vue
create mode 100644 src/views/vod/course/components/Publish.vue
create mode 100644 src/views/vod/course/form.vue
diff --git a/src/api/vod/course.js b/src/api/vod/course.js
index e9dbe28117..0895b51f8d 100644
--- a/src/api/vod/course.js
+++ b/src/api/vod/course.js
@@ -11,4 +11,30 @@ export default {
params: searchObj
})
},
+
+ //添加课程基本信息
+ saveCourseInfo(courseInfo) {
+ return request({
+ url: `${api_name}/save`,
+ method: 'post',
+ data: courseInfo
+ })
+ },
+
+ //id获取课程信息
+ getCourseInfoById(id) {
+ return request({
+ url: `${api_name}/get/${id}`,
+ method: 'get'
+ })
+ },
+ //修改课程信息
+ updateCourseInfoById(courseInfo) {
+ return request({
+ url: `${api_name}/update`,
+ method: 'post',
+ data: courseInfo
+ })
+ },
+
}
diff --git a/src/views/vod/course/chart.vue b/src/views/vod/course/chart.vue
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/views/vod/course/components/Chapter/index.vue b/src/views/vod/course/components/Chapter/index.vue
new file mode 100644
index 0000000000..217584c96c
--- /dev/null
+++ b/src/views/vod/course/components/Chapter/index.vue
@@ -0,0 +1,68 @@
+
+
+
+
+
diff --git a/src/views/vod/course/components/Info.vue b/src/views/vod/course/components/Info.vue
new file mode 100644
index 0000000000..e0f34fa0cd
--- /dev/null
+++ b/src/views/vod/course/components/Info.vue
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 元
+
+
+
+
+ 保存并下一步
+
+
+
+
+
diff --git a/src/views/vod/course/components/Publish.vue b/src/views/vod/course/components/Publish.vue
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/views/vod/course/form.vue b/src/views/vod/course/form.vue
new file mode 100644
index 0000000000..9636de1758
--- /dev/null
+++ b/src/views/vod/course/form.vue
@@ -0,0 +1,45 @@
+
+
+
发布新课程
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/vod/course/list.vue b/src/views/vod/course/list.vue
index 0979092cb4..02a669136f 100644
--- a/src/views/vod/course/list.vue
+++ b/src/views/vod/course/list.vue
@@ -204,7 +204,7 @@ export default {
},
add() {
- this.$router.push({ path: '/vod/course/info' })
+ this.$router.push({ path: '/vodcourse/course/info' })
},
// 每页记录数改变,size:回调参数,表示当前选中的“每页条数”
From 0922482a775fb00e24f87cbf417c73abdca3aa0e Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Tue, 22 Nov 2022 20:20:45 +0800
Subject: [PATCH 10/17] =?UTF-8?q?=E5=A4=A7=E7=BA=B2=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E7=AB=A0=E5=B0=8F=E8=8A=82=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/vod/chapter.js | 43 +++++
src/api/vod/video.js | 36 ++++
.../vod/course/components/Chapter/Form.vue | 83 +++++++++
.../vod/course/components/Chapter/index.vue | 113 +++++++++++-
.../vod/course/components/Video/Form.vue | 162 ++++++++++++++++++
5 files changed, 435 insertions(+), 2 deletions(-)
create mode 100644 src/api/vod/chapter.js
create mode 100644 src/api/vod/video.js
create mode 100644 src/views/vod/course/components/Chapter/Form.vue
create mode 100644 src/views/vod/course/components/Video/Form.vue
diff --git a/src/api/vod/chapter.js b/src/api/vod/chapter.js
new file mode 100644
index 0000000000..6771d277db
--- /dev/null
+++ b/src/api/vod/chapter.js
@@ -0,0 +1,43 @@
+import request from '@/utils/request'
+
+const api_name = '/admin/vod/chapter'
+
+export default {
+
+ getNestedTreeList(courseId) {
+ return request({
+ url: `${api_name}/getNestedTreeList/${courseId}`,
+ method: 'get'
+ })
+ },
+
+ removeById(id) {
+ return request({
+ url: `${api_name}/remove/${id}`,
+ method: 'delete'
+ })
+ },
+
+ save(chapter) {
+ return request({
+ url: `${api_name}/save`,
+ method: 'post',
+ data: chapter
+ })
+ },
+
+ getById(id) {
+ return request({
+ url: `${api_name}/get/${id}`,
+ method: 'get'
+ })
+ },
+
+ updateById(chapter) {
+ return request({
+ url: `${api_name}/update`,
+ method: 'post',
+ data: chapter
+ })
+ }
+}
diff --git a/src/api/vod/video.js b/src/api/vod/video.js
new file mode 100644
index 0000000000..094df3e011
--- /dev/null
+++ b/src/api/vod/video.js
@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+
+const api_name = '/admin/vod/video'
+
+export default {
+
+ save(video) {
+ return request({
+ url: `${api_name}/save`,
+ method: 'post',
+ data: video
+ })
+ },
+
+ getById(id) {
+ return request({
+ url: `${api_name}/get/${id}`,
+ method: 'get'
+ })
+ },
+
+ updateById(video) {
+ return request({
+ url: `${api_name}/update`,
+ method: 'put',
+ data: video
+ })
+ },
+
+ removeById(id) {
+ return request({
+ url: `${api_name}/remove/${id}`,
+ method: 'delete'
+ })
+ }
+}
diff --git a/src/views/vod/course/components/Chapter/Form.vue b/src/views/vod/course/components/Chapter/Form.vue
new file mode 100644
index 0000000000..6e01129e16
--- /dev/null
+++ b/src/views/vod/course/components/Chapter/Form.vue
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/vod/course/components/Chapter/index.vue b/src/views/vod/course/components/Chapter/index.vue
index 217584c96c..af56089b6d 100644
--- a/src/views/vod/course/components/Chapter/index.vue
+++ b/src/views/vod/course/components/Chapter/index.vue
@@ -1,5 +1,48 @@
+
+
+
+ 添加章节
+
+
+
+
+
+
+
+
上一步
下一步
@@ -7,16 +50,81 @@
From 9484021a29c1b4a7e6daa1e3d3a12bb6f209bcb8 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Tue, 22 Nov 2022 21:49:15 +0800
Subject: [PATCH 11/17] =?UTF-8?q?74-=E5=88=A0=E9=99=A4=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/vod/course.js | 23 +++++
src/views/vod/course/components/Publish.vue | 108 ++++++++++++++++++++
src/views/vod/course/list.vue | 19 ++++
3 files changed, 150 insertions(+)
diff --git a/src/api/vod/course.js b/src/api/vod/course.js
index 0895b51f8d..ede052b350 100644
--- a/src/api/vod/course.js
+++ b/src/api/vod/course.js
@@ -37,4 +37,27 @@ export default {
})
},
+ //获取发布课程信息
+ getCoursePublishById(id) {
+ return request({
+ url: `${api_name}/getCoursePublishVo/${id}`,
+ method: 'get'
+ })
+ },
+ //发布课程
+ publishCourseById(id) {
+ return request({
+ url: `${api_name}/publishCourseById/${id}`,
+ method: 'put'
+ })
+ },
+
+ //删除课程
+ removeById(id) {
+ return request({
+ url: `${api_name}/remove/${id}`,
+ method: 'delete'
+ })
+ },
+
}
diff --git a/src/views/vod/course/components/Publish.vue b/src/views/vod/course/components/Publish.vue
index e69de29bb2..c2b0fefbd8 100644
--- a/src/views/vod/course/components/Publish.vue
+++ b/src/views/vod/course/components/Publish.vue
@@ -0,0 +1,108 @@
+
+
+
+
+
![]()
+
+
{{ coursePublish.title }}
+
共{{ coursePublish.lessonNum }}课时
+
所属分类:{{ coursePublish.subjectParentTitle }} — {{ coursePublish.subjectTitle }}
+
课程讲师:{{ coursePublish.teacherName }}
+
¥{{ coursePublish.price }}
+
+
+
+ 上一步
+ 发布课程
+
+
+
+
+
+
diff --git a/src/views/vod/course/list.vue b/src/views/vod/course/list.vue
index 02a669136f..765e3676d3 100644
--- a/src/views/vod/course/list.vue
+++ b/src/views/vod/course/list.vue
@@ -224,6 +224,25 @@ export default {
this.searchObj = {}
this.subjectLevelTwoList = [] // 二级分类列表
this.fetchData()
+ },
+
+
+ // 根据id删除数据
+ removeById(id) {
+ this.$confirm('此操作将永久删除该课程,以及该课程下的章节和视频,是否继续?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ return courseApi.removeById(id)
+ }).then(response => {
+ this.fetchData()
+ this.$message.success(response.message)
+ }).catch((response) => { // 失败
+ if (response === 'cancel') {
+ this.$message.info('取消删除')
+ }
+ })
}
}
}
From cbe701c6cd108e8de6d68dfe66a3840b058ecef0 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Wed, 23 Nov 2022 10:05:15 +0800
Subject: [PATCH 12/17] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 1 +
src/api/vod/videoVisitor.js | 13 +++++
src/views/vod/course/chart.vue | 99 ++++++++++++++++++++++++++++++++++
3 files changed, 113 insertions(+)
create mode 100644 src/api/vod/videoVisitor.js
diff --git a/package.json b/package.json
index 24138249e2..c3b69b7fa6 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"dependencies": {
"axios": "0.18.1",
"core-js": "3.6.5",
+ "echarts": "^4.1.0",
"element-ui": "2.13.2",
"js-cookie": "2.2.0",
"normalize.css": "7.0.0",
diff --git a/src/api/vod/videoVisitor.js b/src/api/vod/videoVisitor.js
new file mode 100644
index 0000000000..180835975c
--- /dev/null
+++ b/src/api/vod/videoVisitor.js
@@ -0,0 +1,13 @@
+import request from '@/utils/request'
+
+const api_name = '/admin/vod/videoVisitor'
+
+export default {
+
+ findCount(courseId, startDate, endDate) {
+ return request({
+ url: `${api_name}/findCount/${courseId}/${startDate}/${endDate}`,
+ method: 'get'
+ })
+ }
+}
diff --git a/src/views/vod/course/chart.vue b/src/views/vod/course/chart.vue
index e69de29bb2..5487e0229a 100644
--- a/src/views/vod/course/chart.vue
+++ b/src/views/vod/course/chart.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
From 4eb9e9e4e8b037dda5f9c0c3c52aff03081fccdf Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Wed, 23 Nov 2022 20:31:03 +0800
Subject: [PATCH 13/17] =?UTF-8?q?79-80=E8=A7=86=E9=A2=91=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E6=88=90=E5=8A=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/vod/vod.js | 11 ++++++++
.../vod/course/components/Video/Form.vue | 26 ++++++-------------
2 files changed, 19 insertions(+), 18 deletions(-)
create mode 100644 src/api/vod/vod.js
diff --git a/src/api/vod/vod.js b/src/api/vod/vod.js
new file mode 100644
index 0000000000..b429b85e20
--- /dev/null
+++ b/src/api/vod/vod.js
@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+export default {
+ //删除视频
+ removeByVodId(id) {
+ return request({
+ url: `/admin/vod/remove/${id}`,
+ method: 'delete'
+ })
+ }
+}
diff --git a/src/views/vod/course/components/Video/Form.vue b/src/views/vod/course/components/Video/Form.vue
index deac2960c5..73436dd1a4 100644
--- a/src/views/vod/course/components/Video/Form.vue
+++ b/src/views/vod/course/components/Video/Form.vue
@@ -14,7 +14,6 @@
默认
-
-
From 3672619e18b1861f80648163e2d983513262bae2 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Sun, 27 Nov 2022 15:42:40 +0800
Subject: [PATCH 15/17] =?UTF-8?q?=E8=B7=A8=E5=9F=9F=E7=AB=AF=E5=8F=A3?=
=?UTF-8?q?=E6=9B=B4=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.env.development b/.env.development
index 5616f1ca14..d2124efd92 100644
--- a/.env.development
+++ b/.env.development
@@ -3,4 +3,4 @@ ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
-VUE_APP_BASE_API = 'HTTP://LOCALHOST:8301'
+VUE_APP_BASE_API = 'HTTP://LOCALHOST:8333'
From 639292b81019f282cabe941bcfcf47c107c16ab9 Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Sun, 27 Nov 2022 17:15:26 +0800
Subject: [PATCH 16/17] =?UTF-8?q?93-=E4=BC=98=E6=83=A0=E5=88=B8=E5=AE=9E?=
=?UTF-8?q?=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/activity/couponInfo.js | 56 ++++++++
src/router/index.js | 38 ++++++
src/views/activity/couponInfo/form.vue | 162 +++++++++++++++++++++++
src/views/activity/couponInfo/list.vue | 164 +++++++++++++++++++++++
src/views/activity/couponInfo/show.vue | 173 +++++++++++++++++++++++++
5 files changed, 593 insertions(+)
create mode 100644 src/api/activity/couponInfo.js
create mode 100644 src/views/activity/couponInfo/form.vue
create mode 100644 src/views/activity/couponInfo/list.vue
create mode 100644 src/views/activity/couponInfo/show.vue
diff --git a/src/api/activity/couponInfo.js b/src/api/activity/couponInfo.js
new file mode 100644
index 0000000000..4dc601af26
--- /dev/null
+++ b/src/api/activity/couponInfo.js
@@ -0,0 +1,56 @@
+import request from '@/utils/request'
+
+const api_name = '/admin/activity/couponInfo'
+
+export default {
+
+ getPageList(page, limit) {
+ return request({
+ url: `${api_name}/${page}/${limit}`,
+ method: 'get'
+ })
+ },
+ getById(id) {
+ return request({
+ url: `${api_name}/get/${id}`,
+ method: 'get'
+ })
+ },
+
+ save(role) {
+ return request({
+ url: `${api_name}/save`,
+ method: 'post',
+ data: role
+ })
+ },
+
+ updateById(role) {
+ return request({
+ url: `${api_name}/update`,
+ method: 'put',
+ data: role
+ })
+ },
+ removeById(id) {
+ return request({
+ url: `${api_name}/remove/${id}`,
+ method: 'delete'
+ })
+ },
+ removeRows(idList) {
+ return request({
+ url: `${api_name}/batchRemove`,
+ method: 'delete',
+ data: idList
+ })
+ },
+
+ getPageCouponUseList(page, limit, searchObj) {
+ return request({
+ url: `${api_name}/couponUse/${page}/${limit}`,
+ method: 'get',
+ params: searchObj
+ })
+ }
+}
diff --git a/src/router/index.js b/src/router/index.js
index e1d1e59342..f0c6af8ba8 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -172,6 +172,44 @@ export const constantRoutes = [
]
},
+ {
+ path: '/activity',
+ component: Layout,
+ redirect: '/couponInfo/list',
+ name: 'Activity',
+ meta: { title: '营销活动管理', icon: 'el-icon-football' },
+ alwaysShow: true,
+ children: [
+ {
+ path: 'couponInfo/list',
+ name: 'CouponInfo',
+ component: () => import('@/views/activity/couponInfo/list'),
+ meta: { title: '优惠券列表' }
+ },
+ {
+ path: 'couponInfo/add',
+ name: 'CouponInfoAdd',
+ component: () => import('@/views/activity/couponInfo/form'),
+ meta: { title: '添加' },
+ hidden: true
+ },
+ {
+ path: 'couponInfo/edit/:id',
+ name: 'CouponInfoEdit',
+ component: () => import('@/views/activity/couponInfo/form'),
+ meta: { title: '编辑', noCache: true },
+ hidden: true
+ },
+ {
+ path: 'couponInfo/show/:id',
+ name: 'CouponInfoShow',
+ component: () => import('@/views/activity/couponInfo/show'),
+ meta: { title: '详情', noCache: true },
+ hidden: true
+ }
+ ]
+ },
+
{
path: '/subject',
component: Layout,
diff --git a/src/views/activity/couponInfo/form.vue b/src/views/activity/couponInfo/form.vue
new file mode 100644
index 0000000000..6accc6bbef
--- /dev/null
+++ b/src/views/activity/couponInfo/form.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+ 注册卷
+ 推荐购买卷
+
+
+
+
+
+
+
+
+ 至
+
+
+
+
+
+
+
+
+
+ 保存
+ 返回
+
+
+
+
+
+
diff --git a/src/views/activity/couponInfo/list.vue b/src/views/activity/couponInfo/list.vue
new file mode 100644
index 0000000000..082b658a65
--- /dev/null
+++ b/src/views/activity/couponInfo/list.vue
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+ 数据列表
+ 添加
+
+
+
+
+
+
+
+ {{ (page - 1) * limit + scope.$index + 1 }}
+
+
+
+
+
+
+ {{ scope.row.couponType == 'REGISTER' ? '注册卷' : '推荐赠送卷' }}
+
+
+
+
+ {{ '现金卷:' + scope.row.amount + '元' }}
+
+
+
+ 所有商品
+
+
+
+
+
+
+
+ 修改
+
+ 删除
+
+ 详情
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/activity/couponInfo/show.vue b/src/views/activity/couponInfo/show.vue
new file mode 100644
index 0000000000..b4ee78fab0
--- /dev/null
+++ b/src/views/activity/couponInfo/show.vue
@@ -0,0 +1,173 @@
+
+
+
+
优惠券信息
+
+
+
+ 优惠券名称 |
+ {{ couponInfo.couponName }} |
+ 优惠券类型 |
+
+ {{ couponInfo.couponType == 'REGISTER' ? '注册卷' : '推荐赠送卷' }}
+ |
+
+
+ 发行数量 |
+ {{ couponInfo.publishCount }} |
+ 每人限领次数 |
+ {{ couponInfo.perLimit }} |
+
+
+ 领取数量 |
+ {{ couponInfo.receiveCount }} |
+ 使用数量 |
+ {{ couponInfo.useCount }} |
+
+
+ 领取时间 |
+ {{ couponInfo.startTime }}至{{ couponInfo.endTime }} |
+ 过期时间 |
+ {{ couponInfo.expireTime }} |
+
+
+ 规则描述 |
+ {{ couponInfo.ruleDesc }} |
+
+
+
+
+
+ 优惠券发放列表
+
+
+
+
+
+ {{ (page - 1) * limit + scope.$index + 1 }}
+
+
+
+
+
+
+ {{ scope.row.couponStatus == 'NOT_USED' ? '未使用' : '已使用' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 返回
+
+
+
+
+
+
+
+
From e6eb951f113ea9a08da59279e71a8acd8042da7a Mon Sep 17 00:00:00 2001
From: mingxin_liao <2664500322@qq.com>
Date: Sun, 27 Nov 2022 21:29:23 +0800
Subject: [PATCH 17/17] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E8=8F=9C?=
=?UTF-8?q?=E5=8D=95=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/wechat/menu.js | 64 ++++++++
src/router/index.js | 20 +++
src/views/wechat/menu/list.vue | 289 +++++++++++++++++++++++++++++++++
3 files changed, 373 insertions(+)
create mode 100644 src/api/wechat/menu.js
create mode 100644 src/views/wechat/menu/list.vue
diff --git a/src/api/wechat/menu.js b/src/api/wechat/menu.js
new file mode 100644
index 0000000000..7ec2eee251
--- /dev/null
+++ b/src/api/wechat/menu.js
@@ -0,0 +1,64 @@
+import request from '@/utils/request'
+
+const api_name = '/admin/wechat/menu'
+
+export default {
+
+ findMenuInfo() {
+ return request({
+ url: `${api_name}/findMenuInfo`,
+ method: `get`
+ })
+ },
+
+ findOneMenuInfo() {
+ return request({
+ url: `${api_name}/findOneMenuInfo`,
+ method: `get`
+ })
+ },
+
+ save(menu) {
+ return request({
+ url: `${api_name}/save`,
+ method: `post`,
+ data: menu
+ })
+ },
+
+ getById(id) {
+ return request({
+ url: `${api_name}/get/${id}`,
+ method: `get`
+ })
+ },
+
+ updateById(menu) {
+ return request({
+ url: `${api_name}/update`,
+ method: `put`,
+ data: menu
+ })
+ },
+
+ syncMenu() {
+ return request({
+ url: `${api_name}/syncMenu`,
+ method: `get`
+ })
+ },
+
+ removeById(id) {
+ return request({
+ url: `${api_name}/remove/${id}`,
+ method: 'delete'
+ })
+ },
+
+ removeMenu() {
+ return request({
+ url: `${api_name}/removeMenu`,
+ method: `delete`
+ })
+ }
+}
diff --git a/src/router/index.js b/src/router/index.js
index f0c6af8ba8..c8dca90c7c 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -210,6 +210,26 @@ export const constantRoutes = [
]
},
+ {
+ path: '/wechat',
+ component: Layout,
+ redirect: '/wechat/menu/list',
+ name: 'Wechat',
+ meta: {
+ title: '公众号菜单管理',
+ icon: 'el-icon-refrigerator'
+ },
+ alwaysShow: true,
+ children: [
+ {
+ path: 'menu/list',
+ name: 'Menu',
+ component: () => import('@/views/wechat/menu/list'),
+ meta: { title: '菜单列表' }
+ }
+ ]
+ },
+
{
path: '/subject',
component: Layout,
diff --git a/src/views/wechat/menu/list.vue b/src/views/wechat/menu/list.vue
new file mode 100644
index 0000000000..072885086d
--- /dev/null
+++ b/src/views/wechat/menu/list.vue
@@ -0,0 +1,289 @@
+
+
+
+
+
+
+ 数据列表
+ 删除菜单
+ 同步菜单
+ 添 加
+
+
+
+
+
+
+
+ {{ scope.row.type == 'view' ? '链接' : scope.row.type == 'click' ? '事件' : '' }}
+
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 链接
+ 事件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+