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

add the function of addNoticeType

This commit is contained in:
cccccyb
2023-05-23 03:26:40 +08:00
parent f65e339d5c
commit 0b72c3bf0b
20 changed files with 339 additions and 137 deletions

View File

@@ -10,7 +10,7 @@ export default {
},
methods: {},
mounted() {
noticeStore.selectAllNoticeByUserId(1)
noticeStore.selectAllNoticeSelf(1)
noticeStore.$patch((state) => {
state.currentViewPage = 'AlRead'
})

View File

@@ -10,7 +10,7 @@ export default {
},
methods: {},
mounted() {
noticeStore.selectAllNoticeByUserId(-1)
noticeStore.selectAllNoticeSelf(-1)
noticeStore.$patch((state) => {
state.currentViewPage = 'All'
})

View File

@@ -23,7 +23,7 @@
<template #header>
<h2 style="color: red">发布公告</h2>
</template>
<commitForm />
<notice-commit-form />
</el-dialog>
<notice-manage-table
@handleDeleteById="handleDeleteById"
@@ -38,10 +38,11 @@ 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'
import { useNoticeStore } from '@/store/notice'
import { useNoticeStore, useNoticeTypeStore } from '@/store/notice'
import { mapState } from 'pinia'
import { SIZE_ICON_MD } from '@/constants/Common.constants'
const noticeStore = useNoticeStore()
const noticeTypeStore = useNoticeTypeStore()
export default {
name: 'NoticeHome',
@@ -124,7 +125,7 @@ export default {
}
},
mounted() {
noticeStore.selectEnableNoticeType()
noticeTypeStore.selectEnableNoticeType()
},
computed: {
...mapState(useNoticeStore, ['dialogAddVisible'])

View File

@@ -1,7 +1,7 @@
<template>
<el-container>
<el-header>
<el-button type="primary" :size="'large'"
<el-button type="primary" :size="'large'" @click="handleOpenAddDialog"
><el-icon :size="SIZE_ICON_MD()" style="color: white; margin-right: 3px">
<icon-pinnacle-add /> </el-icon
>添加类型</el-button
@@ -11,11 +11,29 @@
<icon-pinnacle-delete /> </el-icon
>批量删除</el-button
>
<el-button type="primary" :size="'large'"
<el-button type="primary" :size="'large'" @click="getLoadData"
><el-icon :size="SIZE_ICON_MD()" style="color: white; margin-right: 3px">
<icon-pinnacle-reset /> </el-icon
>刷新页面</el-button
>刷新数据</el-button
>
<!-- 添加公告类型对话框-->
<el-dialog
v-model="dialogAddTypeVisible"
center
:close-on-click-modal="false"
destroy-on-close
>
<template #header>
<h2 style="color: red">添加公告类型</h2>
</template>
<notice-type-commit-form />
<template #footer>
<span class="dialog-footer">
<el-button>取消</el-button>
<el-button type="primary" @click="submitForm"> 确定 </el-button>
</span>
</template>
</el-dialog>
</el-header>
<el-main>
<notice-type-table />
@@ -23,10 +41,17 @@
</el-container>
</template>
<script lang="ts">
import { SIZE_ICON_LG, SIZE_ICON_MD, SIZE_ICON_SM } from '@/constants/Common.constants'
import { SIZE_ICON_MD } from '@/constants/Common.constants'
import { useNoticeTypeStore } from '@/store/notice'
import { mapState } from 'pinia'
const noticeTypeStore = useNoticeTypeStore()
export default {
name: 'NoticeTypeManage',
computed: {
...mapState(useNoticeTypeStore, ['dialogAddTypeVisible', 'editFlag'])
},
data() {
return {}
},
@@ -34,11 +59,27 @@ export default {
SIZE_ICON_MD() {
return SIZE_ICON_MD
},
SIZE_ICON_LG() {
return SIZE_ICON_LG
getLoadData() {
noticeTypeStore.dataLoading = true
noticeTypeStore.selectNoticeType()
},
SIZE_ICON_SM() {
return SIZE_ICON_SM
handleOpenAddDialog() {
noticeTypeStore.dialogAddTypeVisible = true
},
submitForm() {
this.$refs.addTypeData.validate((valid) => {
if (valid) {
if (this.editFlag) {
// 编辑操作
// noticeTypeStore.handleUpdateNoticeType(this.addTypeData)
} else {
// 添加操作
// noticeTypeStore.handleAddNoticeType(this.addTypeData)
}
} else {
return false
}
})
}
},
mounted() {}

View File

@@ -15,8 +15,8 @@
</template>
<script lang="ts">
import { useNoticeStore } from '@/store/notice'
const noticeStore = useNoticeStore()
import { useNoticeTypeStore } from '@/store/notice'
const noticeTypeStore = useNoticeTypeStore()
export default {
name: 'NoticeView',
data() {
@@ -24,7 +24,7 @@ export default {
},
methods: {},
mounted() {
noticeStore.selectEnableNoticeType()
noticeTypeStore.selectEnableNoticeType()
}
}
</script>

View File

@@ -10,7 +10,7 @@ export default {
},
methods: {},
mounted() {
noticeStore.selectAllNoticeByUserId(0)
noticeStore.selectAllNoticeSelf(0)
noticeStore.$patch((state) => {
state.currentViewPage = 'ToRead'
})