1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 06:51:23 +08:00

nitice manage module test compeled

This commit is contained in:
cccccyb
2023-05-06 04:00:28 +08:00
parent 1ac3906964
commit c0f02506e3
3 changed files with 14 additions and 30 deletions

View File

@@ -6,12 +6,11 @@ import com.cfive.pinnacle.entity.common.ResponseCode;
import com.cfive.pinnacle.entity.common.ResponseResult;
import com.cfive.pinnacle.service.INoticeReceiveService;
import com.cfive.pinnacle.service.INoticeService;
import lombok.Data;
import com.cfive.pinnacle.utils.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -68,7 +67,7 @@ public class NoticeController {
//添加公告
@PostMapping
public ResponseResult addNotice(@RequestBody Notice notice) {
notice.setSenderId(1654151877520973826L);
notice.setSenderId(WebUtil.getLoginUser().getUser().getId());
boolean insertNotice = noticeService.save(notice);
Long noticeId = notice.getId();
boolean flag = false;

View File

@@ -1,13 +0,0 @@
<template>
<NoticeEdit />
</template>
<script lang="ts">
export default {
name: 'NoticeAdd',
data() {
return {}
},
methods: {}
}
</script>
<style scoped></style>

View File

@@ -38,10 +38,10 @@
</template>
<script lang="ts">
import axios from 'axios'
import { ElMessage, ElMessageBox } from 'element-plus'
import 'element-plus/theme-chalk/el-message.css'
import 'element-plus/theme-chalk/el-message-box.css'
import request from '@/services'
export default {
name: 'NoticeHome',
@@ -57,14 +57,12 @@ export default {
},
methods: {
selectByCond(search) {
axios
request
.get('http://localhost:8621/notice', {
params: {
title: search.title,
type: search.type,
startTime: search.startTime,
endTime: search.endTime
}
title: search.title,
type: search.type,
startTime: search.startTime,
endTime: search.endTime
})
.then((response) => {
if (response.data.code === 20021) {
@@ -82,7 +80,7 @@ export default {
})
},
selectAllNotice() {
axios.get('http://localhost:8621/notice').then((response) => {
request.get('http://localhost:8621/notice').then((response) => {
this.selectData = response.data.data
if (this.selectData) {
this.getLoading = false
@@ -96,7 +94,7 @@ export default {
type: 'warning'
})
.then(() => {
axios.delete('http://localhost:8621/notice/' + deleteID).then((response) => {
request.delete('http://localhost:8621/notice/' + deleteID).then((response) => {
if (response.data.code === 20024) {
this.dialogAddVisible = false
ElMessage({
@@ -115,17 +113,17 @@ export default {
.catch(() => {})
},
selectNoticeType() {
axios.get('http://localhost:8621/noticeType').then((response) => {
request.get('http://localhost:8621/noticeType').then((response) => {
this.noticeTypeList = response.data.data
})
},
selectDepartment() {
axios.get('http://localhost:8621/department').then((response) => {
request.get('http://localhost:8621/department').then((response) => {
this.departmentList = response.data.data
})
},
handleAddNotice(addFormData) {
axios.post('http://localhost:8621/notice', addFormData).then((response) => {
request.post('http://localhost:8621/notice', addFormData).then((response) => {
if (response.data.code === 20022) {
this.dialogAddVisible = false
ElMessage({
@@ -142,7 +140,7 @@ export default {
this.$router.go(0)
},
handleUpdateNotice(updateNotice) {
axios.put('http://localhost:8621/notice', updateNotice).then((response) => {
request.put('http://localhost:8621/notice', updateNotice).then((response) => {
if (response.data.code === 20023) {
this.dialogUpdateVisible = false
ElMessage({