From 5a6d6b18f0c60307c82feeb758a170d915468c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com> Date: Wed, 9 Jun 2021 17:12:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=AE=A1=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E7=AE=A1=E7=90=86=EF=BC=8C=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E8=80=81=E5=B8=88=EF=BC=8C=E6=8E=88=E8=AF=BE=E8=80=81=E5=B8=88?= =?UTF-8?q?....?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/CourseCategory.js | 27 ++ src/api/CourseMaster.js | 27 ++ src/api/CourseSMaster.js | 35 +++ src/components/Crud/CRUD.operation.vue | 2 +- src/components/Crud/UD.operation.vue | 2 +- src/components/Crud/crud.js | 9 +- src/utils/index.js | 1 + src/views/course/add.vue | 3 - src/views/course/category.vue | 199 ++++++++++++++ src/views/course/index.vue | 140 ++++++++-- src/views/shop/cate/index.vue | 8 +- src/views/shop/user/index.vue | 28 +- src/views/shop/user/master.vue | 173 ++++++++++++ src/views/shop/user/sMaster.vue | 273 +++++++++++++++++++ src/views/system/menu/index.vue | 351 ++++++++++++++++++++----- src/views/wechat/article/form.vue | 19 ++ src/views/wechat/article/index.vue | 1 + vue.config.js | 1 + 18 files changed, 1180 insertions(+), 119 deletions(-) create mode 100644 src/api/CourseCategory.js create mode 100644 src/api/CourseMaster.js create mode 100644 src/api/CourseSMaster.js delete mode 100644 src/views/course/add.vue create mode 100644 src/views/course/category.vue create mode 100644 src/views/shop/user/master.vue create mode 100644 src/views/shop/user/sMaster.vue diff --git a/src/api/CourseCategory.js b/src/api/CourseCategory.js new file mode 100644 index 0000000..d776f1c --- /dev/null +++ b/src/api/CourseCategory.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/CourseCategory', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/CourseCategory/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/CourseCategory', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/src/api/CourseMaster.js b/src/api/CourseMaster.js new file mode 100644 index 0000000..ac4d942 --- /dev/null +++ b/src/api/CourseMaster.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/CourseMaster', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/CourseMaster/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/CourseMaster', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/src/api/CourseSMaster.js b/src/api/CourseSMaster.js new file mode 100644 index 0000000..434e95a --- /dev/null +++ b/src/api/CourseSMaster.js @@ -0,0 +1,35 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/CourseMaster', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/CourseMaster/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/CourseMaster', + method: 'put', + data + }) +} + +export function moveMembers(data) { + return request({ + url: 'api/member/moveMembers', + method: 'POST', + data + }) +} + +export default { add, edit, del, moveMembers } diff --git a/src/components/Crud/CRUD.operation.vue b/src/components/Crud/CRUD.operation.vue index de052b7..04fe5f5 100644 --- a/src/components/Crud/CRUD.operation.vue +++ b/src/components/Crud/CRUD.operation.vue @@ -99,7 +99,7 @@ - + + + diff --git a/src/views/course/index.vue b/src/views/course/index.vue index dfb9359..0b6fa2e 100644 --- a/src/views/course/index.vue +++ b/src/views/course/index.vue @@ -4,11 +4,20 @@
+ + + + - + - + + :placeholder="'请输入第'+ item.day + '天的课程内容'" + v-model="item.courseContent"> - + @@ -99,8 +109,9 @@ 收费 - - + + @@ -158,6 +210,7 @@ import pagination from '@crud/Pagination' import picUpload from '@/components/pic-upload' import MaterialList from "@/components/material" import { initData } from '@/api/data' +import { parseTime } from '@/utils/index' // crud交由presenter持有 const defaultCrud = CRUD({ @@ -169,6 +222,7 @@ const defaultCrud = CRUD({ const defaultForm = { id: null, categoryId: null, + level:null, courseName: null, categoryName: null, courseIntroduce: null, @@ -189,7 +243,7 @@ const defaultForm = { updateUser: null, imageInput: '', imageArr: [], - courseList:[], + courseScheduleList:[], } export default { name: 'CyCourse', @@ -202,6 +256,7 @@ export default { permission: { add: ['admin', 'cyCourse:add'], edit: ['admin', 'cyCourse:edit'], + view: ['admin', 'cyCourse:view'], del: ['admin', 'cyCourse:del'] }, categoryList: [], @@ -231,7 +286,7 @@ export default { { required: true, message: '收费类型(0:免费;1:收费)不能为空', trigger: 'blur' } ], courseCharge: [ - { required: true, message: '课程费用不能为空', trigger: 'blur' } + // { required: true, message: '课程费用不能为空', trigger: 'blur' } ] }, courseStart: { @@ -281,7 +336,10 @@ export default { return time.getTime() < beginDateVal - 0 } } - } + }, + detailDialog:false, + detail:{}, + signUpData:[], } }, @@ -297,10 +355,13 @@ export default { }, // 新增与编辑前做的操作 [CRUD.HOOK.afterToCU](crud, form) { }, + // toQuery(){ + // console.log(this.crud) + // }, getCategory(){ - initData('/api/cyCourseCategory',this.getQueryParams()).then((res)=>{ - console.log(res) - this.categoryList = res.content + initData('/api/CourseCategory',this.getQueryParams()).then((res)=>{ + // console.log(res) + this.categoryList = res.content }) }, getQueryParams: function() { @@ -311,29 +372,34 @@ export default { } }, courseTimeChange(){ - console.log(this.form.courseStartTime) - console.log(this.form.courseEndTime) - this.form.courseList = []; + // console.log(this.form.courseStartTime) + // console.log(this.form.courseEndTime) + this.form.courseScheduleList = []; if(this.form.courseStartTime && this.form.courseEndTime){ var day1 = new Date(this.form.courseStartTime) var day2 = new Date(this.form.courseEndTime) - var num = (day2 - day1) / (1000 * 60 * 60 * 24) - for(var i = 0; i < num; i++){ - this.form.courseList.push({id:i+1,desc:''}) + var num = (day2 - day1) / (1000 * 60 * 60 * 24) + 1 ; + for(let i = 0; i < num; i++){ + let date = parseTime(day1.getTime()+(24*60*60*1000*i)); + this.form.courseScheduleList.push({day:i+1,courseDate:date, courseContent:''}) } } - console.log(this.form.courseList) + // console.log(this.form.courseList) }, submit(){ this.form.imageArr = [this.form.imageInput] this.crud.submitCU() - } + }, + showDetail(row){ + this.detail = row; + console.log(this.detail) + this.detailDialog = true; + }, } } - diff --git a/src/views/shop/cate/index.vue b/src/views/shop/cate/index.vue index bc2028f..3bf1b8a 100644 --- a/src/views/shop/cate/index.vue +++ b/src/views/shop/cate/index.vue @@ -37,7 +37,13 @@
- + diff --git a/src/views/shop/user/index.vue b/src/views/shop/user/index.vue index f49707e..43f9526 100644 --- a/src/views/shop/user/index.vue +++ b/src/views/shop/user/index.vue @@ -39,8 +39,8 @@ - - +