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

add pinia to manage data

This commit is contained in:
cccccyb
2023-05-12 02:39:56 +08:00
parent aed3c40196
commit 7e75600154
8 changed files with 205 additions and 118 deletions

View File

@@ -22,11 +22,9 @@
></commitForm>
</el-dialog>
<notice-manage-table
:selectData="selectData"
:noticeTypeList="noticeTypeList"
:departmentList="departmentList"
:dialogUpdateVisible="dialogUpdateVisible"
:loading="loading"
@handleDelete="handleDelete"
@clearFilter="clearFilter"
@handleUpdateNotice="handleUpdateNotice"
@@ -45,12 +43,10 @@ export default {
name: 'NoticeHome',
data() {
return {
selectData: [],
noticeTypeList: [],
dialogAddVisible: false,
dialogUpdateVisible: false,
departmentList: [],
loading: true
departmentList: []
}
},
methods: {
@@ -64,7 +60,7 @@ export default {
})
.then((response) => {
if (response.data.code === 20021) {
this.selectData = response.data.data
// this.selectData = response.data.data
ElMessage({
message: '查询成功.',
type: 'success'
@@ -77,14 +73,6 @@ export default {
}
})
},
selectAllNotice() {
request.get('http://localhost:8621/notice').then((response) => {
this.selectData = response.data.data
if (this.selectData) {
this.loading = false
}
})
},
handleDelete(deleteID) {
ElMessageBox.confirm('确定是否要删除?该操作将无法回退', '警告', {
confirmButtonText: '确定',
@@ -165,9 +153,7 @@ export default {
this.$router.go(0)
}
},
mounted() {
this.selectAllNotice()
}
mounted() {}
}
</script>

View File

@@ -14,43 +14,36 @@
<el-menu-item index="2">已读</el-menu-item>
<el-menu-item index="3"><a href="#">未读</a></el-menu-item>
</el-menu>
<notice-view-table
:selectData="selectData"
:getLoading="getLoading"
></notice-view-table>
<notice-view-table></notice-view-table>
</el-main>
</el-container>
</template>
<script lang="ts">
import request from '@/services'
import { useNoticeViewStore } from '@/store/notice-view'
const noticeViewStore = useNoticeViewStore()
export default {
name: 'NoticeView',
data() {
return {
activeIndex: '1',
selectData: [],
getLoading: true
activeIndex: '1'
}
},
methods: {
handleSelect(key, keyPath) {
console.log(key, keyPath)
},
selectAllNoticeByUserId() {
request.get('http://localhost:8621/notice/ByUserId').then((response) => {
this.selectData = response.data.data
if (this.selectData) {
this.getLoading = false
}
})
}
},
mounted() {
this.selectAllNoticeByUserId()
}
mounted() {}
}
</script>
<style scoped></style>
<style scoped>
.el-header {
background-color: #fff;
}
.el-main {
padding: 0;
margin-top: 20px;
}
</style>