mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
modify the function of paging the noticeType
This commit is contained in:
@@ -13,6 +13,16 @@
|
||||
<icon-pinnacle-add /> </el-icon
|
||||
>发布公告</el-button
|
||||
>
|
||||
<el-button type="primary" :size="'large'" @click="deleteBatchByIds"
|
||||
><el-icon :size="SIZE_ICON_MD()" style="color: white; margin-right: 3px">
|
||||
<icon-pinnacle-delete /> </el-icon
|
||||
>批量删除</el-button
|
||||
>
|
||||
<el-button type="primary" :size="'large'" @click="getLoading"
|
||||
><el-icon :size="SIZE_ICON_MD()" style="color: white; margin-right: 3px">
|
||||
<icon-pinnacle-reset /> </el-icon
|
||||
>刷新数据</el-button
|
||||
>
|
||||
<!-- 添加公告对话框-->
|
||||
<el-dialog
|
||||
v-model="dialogAddVisible"
|
||||
@@ -27,7 +37,7 @@
|
||||
</el-dialog>
|
||||
<notice-manage-table
|
||||
@handleDeleteById="handleDeleteById"
|
||||
@clearFilter="clearFilter"
|
||||
ref="manageTable"
|
||||
></notice-manage-table>
|
||||
</el-main>
|
||||
</el-container>
|
||||
@@ -118,17 +128,51 @@ export default {
|
||||
state.editFlag = false
|
||||
})
|
||||
},
|
||||
clearFilter() {
|
||||
// this.selectAllNotice()
|
||||
// location.reload()
|
||||
this.$router.go(0)
|
||||
getLoading() {
|
||||
noticeStore.loading = true
|
||||
noticeStore.selectAllNotice(this.currentPage, this.pageSize)
|
||||
},
|
||||
deleteBatchByIds() {
|
||||
const multiDeleteIds = []
|
||||
if (this.multiDeleteSelection.length > 0) {
|
||||
for (let i = 0; i < this.multiDeleteSelection.length; i++) {
|
||||
multiDeleteIds.push(this.multiDeleteSelection[i].id)
|
||||
}
|
||||
ElMessageBox.confirm('确定是否要批量删除?该操作将无法回退', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '我再想想',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
request.post('/notice/batch', multiDeleteIds).then((response) => {
|
||||
if (response.data.code === 20024) {
|
||||
ElMessage({
|
||||
message: '删除成功.',
|
||||
type: 'success'
|
||||
})
|
||||
noticeStore.selectAllNotice(this.currentPage, this.pageSize)
|
||||
} else if (response.data.code === 20034) {
|
||||
ElMessage({
|
||||
message: response.data.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
noticeTypeStore.selectEnableNoticeType()
|
||||
},
|
||||
computed: {
|
||||
...mapState(useNoticeStore, ['dialogAddVisible'])
|
||||
...mapState(useNoticeStore, [
|
||||
'dialogAddVisible',
|
||||
'currentPage',
|
||||
'pageSize',
|
||||
'multiDeleteSelection'
|
||||
])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user