diff --git a/.env.development b/.env.development index 5615b19..92b009e 100644 --- a/.env.development +++ b/.env.development @@ -2,7 +2,7 @@ ENV = 'development' VITE_CLI_PORT = 8088 VITE_SERVER_PORT = 8888 VITE_BASE_API = /api -VITE_BASE_PATH = http://192.168.1.165 +VITE_BASE_PATH = http://192.168.1.208 VITE_EDITOR = vscode // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP diff --git a/src/api/course.js b/src/api/course.js new file mode 100644 index 0000000..35d7654 --- /dev/null +++ b/src/api/course.js @@ -0,0 +1,41 @@ +import service from '@/utils/request' +const api = { + // 课程api + getCourseList : data => { + return service({ + url: '/sys-course', + method: 'get', + params:data + }) + }, + // 课程分类api + getSubjectList : data => { + return service({ + url: '/sys-course-category', + method: 'get', + params:data + }) + }, + addSubject : data => { + return service({ + url: '/sys-course-category', + method: 'post', + data + }) + }, + editSubject : data => { + return service({ + url: '/sys-course-category/'+data.id, + method: 'put', + data + }) + }, + delSubject : data => { + return service({ + url: '/sys-course-category', + method: 'delete', + data + }) + }, +} +export default api diff --git a/src/utils/custom.js b/src/utils/custom.js new file mode 100644 index 0000000..019e1d0 --- /dev/null +++ b/src/utils/custom.js @@ -0,0 +1,16 @@ +const custom = { + getStdSubject: (data) => { // 获取标准类型格式 + let arr= [] + for(let item of data) { + // item.label = item.name + if(item.children){ + arr.push(...custom.getStdSubject(item.children)) + } + else{ + arr.push(item) + } + } + return arr + } +} +export default custom diff --git a/src/view/course/courseCategory/index.vue b/src/view/course/courseCategory/index.vue new file mode 100644 index 0000000..42a0ce5 --- /dev/null +++ b/src/view/course/courseCategory/index.vue @@ -0,0 +1,282 @@ + + + diff --git a/src/view/course/index.vue b/src/view/course/index.vue new file mode 100644 index 0000000..d3398ea --- /dev/null +++ b/src/view/course/index.vue @@ -0,0 +1,171 @@ + + +