1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-06 07:21:24 +08:00

add the function of fuzzy query in the page of NoticeView had been completed

This commit is contained in:
cccccyb
2023-06-04 18:32:25 +08:00
parent 385127a314
commit 7031dd593b
15 changed files with 284 additions and 49 deletions

View File

@@ -14,7 +14,15 @@ export default {
state.showLoading = true
state.currentViewPage = 'AlRead'
})
noticeStore.selectAllNoticeSelf(1)
noticeStore.selectAllNoticeSelf(1, '', '', '', '')
noticeStore.$patch((state) => {
state.searchBySelf = {
title: '',
type: '',
startTime: '',
endTime: ''
}
})
}
}
</script>

View File

@@ -15,7 +15,15 @@ export default {
state.showLoading = true
state.currentViewPage = 'All'
})
noticeStore.selectAllNoticeSelf(-1)
noticeStore.selectAllNoticeSelf(-1, '', '', '', '')
noticeStore.$patch((state) => {
state.searchBySelf = {
title: '',
type: '',
startTime: '',
endTime: ''
}
})
},
computed: {
...mapState(useNoticeStore, ['showLoading'])

View File

@@ -1,7 +1,7 @@
<template>
<el-container>
<el-header>
<notice-head @selectByCond="getLoading"></notice-head>
<notice-manage-head @selectByCond="getLoading"></notice-manage-head>
</el-header>
<el-main>
<el-button
@@ -52,7 +52,11 @@ import 'element-plus/theme-chalk/el-message-box.css'
import request from '@/services'
import { useNoticeStore, useNoticeTypeStore } from '@/store/notice'
import { mapState } from 'pinia'
import { SIZE_ICON_MD } from '@/constants/Common.constants'
import {
DATABASE_DELETE_ERROR,
DATABASE_DELETE_OK,
SIZE_ICON_MD
} from '@/constants/Common.constants'
const noticeStore = useNoticeStore()
const noticeTypeStore = useNoticeTypeStore()
@@ -82,7 +86,7 @@ export default {
})
.then(() => {
request.delete('/notice/' + deleteID).then((response) => {
if (response.data.code === 20024) {
if (response.data.code === DATABASE_DELETE_OK) {
ElMessage({
message: '删除成功.',
type: 'success'
@@ -96,7 +100,7 @@ export default {
'',
[]
)
} else if (response.data.code === 20034) {
} else if (response.data.code === DATABASE_DELETE_ERROR) {
ElMessage({
message: response.data.msg,
type: 'error'
@@ -123,7 +127,6 @@ export default {
this.search.endTime,
this.search.userIdList
)
// noticeStore.search.userIdList = []
},
deleteBatchByIds() {
const multiDeleteIds = []
@@ -138,7 +141,7 @@ export default {
})
.then(() => {
request.post('/notice/batch', multiDeleteIds).then((response) => {
if (response.data.code === 20024) {
if (response.data.code === DATABASE_DELETE_OK) {
ElMessage({
message: '删除成功.',
type: 'success'
@@ -152,7 +155,7 @@ export default {
'',
[]
)
} else if (response.data.code === 20034) {
} else if (response.data.code === DATABASE_DELETE_ERROR) {
ElMessage({
message: response.data.msg,
type: 'error'

View File

@@ -45,7 +45,11 @@
</el-container>
</template>
<script lang="ts">
import { SIZE_ICON_MD } from '@/constants/Common.constants'
import {
DATABASE_DELETE_ERROR,
DATABASE_DELETE_OK,
SIZE_ICON_MD
} from '@/constants/Common.constants'
import { useNoticeTypeStore } from '@/store/notice'
import { mapState } from 'pinia'
import { ElMessage, ElMessageBox } from 'element-plus'
@@ -113,13 +117,13 @@ export default {
})
.then(() => {
request.delete('/notice_type/' + typeId).then((response) => {
if (response.data.code === 20024) {
if (response.data.code === DATABASE_DELETE_OK) {
ElMessage({
message: '删除成功.',
type: 'success'
})
noticeTypeStore.selectNoticeType(this.currentPage, this.pageSize)
} else if (response.data.code === 20034) {
} else if (response.data.code === DATABASE_DELETE_ERROR) {
ElMessage({
message: response.data.msg,
type: 'error'
@@ -142,13 +146,13 @@ export default {
})
.then(() => {
request.post('/notice_type/batch', multiDeleteTypeIds).then((response) => {
if (response.data.code === 20024) {
if (response.data.code === DATABASE_DELETE_OK) {
ElMessage({
message: '删除成功.',
type: 'success'
})
noticeTypeStore.selectNoticeType(this.currentPage, this.pageSize)
} else if (response.data.code === 20034) {
} else if (response.data.code === DATABASE_DELETE_ERROR) {
ElMessage({
message: response.data.msg,
type: 'error'

View File

@@ -1,7 +1,7 @@
<template>
<el-container>
<el-header>
<notice-head></notice-head>
<notice-view-head @selectSelfByCond="getLoading" />
</el-header>
<el-main>
<el-menu :default-active="$route.path" class="el-menu-demo" mode="horizontal" router>
@@ -15,14 +15,31 @@
</template>
<script lang="ts">
import { useNoticeTypeStore } from '@/store/notice'
import { useNoticeTypeStore, useNoticeStore } from '@/store/notice'
import { mapState } from 'pinia'
const noticeTypeStore = useNoticeTypeStore()
const noticeStore = useNoticeStore()
export default {
name: 'NoticeView',
computed: {
...mapState(useNoticeStore, ['showLoading', 'searchBySelf'])
},
data() {
return {}
},
methods: {},
methods: {
getLoading(status) {
noticeStore.showLoading = true
noticeStore.selectAllNoticeSelf(
status,
this.searchBySelf.title,
this.searchBySelf.type,
this.searchBySelf.startTime,
this.searchBySelf.endTime
)
}
},
mounted() {
noticeTypeStore.selectEnableNoticeType()
}

View File

@@ -14,7 +14,15 @@ export default {
state.showLoading = true
state.currentViewPage = 'ToRead'
})
noticeStore.selectAllNoticeSelf(0)
noticeStore.selectAllNoticeSelf(0, '', '', '', '')
noticeStore.$patch((state) => {
state.searchBySelf = {
title: '',
type: '',
startTime: '',
endTime: ''
}
})
}
}
</script>