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/api/notice/notice.js b/src/api/notice/notice.js new file mode 100644 index 0000000..3fdf13c --- /dev/null +++ b/src/api/notice/notice.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +const noticeApi = { + add: 'notice/addOrUpdate', + del: 'notice/del', + get: 'notice/get', + page: 'notice/pageList', + read: 'notice/read', + pagePerson: 'notice/pagePersonList' +} + +export function noticeAdd (params) { + return request({ + url: noticeApi.add, + method: 'post', + data: params + }) +} +export function noticeDel (params) { + return request({ + url: noticeApi.del, + method: 'post', + params: params + }) +} +export function noticeGet (params) { + return request({ + url: noticeApi.get, + method: 'get', + params: params + }) +} +export function noticePage (params) { + return request({ + url: noticeApi.page, + method: 'post', + params: {pageSize: params.pageSize, pageNum: params.pageNum}, + data: params + }) +} +export function noticeRead (params) { + return request({ + url: noticeApi.read, + method: 'get', + params: params + }) +} +export function noticePagePerson (params) { + return request({ + url: noticeApi.pagePerson, + method: 'post', + params: params + }) +} diff --git a/src/components/SearchCom/index.vue b/src/components/SearchCom/index.vue index 23ae735..962b758 100644 --- a/src/components/SearchCom/index.vue +++ b/src/components/SearchCom/index.vue @@ -73,5 +73,5 @@ export default { } - diff --git a/src/views/notice/NoticeDetail.vue b/src/views/notice/NoticeDetail.vue new file mode 100644 index 0000000..939c123 --- /dev/null +++ b/src/views/notice/NoticeDetail.vue @@ -0,0 +1,138 @@ + + + + + 返回 + + + + {{ model.title }} + + + {{ model.createOrgName }} + + + ({{ model.createTime | moment }}) + + + + + + + + + + + + + + + {{ record.readTime | moment('YYYY-MM-DD HH:mm:ss') }} + + + + + + + {{ record.readTime | moment('YYYY-MM-DD HH:mm:ss') }} + + + + + + + + + + + diff --git a/src/views/notice/NoticeForm.vue b/src/views/notice/NoticeForm.vue new file mode 100644 index 0000000..ef9f619 --- /dev/null +++ b/src/views/notice/NoticeForm.vue @@ -0,0 +1,216 @@ + + + + 保存 + 返回 + + + + + + + + + + + + + + + + + + + + + + + + + 是 + 否 + + + + + + + 是 + 否 + + + + + + + + + + + + + + + + + + + + + + + 新闻资讯 + 公告详情 + 通知 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/notice/NoticeList.vue b/src/views/notice/NoticeList.vue new file mode 100644 index 0000000..725296e --- /dev/null +++ b/src/views/notice/NoticeList.vue @@ -0,0 +1,198 @@ + + + + + + + + + + + + 查询 + {queryParam = {}, this.loadData()}">重置 + + + + + + + {{ record.type | typeFilter }} + + + {{ record.publishTime | moment('YYYY-MM-DD HH:mm:ss') }} + + + 查看 + + + + + + + + + + + + + 查询 + {queryParam = {}, this.loadData()}">重置 + + + + + + + 发布 + + + + + + {{ record.type | typeFilter }} + + + {{ record.publishTime | moment('YYYY-MM-DD HH:mm:ss') }} + + + + 编辑 + + 查看 + + handleDel(record)"> + 删除 + + + + + + + + + diff --git a/src/views/org/OrgTree.vue b/src/views/org/OrgTree.vue index f5d0f90..b17955d 100644 --- a/src/views/org/OrgTree.vue +++ b/src/views/org/OrgTree.vue @@ -104,7 +104,7 @@ export default { }) }, loadOrg () { - orgList().then(res => { + orgList({ orgType: 1 }).then(res => { if (!res.code === 200 || !res.data.length) { return } 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 }} - 修改 - + 发布 + 详情 - + + 修改 + handleDelete(record)"> - 删除 + 删除 @@ -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 @@ - 总课时:{{ form.totalCourseHours }}H , 总学时要求:{{ form.totalLearnHours }}H , 总题目数量:{{ form.totalTopicNumber }} @@ -111,7 +105,6 @@ export default { { title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + 'H' }, { title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + 'H' }, { title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' }, - // { title: '项目名称', dataIndex: 'projectName', key: 'projectName' }, { title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' } }, ], // 表头 loadData: (parameter) => { @@ -119,7 +112,6 @@ export default { /** 编辑进来的有项目id */ return getCourseList({id:this.$route.query.projectId}).then((res) => { this.selData = res.data; - this.calc(res.data) return res.data }) @@ -127,7 +119,6 @@ export default { /** 新建的没有项目id,传当前的所选的课程id */ return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => { this.selData = res.data; - // console.log('list页面----selData',this.selData) this.calc(res.data) return res.data }) diff --git a/src/views/project/form/ProjectCourseSelect.vue b/src/views/project/form/ProjectCourseSelect.vue index edf478d..460915d 100644 --- a/src/views/project/form/ProjectCourseSelect.vue +++ b/src/views/project/form/ProjectCourseSelect.vue @@ -1,24 +1,17 @@ - + - - + + + 系统课程 + + + 自主课程 + + + @@ -33,13 +26,7 @@ 查询 - + {{ index + 1 }} @@ -83,6 +70,8 @@ export default { visible: false, //是否显示弹框 modalTitle: '', + menuKey: ['sys'], //默认系统课程 + // 查询参数 queryParam: { name: '', classType: 0 }, replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' }, @@ -102,7 +91,7 @@ export default { loadData: (parameter) => { return listByClass(Object.assign(parameter, this.queryParam)).then((res) => { return res - }) + }) }, } }, @@ -116,6 +105,14 @@ export default { watch: {}, // 方法集合 methods: { + //菜单改变, + menuChack(){ + console.log('menuKey',this.menuKey) + let type = 0; + if(this.menuKey[0] === 'self') type = 1; + this.getCourseTreeData(type); + this.$refs.table.refresh(); + }, // 编辑打开页面初始化 edit(record) { console.log('课程选择打开了', record) @@ -188,6 +185,7 @@ export default { this.expandedKeys = expandedKeys this.autoExpandParent = false }, + //查询课程列表 queryCourseList() { console.log('this.treeDataOne-------', this.treeDataOne) @@ -195,9 +193,10 @@ export default { this.courseData = res.data }) }, + //获取课程分类数据,转换成树结构 - getCourseTreeData(key) { - coursewareClassList().then((res) => { + getCourseTreeData(type) { + coursewareClassList({type:type}).then((res) => { //list转🌲 const list2tree1 = (list, parentId) => { return list.filter((item) => { @@ -216,24 +215,24 @@ export default { }, // 生命周期 - 创建完成(可以访问当前this实例) created() { - this.getCourseTreeData() + this.getCourseTreeData(0) //进来首先获取系统课程 }, // 生命周期 - 挂载完成(可以访问DOM元素) - mounted() {}, + mounted() { }, // 生命周期 - 创建之前 - beforeCreate() {}, + beforeCreate() { }, // 生命周期 - 挂载之前 - beforeMount() {}, + beforeMount() { }, // 生命周期 - 更新之前 - beforeUpdate() {}, + beforeUpdate() { }, // 生命周期 - 更新之后 - updated() {}, + updated() { }, // 生命周期 - 销毁之前 - beforeDestroy() {}, + beforeDestroy() { }, // 生命周期 - 销毁完成 - destroyed() {}, + destroyed() { }, // 如果页面有keep-alive缓存功能,这个函数会触发 - activated() {}, + activated() { }, }