diff --git a/src/api/course/courseware.js b/src/api/course/courseware.js index 7e96e62..38fa122 100644 --- a/src/api/course/courseware.js +++ b/src/api/course/courseware.js @@ -1,15 +1,10 @@ import request from '@/utils/request' const coursewareApi = { - add: '/courseManagement/xmCourseCourseware/addOrUpdate', - get: '/courseManagement/xmCourseCourseware/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' - classList: '/courseManagement/coursewareClassify/listPage' + add: '/courseManagement/xmCourseCourseware/addOrUpdate', + get: '/courseManagement/xmCourseCourseware/details', + del: 'courseManagement/xmCourseCourseware/delete', + classList: '/courseManagement/coursewareClassify/listPage' } @@ -17,37 +12,37 @@ const coursewareApi = { //删除课件 export function deleteCourseware(params) { - return request({ - url: coursewareApi.del, - method: 'delete', - params: params - }) + return request({ + url: coursewareApi.del, + method: 'delete', + params: params + }) } // 课件新增 export function coursewareAdd(params) { - return request({ - url: coursewareApi.add, - method: 'post', - data: params - }) + return request({ + url: coursewareApi.add, + method: 'post', + data: params + }) } // 课件分类列表 export function coursewareClassList(params) { - return request({ - url: coursewareApi.classList, - method: 'get', - params: params - }) + return request({ + url: coursewareApi.classList, + method: 'get', + params: params + }) } // 课件详情 export function coursewareDeatil(params) { - return request({ - url: coursewareApi.get, - method: 'get', - params: params - }) + return request({ + url: coursewareApi.get, + method: 'get', + params: params + }) } \ No newline at end of file diff --git a/src/views/project/ProjectList.vue b/src/views/project/ProjectList.vue index 4e967af..5e3015a 100644 --- a/src/views/project/ProjectList.vue +++ b/src/views/project/ProjectList.vue @@ -12,19 +12,9 @@ 未发布 开始时间: - + 结束时间: - + 培训方式: 全部 @@ -39,28 +29,23 @@ - 新增项目 + 新增项目 - + {{ index + 1 }} @@ -79,6 +64,12 @@ export default { }, data() { return { + power: { + add: '', + del: '', + edit: '', + release: '', + }, // 查询参数 queryParam: { projectName: null, @@ -129,7 +120,7 @@ export default { { title: '操作', width: 200, - align: 'center', + align: 'right', scopedSlots: { customRender: 'action' }, }, ], @@ -147,7 +138,7 @@ export default { this.changeType() }, //生命周期 - 销毁完成 - destroyed() {}, + destroyed() { }, // 监控data中的数据变化 watch: { $route(to, from) { //to是前往的路由 from是去往的路由 同一个组件只会渲染一次 @@ -156,12 +147,17 @@ export default { }, }, methods: { - getDetail(record){ + //发布项目 + handledRelease(record){ + + }, + //编辑时获取详情 + getDetail(record) { this.$router.push({ path: '/project/detail', query: { id: record.id, //自主项目还是系统项目,控制路由跳转 - t:this.queryParam.type, + t: this.queryParam.type, projectId: record.id, //项目id projectPageNum: this.$refs.table.localPagination.current, //当前页 }, @@ -181,14 +177,23 @@ export default { //变更类型 changeType(path) { var arr = [] - if(path){ + if (path) { arr = path.split('/') - }else{ + } else { arr = this.$route.path.split('/') } - this.queryParam.type = arr[arr.length - 1] + let str = arr[arr.length - 1] + this.queryParam.type = str + //权限 + str === 'sys' ? this.power.add = 'project:sys:add' : this.power.add = 'project:add' + str === 'sys' ? this.power.del = 'project:sys:del' : this.power.del = 'project:del' + str === 'sys' ? this.power.edit = 'project:sys:edit' : this.power.edit = 'project:edit' + str === 'sys' ? this.power.release = 'project:sys:release' : this.power.release = 'project:release' }, }, } + + + diff --git a/src/views/project/form/ProjectCourseList.vue b/src/views/project/form/ProjectCourseList.vue index 6a5744f..476dd32 100644 --- a/src/views/project/form/ProjectCourseList.vue +++ b/src/views/project/form/ProjectCourseList.vue @@ -1,11 +1,5 @@