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 @@
- - - - - + + + + + + +
@@ -32,7 +34,7 @@ export default { }, data() { return { - title:'', + title: '', currentTab: 0, labelCol: { xs: { span: 24 }, @@ -67,6 +69,7 @@ export default { // handler //下一步 nextStep() { + console.log('1111', this) if (this.currentTab < 5) { this.currentTab += 1 } diff --git a/src/views/project/form/ProjectCourseSelect.vue b/src/views/project/form/ProjectCourseSelect.vue index 5688663..c6fed8b 100644 --- a/src/views/project/form/ProjectCourseSelect.vue +++ b/src/views/project/form/ProjectCourseSelect.vue @@ -11,53 +11,56 @@ > - - 系统课程 - 自制课程 + + 系统课程 + 自制课程 - - -

col-4

+
+

dsfdsfdsfdsfds

+
\ No newline at end of file diff --git a/src/views/project/form/ProjectForm.vue b/src/views/project/form/ProjectForm.vue index 26b550f..3498433 100644 --- a/src/views/project/form/ProjectForm.vue +++ b/src/views/project/form/ProjectForm.vue @@ -140,6 +140,7 @@ export default { ClassList, }, created(ClassList) { + console.log('第一个表单创建了'); this.fetchTemplateData() }, methods: { @@ -185,5 +186,8 @@ export default { this.form.resitNumber = Math.floor(Math.random() * (5 - 1) + 1) }, }, + destroyed() { + console.log('第一个表单销毁了') + } } diff --git a/src/views/project/form/ProjectUnitSelect.vue b/src/views/project/form/ProjectUnitSelect.vue index 3f4e8e0..03a13df 100644 --- a/src/views/project/form/ProjectUnitSelect.vue +++ b/src/views/project/form/ProjectUnitSelect.vue @@ -122,6 +122,9 @@ export default { }, } }, + created(){ + console.log('第2个表单创建了') + }, computed: { treeData() { return handleTreeData(treeData, this.targetKeys) @@ -142,7 +145,7 @@ export default { }, toPrep() { console.log('toPrep', this.form) - this.$emit('prevStep',this.form) + this.$emit('prevStep', this.form) }, onChange(targetKeys) { console.log('Target Keys:', targetKeys) @@ -172,5 +175,8 @@ export default { } }, }, + destroyed() { + console.log('第2个表单销毁了') + }, } \ No newline at end of file