diff --git a/src/api/course/courseware.js b/src/api/course/courseware.js
index 9b07dec..66245dd 100644
--- a/src/api/course/courseware.js
+++ b/src/api/course/courseware.js
@@ -2,32 +2,42 @@ import request from '@/utils/request'
const coursewareApi = {
add: '/courseManagement/xmCourseCourseware/addOrUpdate',
-// get: '/courseManagement/course/details',
-// update: 'sys/menu/update',
+ // get: '/courseManagement/course/details',
+ // update: 'sys/menu/update',
del: 'courseManagement/xmCourseCourseware/delete',
-// updateStatus: 'sys/menu/updateStatus',
-// list: '/courseManagement/course/listPage',
-// coursewareList:'/courseManagement/course/courseware/details',
-// questionList:'/courseManagement/course/questionList'
-
+ // updateStatus: 'sys/menu/updateStatus',
+ // list: '/courseManagement/course/listPage',
+ // coursewareList:'/courseManagement/course/courseware/details',
+ // questionList:'/courseManagement/course/questionList'
+ classList: '/courseManagement/coursewareClassify/listPage'
+
}
//删除课件
-export function deleteCourseware (params) {
- return request({
- url: coursewareApi.del,
- method: 'delete',
- params: params
- })
- }
+export function deleteCourseware(params) {
+ return request({
+ url: coursewareApi.del,
+ method: 'delete',
+ params: params
+ })
+}
- // 课件新增
- export function coursewareAdd (params) {
- return request({
- url: coursewareApi.add,
- method: 'post',
- data: params
- })
- }
\ No newline at end of file
+// 课件新增
+export function coursewareAdd(params) {
+ return request({
+ url: coursewareApi.add,
+ method: 'post',
+ data: params
+ })
+}
+
+// 课件分类列表
+export function coursewareClassList(params) {
+ return request({
+ url: coursewareApi.classList,
+ method: 'get',
+ params: params
+ })
+}
\ No newline at end of file
diff --git a/src/utils/util.js b/src/utils/util.js
index b801bce..6ec26e0 100644
--- a/src/utils/util.js
+++ b/src/utils/util.js
@@ -1,10 +1,10 @@
-export function timeFix () {
+export function timeFix() {
const time = new Date()
const hour = time.getHours()
return hour < 9 ? '早上好' : hour <= 11 ? '上午好' : hour <= 13 ? '中午好' : hour < 20 ? '下午好' : '晚上好'
}
-export function welcome () {
+export function welcome() {
const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
const index = Math.floor(Math.random() * arr.length)
return arr[index]
@@ -13,18 +13,18 @@ export function welcome () {
/**
* 触发 window.resize
*/
-export function triggerWindowResizeEvent () {
+export function triggerWindowResizeEvent() {
const event = document.createEvent('HTMLEvents')
event.initEvent('resize', true, true)
event.eventType = 'message'
window.dispatchEvent(event)
}
-export function handleScrollHeader (callback) {
+export function handleScrollHeader(callback) {
let timer = 0
let beforeScrollTop = window.pageYOffset
- callback = callback || function () {}
+ callback = callback || function () { }
window.addEventListener(
'scroll',
event => {
@@ -45,7 +45,7 @@ export function handleScrollHeader (callback) {
)
}
-export function isIE () {
+export function isIE() {
const bw = window.navigator.userAgent
const compare = (s) => bw.indexOf(s) >= 0
const ie11 = (() => 'ActiveXObject' in window)()
@@ -57,7 +57,7 @@ export function isIE () {
* @param id parent element id or class
* @param timeout
*/
-export function removeLoadingAnimate (id = '', timeout = 1500) {
+export function removeLoadingAnimate(id = '', timeout = 1500) {
if (id === '') {
return
}
@@ -66,7 +66,7 @@ export function removeLoadingAnimate (id = '', timeout = 1500) {
}, timeout)
}
-export function listToTree (list, tree, parentId) {
+export function listToTree(list, tree, parentId) {
list.forEach(item => {
if (item.pid === parentId) {
const child = {
@@ -85,3 +85,19 @@ export function listToTree (list, tree, parentId) {
})
return tree
}
+
+//列表转🌲
+// export function list2Tree(list, parentId) {
+// let obj = []
+// list.forEach(item => {
+// item.children = []
+// obj[item.id] = item
+// })
+// return list.filter(item => {
+// if (item.parentId !== parentId) {
+// obj[item.parentId].children.push(item)
+// return false
+// }
+// return true
+// })
+// }
diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue
index 2627017..f702973 100644
--- a/src/views/project/ProjectStepForm.vue
+++ b/src/views/project/ProjectStepForm.vue
@@ -10,11 +10,13 @@
col-4
+dsfdsfdsfdsfds
+