Commit a65e8f6b by pangchong

feat: 我的待办修改

parent 71427ba4
import { http } from 'mocp/utils/http' import { http, post } from 'mocp/utils/http'
//布置工作 //布置工作
export const getArrangeWorkListForAppApi = (data, config) => { export const getArrangeWorkListForAppApi = (data, config) => {
return http({ return post({
method: 'POST', method: 'POST',
url: '/technical-support/getArrangeWorkListForApp', url: '/technical-support/getArrangeWorkListForApp',
data, data,
......
...@@ -341,6 +341,8 @@ const queryList = (pageIndex, pageSize) => { ...@@ -341,6 +341,8 @@ const queryList = (pageIndex, pageSize) => {
} else { } else {
if (ps.localData) { if (ps.localData) {
paging.value?.complete(ps.localData || []) paging.value?.complete(ps.localData || [])
} else {
paging.value?.complete(true)
} }
es('handleQuery', { pageIndex, pageSize }) es('handleQuery', { pageIndex, pageSize })
} }
......
...@@ -74,33 +74,32 @@ const useMyToDoStore = defineStore('myToDo', { ...@@ -74,33 +74,32 @@ const useMyToDoStore = defineStore('myToDo', {
const userStore = useUserStore() const userStore = useUserStore()
const res = await getArrangeWorkListForAppApi({ pageIndex: 1, pageSize: 10, userId: userStore.userInfo?.id }) const res = await getArrangeWorkListForAppApi({ pageIndex: 1, pageSize: 10, userId: userStore.userInfo?.id })
if (res.code == 200) { if (res.code == 200) {
this.assignWorkNum = res.total || 0 this.assignWorkNum = parseInt(res.data.total) || 0
} }
}, },
async getRqmListForMobile() { async getRqmListForMobile() {
const userStore = useUserStore() const userStore = useUserStore()
const res = await getRqmListForMobileApi({ pageIndex: 1, pageSize: 10, userId: userStore.userInfo?.id }) const res = await getRqmListForMobileApi({ pageIndex: 1, pageSize: 10, userId: userStore.userInfo?.id })
if (res.code == 200) { if (res.code == 200) {
this.appraisalRecordNum = res.total || 0 this.appraisalRecordNum = parseInt(res.total) || 0
} }
}, },
async getDecisiongetDecisionToDo() { async getDecisiongetDecisionToDo() {
const res = await getDecisiongetDecisionToDoApi({ pageIndex: 1, pageSize: 10 }) const res = await getDecisiongetDecisionToDoApi({ pageIndex: 1, pageSize: 10 })
if (res.code == 200) { if (res.code == 200) {
this.moveDecisionNum = res.total || 0 this.moveDecisionNum = parseInt(res.data.total) || 0
} }
}, },
async getTechnicalEvaluationToDo() { async getTechnicalEvaluationToDo() {
const res = await getTechnicalEvaluationToDoApi({ pageIndex: 1, pageSize: 10 }) const res = await getTechnicalEvaluationToDoApi({ pageIndex: 1, pageSize: 10 })
if (res.code == 200) { if (res.code == 200) {
this.technologyEvaluationNum = res.total || 0 this.technologyEvaluationNum = parseInt(res.data.total) || 0
} }
}, },
initData() { async initData() {
this.getArrangeWorkListForApp() await Promise.all([
this.getRqmListForMobile() (this.getArrangeWorkListForApp(), this.getRqmListForMobile(), this.getDecisiongetDecisionToDo(), this.getTechnicalEvaluationToDo())
this.getDecisiongetDecisionToDo() ])
this.getTechnicalEvaluationToDo()
}, },
setState(...args) { setState(...args) {
this.$patch({ [args[0]]: args[1] }) this.$patch({ [args[0]]: args[1] })
......
...@@ -18,7 +18,7 @@ const menuList = ref([ ...@@ -18,7 +18,7 @@ const menuList = ref([
{ id: 13, name: 'AOG任务', icon: 'AOG', group: '运行品质', default: true, count: 0, url: '/panel/aog/search' }, { id: 13, name: 'AOG任务', icon: 'AOG', group: '运行品质', default: true, count: 0, url: '/panel/aog/search' },
{ id: 14, name: 'MCO', icon: 'MCO', group: '运行品质', default: true, count: 0, url: '/panel/mco/search' }, { id: 14, name: 'MCO', icon: 'MCO', group: '运行品质', default: true, count: 0, url: '/panel/mco/search' },
{ id: 15, name: '航班保障', icon: 'hbbz', group: '运行品质', default: true, count: 0, url: '/panel/flight-support/list' }, { id: 15, name: '航班保障', icon: 'hbbz', group: '运行品质', default: true, count: 0, url: '/panel/flight-support/list' },
{ id: 16, name: '我的跟机', icon: 'khjl', group: '运行品质', default: false, count: 0, url: '/panel/supported-task/list' } { id: 16, name: '我的跟机', icon: 'wdgj', group: '运行品质', default: false, count: 0, url: '/panel/supported-task/list' }
]) ])
const useUserStore = defineStore('user', { const useUserStore = defineStore('user', {
state: () => { state: () => {
......
<template> <template>
<global-page :showNavbar="false"> <global-page :showNavbar="false" refresherEnabled @handleQuery="handleQuery">
<!-- 导航栏 --> <!-- 导航栏 -->
<template #top> <template #top>
<image class="page-bg" src="/static/mocp/image/panel/page-bg.png" /> <image class="page-bg" src="/static/mocp/image/panel/page-bg.png" />
...@@ -13,6 +13,18 @@ ...@@ -13,6 +13,18 @@
<script setup> <script setup>
import PanelNavbar from './components/panel-navbar.vue' import PanelNavbar from './components/panel-navbar.vue'
import PanelMenu from './components/panel-menu.vue' import PanelMenu from './components/panel-menu.vue'
import useMyToDoStore from 'mocp/store/my-toDo'
//刷新我的待办个数
const myToDoStore = useMyToDoStore()
const handleQuery = async () => {
uni.showLoading({
title: '加载中',
mask: true
})
await myToDoStore.initData()
uni.hideLoading()
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-bg { .page-bg {
......
...@@ -56,7 +56,7 @@ const goDetails = (data) => { ...@@ -56,7 +56,7 @@ const goDetails = (data) => {
}) })
} }
const handleQuery = ({ res }) => { const handleQuery = ({ res }) => {
myToDoStore.setState('appraisalRecordNum', res.total || 0) myToDoStore.setState('appraisalRecordNum', parseInt(res.total) || 0)
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
...@@ -68,7 +68,7 @@ const goDetails = (data) => { ...@@ -68,7 +68,7 @@ const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/assign-work/details', { id: data.id }) uni.$mocpJump.navigateTo('/panel/assign-work/details', { id: data.id })
} }
const handleQuery = ({ res }) => { const handleQuery = ({ res }) => {
myToDoStore.setState('assignWorkNum', res.total || 0) myToDoStore.setState('assignWorkNum', parseInt(res.data.total) || 0)
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
...@@ -64,7 +64,7 @@ const goDetails = (data) => { ...@@ -64,7 +64,7 @@ const goDetails = (data) => {
}) })
} }
const handleQuery = ({ res }) => { const handleQuery = ({ res }) => {
myToDoStore.setState('moveDecisionNum', res.total || 0) myToDoStore.setState('moveDecisionNum', parseInt(res.data.total) || 0)
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
...@@ -70,7 +70,7 @@ const goDetails = (data) => { ...@@ -70,7 +70,7 @@ const goDetails = (data) => {
}) })
} }
const handleQuery = ({ res }) => { const handleQuery = ({ res }) => {
myToDoStore.setState('technologyEvaluationNum', res.total || 0) myToDoStore.setState('technologyEvaluationNum', parseInt(res.data.total) || 0)
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment