1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 15:01: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.entity.common.ResponseResult;
import com.cfive.pinnacle.service.INoticeReceiveService; import com.cfive.pinnacle.service.INoticeReceiveService;
import com.cfive.pinnacle.service.INoticeService; 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.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@@ -68,7 +67,7 @@ public class NoticeController {
//添加公告 //添加公告
@PostMapping @PostMapping
public ResponseResult addNotice(@RequestBody Notice notice) { public ResponseResult addNotice(@RequestBody Notice notice) {
notice.setSenderId(1654151877520973826L); notice.setSenderId(WebUtil.getLoginUser().getUser().getId());
boolean insertNotice = noticeService.save(notice); boolean insertNotice = noticeService.save(notice);
Long noticeId = notice.getId(); Long noticeId = notice.getId();
boolean flag = false; 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> </template>
<script lang="ts"> <script lang="ts">
import axios from 'axios'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import 'element-plus/theme-chalk/el-message.css' import 'element-plus/theme-chalk/el-message.css'
import 'element-plus/theme-chalk/el-message-box.css' import 'element-plus/theme-chalk/el-message-box.css'
import request from '@/services'
export default { export default {
name: 'NoticeHome', name: 'NoticeHome',
@@ -57,14 +57,12 @@ export default {
}, },
methods: { methods: {
selectByCond(search) { selectByCond(search) {
axios request
.get('http://localhost:8621/notice', { .get('http://localhost:8621/notice', {
params: {
title: search.title, title: search.title,
type: search.type, type: search.type,
startTime: search.startTime, startTime: search.startTime,
endTime: search.endTime endTime: search.endTime
}
}) })
.then((response) => { .then((response) => {
if (response.data.code === 20021) { if (response.data.code === 20021) {
@@ -82,7 +80,7 @@ export default {
}) })
}, },
selectAllNotice() { selectAllNotice() {
axios.get('http://localhost:8621/notice').then((response) => { request.get('http://localhost:8621/notice').then((response) => {
this.selectData = response.data.data this.selectData = response.data.data
if (this.selectData) { if (this.selectData) {
this.getLoading = false this.getLoading = false
@@ -96,7 +94,7 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
axios.delete('http://localhost:8621/notice/' + deleteID).then((response) => { request.delete('http://localhost:8621/notice/' + deleteID).then((response) => {
if (response.data.code === 20024) { if (response.data.code === 20024) {
this.dialogAddVisible = false this.dialogAddVisible = false
ElMessage({ ElMessage({
@@ -115,17 +113,17 @@ export default {
.catch(() => {}) .catch(() => {})
}, },
selectNoticeType() { selectNoticeType() {
axios.get('http://localhost:8621/noticeType').then((response) => { request.get('http://localhost:8621/noticeType').then((response) => {
this.noticeTypeList = response.data.data this.noticeTypeList = response.data.data
}) })
}, },
selectDepartment() { selectDepartment() {
axios.get('http://localhost:8621/department').then((response) => { request.get('http://localhost:8621/department').then((response) => {
this.departmentList = response.data.data this.departmentList = response.data.data
}) })
}, },
handleAddNotice(addFormData) { 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) { if (response.data.code === 20022) {
this.dialogAddVisible = false this.dialogAddVisible = false
ElMessage({ ElMessage({
@@ -142,7 +140,7 @@ export default {
this.$router.go(0) this.$router.go(0)
}, },
handleUpdateNotice(updateNotice) { 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) { if (response.data.code === 20023) {
this.dialogUpdateVisible = false this.dialogUpdateVisible = false
ElMessage({ ElMessage({