mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
add the function of fuzzy query item
This commit is contained in:
@@ -108,9 +108,11 @@ export default {
|
||||
title: '',
|
||||
type: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
endTime: '',
|
||||
userName: ''
|
||||
}
|
||||
})
|
||||
this.$emit('selectByCond')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
/>
|
||||
<el-table-column
|
||||
prop="sender.username"
|
||||
label="发布人"
|
||||
label="发布者"
|
||||
width="100"
|
||||
column-key="sender.username"
|
||||
:filters="filterSenderName"
|
||||
@@ -196,10 +196,6 @@ export default {
|
||||
state.multiDeleteSelection = val
|
||||
})
|
||||
},
|
||||
clearFilter() {
|
||||
this.$refs.tableRef.clearFilter(['senderName'])
|
||||
this.$emit('clearFilter')
|
||||
},
|
||||
formatterTitle(title) {
|
||||
if (title.length > 10) {
|
||||
return title.substring(0, 10) + ' ...'
|
||||
@@ -207,8 +203,19 @@ export default {
|
||||
return title
|
||||
}
|
||||
},
|
||||
filterTag(value, row) {
|
||||
return row.sender.username === value
|
||||
filterTag(value) {
|
||||
noticeStore.$patch((state) => {
|
||||
state.search.userName = value
|
||||
})
|
||||
noticeStore.selectAllNotice(
|
||||
this.currentPage,
|
||||
this.pageSize,
|
||||
this.search.title,
|
||||
this.search.type,
|
||||
this.search.startTime,
|
||||
this.search.endTime,
|
||||
this.search.userName
|
||||
)
|
||||
},
|
||||
formatDate(row, column) {
|
||||
// 获取单元格数据
|
||||
@@ -253,7 +260,8 @@ export default {
|
||||
this.search.title,
|
||||
this.search.type,
|
||||
this.search.startTime,
|
||||
this.search.endTime
|
||||
this.search.endTime,
|
||||
this.search.userName
|
||||
)
|
||||
},
|
||||
handleCurrentChange(currentPage) {
|
||||
@@ -267,12 +275,13 @@ export default {
|
||||
this.search.title,
|
||||
this.search.type,
|
||||
this.search.startTime,
|
||||
this.search.endTime
|
||||
this.search.endTime,
|
||||
this.search.userName
|
||||
)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
noticeStore.selectAllNotice(this.currentPage, this.pageSize, '', '', '', '')
|
||||
noticeStore.selectAllNotice(this.currentPage, this.pageSize, '', '', '', '', '')
|
||||
},
|
||||
updated() {
|
||||
this.$refs.tableRef.clearFilter(['sender.username'])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<notice-head @selectByCond="selectByCond"></notice-head>
|
||||
<notice-head @selectByCond="getLoading"></notice-head>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-button
|
||||
@@ -63,16 +63,6 @@ export default {
|
||||
SIZE_ICON_MD() {
|
||||
return SIZE_ICON_MD
|
||||
},
|
||||
selectByCond() {
|
||||
noticeStore.selectAllNotice(
|
||||
this.currentPage,
|
||||
this.pageSize,
|
||||
this.search.title,
|
||||
this.search.type,
|
||||
this.search.startTime,
|
||||
this.search.endTime
|
||||
)
|
||||
},
|
||||
handleDialogClose() {
|
||||
noticeStore.$patch((state) => {
|
||||
state.dialogEditVisible = false
|
||||
@@ -101,6 +91,7 @@ export default {
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
)
|
||||
} else if (response.data.code === 20034) {
|
||||
@@ -127,7 +118,8 @@ export default {
|
||||
this.search.title,
|
||||
this.search.type,
|
||||
this.search.startTime,
|
||||
this.search.endTime
|
||||
this.search.endTime,
|
||||
this.search.userName
|
||||
)
|
||||
},
|
||||
deleteBatchByIds() {
|
||||
@@ -154,6 +146,7 @@ export default {
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
)
|
||||
} else if (response.data.code === 20034) {
|
||||
|
||||
@@ -52,7 +52,8 @@ export const useNoticeStore = defineStore('notice', {
|
||||
title: '',
|
||||
type: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
endTime: '',
|
||||
userName: ''
|
||||
},
|
||||
selectData: [
|
||||
{
|
||||
@@ -126,7 +127,8 @@ export const useNoticeStore = defineStore('notice', {
|
||||
title: string,
|
||||
type: string,
|
||||
startTime: string,
|
||||
endTime: string
|
||||
endTime: string,
|
||||
userName: string
|
||||
) {
|
||||
void request
|
||||
.get('/notice/page', {
|
||||
@@ -135,15 +137,14 @@ export const useNoticeStore = defineStore('notice', {
|
||||
title,
|
||||
type,
|
||||
startTime,
|
||||
endTime
|
||||
endTime,
|
||||
userName
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.code === 20021) {
|
||||
this.selectData = response.data.data
|
||||
this.total = parseInt(response.data.msg)
|
||||
if (this.selectData.length !== 0) {
|
||||
this.loading = false
|
||||
}
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
ElMessage({
|
||||
@@ -191,7 +192,7 @@ export const useNoticeStore = defineStore('notice', {
|
||||
})
|
||||
}
|
||||
})
|
||||
await this.selectAllNotice(1, 5, '', '', '', '')
|
||||
await this.selectAllNotice(1, 5, '', '', '', '', '')
|
||||
},
|
||||
async handleUpdateNotice(updateNotice: IAddNoticeData) {
|
||||
await request.put('/notice', updateNotice).then((response) => {
|
||||
@@ -209,7 +210,7 @@ export const useNoticeStore = defineStore('notice', {
|
||||
})
|
||||
}
|
||||
})
|
||||
await this.selectAllNotice(1, 5, '', '', '', '')
|
||||
await this.selectAllNotice(1, 5, '', '', '', '', '')
|
||||
this.hackReset = false
|
||||
},
|
||||
async modifyNoticeIsRead(notice: INotice) {
|
||||
|
||||
Reference in New Issue
Block a user