Commit ea88335d by pangchong

feat: 防风害待办

parent 28059df8
...@@ -136,3 +136,11 @@ export const getTerminalWeatherListApi = (data, config) => { ...@@ -136,3 +136,11 @@ export const getTerminalWeatherListApi = (data, config) => {
config config
}) })
} }
export const getPwdTaskListForMobileApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getPwdTaskListForMobile',
data,
config
})
}
...@@ -395,6 +395,13 @@ onUnmounted(() => { ...@@ -395,6 +395,13 @@ onUnmounted(() => {
const handleFooterClick = () => { const handleFooterClick = () => {
es('handleFooterClick') es('handleFooterClick')
} }
watch(
() => ps.showEmpty,
() => {
chooseValue.value = []
paging.value?.reload()
}
)
// 获取页面栈 // 获取页面栈
const pages = getCurrentPages() const pages = getCurrentPages()
defineExpose({ defineExpose({
......
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import useUserStore from 'mocp/store/user' import useUserStore from 'mocp/store/user'
import { getArrangeWorkListForAppApi, getDecisiongetDecisionToDoApi, getRqmListForMobileApi, getTechnicalEvaluationToDoApi } from 'mocp/api/my-toDo' import { getArrangeWorkListForAppApi, getDecisiongetDecisionToDoApi, getRqmListForMobileApi, getTechnicalEvaluationToDoApi } from 'mocp/api/my-toDo'
import { getPwdPatrolListApi } from 'mocp/api/windDamageManagement' import { getPwdTaskListForMobileApi } from 'mocp/api/windDamageManagement'
const useMyToDoStore = defineStore('myToDo', { const useMyToDoStore = defineStore('myToDo', {
state: () => { state: () => {
...@@ -90,10 +90,11 @@ const useMyToDoStore = defineStore('myToDo', { ...@@ -90,10 +90,11 @@ const useMyToDoStore = defineStore('myToDo', {
this.technologyEvaluationNum = parseInt(res.data.total) || 0 this.technologyEvaluationNum = parseInt(res.data.total) || 0
} }
}, },
async getPwdPatrolList() { async getPwdTaskListForMobile() {
const res = await getPwdPatrolListApi({ pageIndex: 1, pageSize: 10 }) const userStore = useUserStore()
const res = await getPwdTaskListForMobileApi({ userId: userStore.userInfo?.id })
if (res.code == 200) { if (res.code == 200) {
this.windDamageManagementNum = parseInt(res.data.total) || 0 this.windDamageManagementNum = this.countWindDamageManagementNum(res.data)
} }
}, },
async initData() { async initData() {
...@@ -102,9 +103,16 @@ const useMyToDoStore = defineStore('myToDo', { ...@@ -102,9 +103,16 @@ const useMyToDoStore = defineStore('myToDo', {
this.getRqmListForMobile(), this.getRqmListForMobile(),
this.getDecisiongetDecisionToDo(), this.getDecisiongetDecisionToDo(),
this.getTechnicalEvaluationToDo(), this.getTechnicalEvaluationToDo(),
this.getPwdPatrolList()) this.getPwdTaskListForMobile())
]) ])
}, },
countWindDamageManagementNum(data) {
let count = 0
data.forEach((element) => {
count = count + element?.basicInfoList.length
})
return count
},
setState(...args) { setState(...args) {
this.$patch({ [args[0]]: args[1] }) this.$patch({ [args[0]]: args[1] })
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
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' import useMyToDoStore from 'mocp/store/my-toDo'
import { onUnload } from '@dcloudio/uni-app'
//刷新我的待办个数 //刷新我的待办个数
const myToDoStore = useMyToDoStore() const myToDoStore = useMyToDoStore()
...@@ -25,6 +26,13 @@ const handleQuery = async () => { ...@@ -25,6 +26,13 @@ const handleQuery = async () => {
await myToDoStore.initData() await myToDoStore.initData()
uni.hideLoading() uni.hideLoading()
} }
//更新防风害管理待办个数
uni.$on('windDamageManagementReload', () => {
myToDoStore.getPwdTaskListForMobile()
})
onUnload(() => {
uni.$off('windDamageManagementReload')
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-bg { .page-bg {
......
<template> <template>
<up-collapse-item :title="`防风害管理(${getWindDamageManagementNum})`" v-if="getWindDamageManagementNum > 0"> <up-collapse-item :title="`防风害管理(${getWindDamageManagementNum})`" v-if="getWindDamageManagementNum > 0">
<global-page <global-page
ref="paging"
:fixed="false" :fixed="false"
:height="height" :height="height"
:showNavbar="false" :showNavbar="false"
...@@ -8,10 +9,11 @@ ...@@ -8,10 +9,11 @@
isDataList isDataList
refresherEnabled refresherEnabled
loadingMoreEnabled loadingMoreEnabled
localPaging
:params="{ :params="{
userId: userStore.userInfo?.id userId: userStore.userInfo?.id
}" }"
:api="getPwdPatrolListApi" :api="getPwdTaskListForMobileApi"
@handleQuery="handleQuery" @handleQuery="handleQuery"
auto auto
> >
...@@ -78,11 +80,13 @@ ...@@ -78,11 +80,13 @@
import useUserStore from 'mocp/store/user' import useUserStore from 'mocp/store/user'
import useMyToDoStore from 'mocp/store/my-toDo' import useMyToDoStore from 'mocp/store/my-toDo'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { getPwdPatrolListApi } from 'mocp/api/windDamageManagement' import { getPwdTaskListForMobileApi } from 'mocp/api/windDamageManagement'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement' import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict' import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { timeStampFormat } from 'mocp/utils/tool' import { timeStampFormat } from 'mocp/utils/tool'
import useBaseStore from 'mocp/store/base' import useBaseStore from 'mocp/store/base'
import { ref } from 'vue'
import { onUnload } from '@dcloudio/uni-app'
const userStore = useUserStore() const userStore = useUserStore()
const baseStore = useBaseStore() const baseStore = useBaseStore()
...@@ -107,8 +111,16 @@ const handleDelete = (data) => { ...@@ -107,8 +111,16 @@ const handleDelete = (data) => {
console.log(data) console.log(data)
} }
const handleQuery = ({ res }) => { const handleQuery = ({ res }) => {
myToDoStore.setState('windDamageManagementNum', parseInt(res.data.total) || 0) myToDoStore.setState('windDamageManagementNum', myToDoStore.countWindDamageManagementNum(res.data))
} }
//刷新
const paging = ref()
uni.$on('windDamageManagementReload', () => {
paging.value?.reload()
})
onUnload(() => {
uni.$off('windDamageManagementReload')
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import 'mocpStatic/css/list.scss'; @import 'mocpStatic/css/list.scss';
......
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