style:通知
Showing
3 changed files
with
28 additions
and
6 deletions
| ... | @@ -49,6 +49,14 @@ export default { | ... | @@ -49,6 +49,14 @@ export default { |
| 49 | created () { | 49 | created () { |
| 50 | this.queryNoticeList() | 50 | this.queryNoticeList() |
| 51 | }, | 51 | }, |
| 52 | mounted () { | ||
| 53 | let that = this | ||
| 54 | window.addEventListener('message', function (messageEvent) { | ||
| 55 | if (messageEvent.data.update) { | ||
| 56 | that.queryNoticeList() | ||
| 57 | } | ||
| 58 | }, false) | ||
| 59 | }, | ||
| 52 | methods: { | 60 | methods: { |
| 53 | queryNoticeList () { | 61 | queryNoticeList () { |
| 54 | getHomeNoticeList().then(res => { | 62 | getHomeNoticeList().then(res => { | ... | ... |
| ... | @@ -129,6 +129,7 @@ export default { | ... | @@ -129,6 +129,7 @@ export default { |
| 129 | publishNotice({ "bsmNotice": item.bsmNotice }).then(res => { | 129 | publishNotice({ "bsmNotice": item.bsmNotice }).then(res => { |
| 130 | if (res.code == 200) { | 130 | if (res.code == 200) { |
| 131 | this.$message.success('发布成功') | 131 | this.$message.success('发布成功') |
| 132 | this.postMessage() | ||
| 132 | this.queryClick(); | 133 | this.queryClick(); |
| 133 | } else { | 134 | } else { |
| 134 | this.$message.error(res.message) | 135 | this.$message.error(res.message) |
| ... | @@ -141,6 +142,9 @@ export default { | ... | @@ -141,6 +142,9 @@ export default { |
| 141 | }); | 142 | }); |
| 142 | }); | 143 | }); |
| 143 | }, | 144 | }, |
| 145 | postMessage () { | ||
| 146 | window.parent.postMessage({ update: true }, '*') | ||
| 147 | }, | ||
| 144 | //取消发布 | 148 | //取消发布 |
| 145 | toUnPublish (item) { | 149 | toUnPublish (item) { |
| 146 | this.$confirm('是否确定取消发布', '提示', { | 150 | this.$confirm('是否确定取消发布', '提示', { | ... | ... |
| ... | @@ -7,13 +7,23 @@ export default { | ... | @@ -7,13 +7,23 @@ export default { |
| 7 | } | 7 | } |
| 8 | }, | 8 | }, |
| 9 | created () { | 9 | created () { |
| 10 | getHomeNoticeList().then(res => { | 10 | this.getHomeNotice() |
| 11 | if (res.result) { | 11 | }, |
| 12 | this.noticeList = res.result.noticeList | 12 | mounted () { |
| 13 | window.addEventListener('message', function (messageEvent) { | ||
| 14 | if (messageEvent.data.update) { | ||
| 15 | this.getHomeNotice() | ||
| 13 | } | 16 | } |
| 14 | }) | 17 | }, false) |
| 15 | }, | 18 | }, |
| 16 | methods: { | 19 | methods: { |
| 20 | getHomeNotice () { | ||
| 21 | getHomeNoticeList().then(res => { | ||
| 22 | if (res.result) { | ||
| 23 | this.noticeList = res.result.noticeList | ||
| 24 | } | ||
| 25 | }) | ||
| 26 | }, | ||
| 17 | //右侧表单选项卡事件 | 27 | //右侧表单选项卡事件 |
| 18 | beforeLeave (activeName, oldActiveName) { | 28 | beforeLeave (activeName, oldActiveName) { |
| 19 | if (activeName && activeName != 0) this.getFromRouter(activeName) | 29 | if (activeName && activeName != 0) this.getFromRouter(activeName) |
| ... | @@ -21,8 +31,8 @@ export default { | ... | @@ -21,8 +31,8 @@ export default { |
| 21 | //切换选项卡内容组件 | 31 | //切换选项卡内容组件 |
| 22 | getFromRouter (tabname) { | 32 | getFromRouter (tabname) { |
| 23 | //根据tabname获取选中的表单 此操作为了获取后端返回的表单对象,使用里面的是否可操作的属性 | 33 | //根据tabname获取选中的表单 此操作为了获取后端返回的表单对象,使用里面的是否可操作的属性 |
| 24 | for(let item of this.tabList){ | 34 | for (let item of this.tabList) { |
| 25 | if(item.value === tabname){ | 35 | if (item.value === tabname) { |
| 26 | this.currentSelectTab = item | 36 | this.currentSelectTab = item |
| 27 | break; | 37 | break; |
| 28 | } | 38 | } | ... | ... |
-
Please register or sign in to post a comment