feat: 完成通知公告功能

This commit is contained in:
陈淳
2024-02-21 15:45:47 +08:00
parent 1907acd35d
commit f77887e6a3
6 changed files with 165 additions and 10 deletions

View File

@@ -42,4 +42,19 @@ export function delNotice(ids) {
method: 'delete',
params:{id:ids}
})
}
// 发送在线公告
export function sendOnlineNotice(id) {
return request({
url: '/notice/online/'+id,
method: 'post',
})
}
// 发送离线公告
export function sendOfflineNotice(id) {
return request({
url: '/notice/offline/'+id,
method: 'post',
})
}

View File

@@ -180,7 +180,7 @@
</template>
<script setup name="Notice">
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import { sendOnlineNotice,sendOfflineNotice,listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
const { proxy } = getCurrentInstance();
const sys_notice_state=[
@@ -307,12 +307,14 @@ function handleDelete(row) {
}).catch(() => {});
}
const handleOnlineSend=(id)=>{
const handleOnlineSend=async (id)=>{
await sendOnlineNotice(id);
proxy.$modal.msgSuccess("在线消息发送成功");
}
const handleOfflineSend=(id)=>{
const handleOfflineSend=async (id)=>{
await sendOfflineNotice(id);
proxy.$modal.msgSuccess("离线消息发送成功");
}
getList();
</script>