diff --git a/src/api/notice/notice.js b/src/api/notice/notice.js index 3fdf13c..c53d9ad 100644 --- a/src/api/notice/notice.js +++ b/src/api/notice/notice.js @@ -6,7 +6,8 @@ const noticeApi = { get: 'notice/get', page: 'notice/pageList', read: 'notice/read', - pagePerson: 'notice/pagePersonList' + pagePerson: 'notice/pagePersonList', + cancel: 'notice/cancel' } export function noticeAdd (params) { @@ -52,3 +53,10 @@ export function noticePagePerson (params) { params: params }) } +export function noticeCancel (params) { + return request({ + url: noticeApi.cancel, + method: 'post', + params: params + }) +} diff --git a/src/views/notice/NoticeDetail.vue b/src/views/notice/NoticeDetail.vue index 48a5033..86b7722 100644 --- a/src/views/notice/NoticeDetail.vue +++ b/src/views/notice/NoticeDetail.vue @@ -2,7 +2,7 @@
@@ -73,6 +73,7 @@ export default { queryParam: { noticeId: this.$route.query.id, isRead: 1 }, readCount: 0, unreadCount: 0, + noticeRange : 1, // 表头 columns1: [ { @@ -122,17 +123,16 @@ export default { const noticeId = this.$route.query.id this.getDetail(noticeId) const type = this.$route.query.type - console.log(type) // 查看类型是“我接收的” if (type == 2) { this.readNotice(noticeId) } + this.noticeRange = type }, methods: { // 返回 按钮 close () { - // this.$router.push({ path: '/notice/list', query: {} }) - this.$router.go(-1) + this.$router.push({ path: '/notice/list', query: {noticeRange: this.noticeRange} }) }, getDetail (id) { noticeGet({ id: id }).then(res => { @@ -140,11 +140,8 @@ export default { }) }, readNotice (id) { - console.log('-------------read') - console.log(id) noticeRead({ id: id }).then(res => { // - console.log(res) }) }, tabsCallback (key) { @@ -156,7 +153,7 @@ export default { this.queryParam.isRead = 0 this.$nextTick(()=>{ this.$refs.table2.refresh(true) - }) + }) } } } diff --git a/src/views/notice/NoticeForm.vue b/src/views/notice/NoticeForm.vue index d21019c..3a44f0d 100644 --- a/src/views/notice/NoticeForm.vue +++ b/src/views/notice/NoticeForm.vue @@ -176,7 +176,11 @@ export default { methods: { // 返回 按钮 goback() { - this.$router.push({ path: '/notice/list', query: {} }) + this.$router.push({ path: '/notice/list', + query: { + noticeRange: 1 // 只有noticeRange=1的才有新增/编辑页面权限 + } + }) }, edit(id) { noticeGet({ id: id }).then(res => { diff --git a/src/views/notice/NoticeList.vue b/src/views/notice/NoticeList.vue index 871d4dd..fabe8af 100644 --- a/src/views/notice/NoticeList.vue +++ b/src/views/notice/NoticeList.vue @@ -1,6 +1,57 @@