Merge pull request 'feat:任务审核仪表盘动态更新' (#278) from fix/change_task into test

Reviewed-on: #278
pull/279/head
赵辉 1 year ago
commit d87bdc93ba

@ -1,14 +1,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { defineProps, onMounted, ref } from "vue"; import { defineProps, onMounted, ref,watch } from "vue";
import { gettaskToolsCount } from "@/api/home/main"; import { gettaskToolsCount } from "@/api/home/main";
import { useDataHeaderStore } from '@/store/modules/DataHeader'
defineProps({ defineProps({
hasColor: { hasColor: {
type: Boolean, type: Boolean,
default: () => false, default: () => false,
}, },
}); });
const headerstore=useDataHeaderStore()
const datalist = ref([ const datalist = ref([
{ {
link: "count", link: "count",
@ -59,6 +59,7 @@ onMounted(() => {
initRem(); initRem();
getData(); getData();
}); });
async function getData() { async function getData() {
const { data } = await gettaskToolsCount(); const { data } = await gettaskToolsCount();
if (data) { if (data) {
@ -111,9 +112,13 @@ async function getData() {
}, },
] ]
datalist.value =newdata ; datalist.value =newdata ;
console.log(datalist.value)
} }
} }
watch(datalist, (newVal) => {
if(newVal){
getData();
headerstore.setDataConfig(false)
}})
</script> </script>
<template> <template>

@ -0,0 +1,35 @@
import { store } from '@/store'
import { defineStore } from 'pinia'
export interface ConfigState {
DataConfig: boolean
}
export const useDataHeaderStore = defineStore({
id: 'app-config',
state: (): ConfigState => ({
DataConfig: false,
}),
getters: {
getDataConfig():boolean {
return this.DataConfig
},
},
actions: {
setDataConfig(value) {
this.DataConfig = value
},
},
})
// Need to be used outside the setup
export function useConfig() {
return useDataHeaderStore(store)
}

@ -23,6 +23,7 @@ import NotPassed from '@/components/Approval/NotPassed.vue'
import { getAllfieldList, getfieldList } from '@/api/home/filter' import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { TASK_STATUS_OBJ } from '@/enums/index' import { TASK_STATUS_OBJ } from '@/enums/index'
import { useFinal } from '@/store/modules/final' import { useFinal } from '@/store/modules/final'
import { useDataHeaderStore } from '@/store/modules/DataHeader'
import { import {
audit, audit,
dubiousfileyd, dubiousfileyd,
@ -38,7 +39,7 @@ import bgLoading from '@/assets/images/bg-loading.png'
import { useKeydown } from '@/hooks/event/useKeydown' import { useKeydown } from '@/hooks/event/useKeydown'
const emit = defineEmits(['setAsideItemName']) const emit = defineEmits(['setAsideItemName'])
const HeaderStore=useDataHeaderStore()
const router = useRouter() const router = useRouter()
const loading = ref(false) const loading = ref(false)
const batch = ref(false) const batch = ref(false)
@ -294,6 +295,7 @@ function doAudit(param: any) {
reloadList(param, '通过') reloadList(param, '通过')
batchModalRef.value.reload() batchModalRef.value.reload()
modal.closeModal() modal.closeModal()
HeaderStore.setDataConfig(true)
} }
}) })
} }
@ -501,6 +503,7 @@ function notPassSuccess(param) {
reloadList(param, '不通过') reloadList(param, '不通过')
const modal = unref(imgdetailref)! as any const modal = unref(imgdetailref)! as any
modal.closeModal() modal.closeModal()
HeaderStore.setDataConfig(true)
overTask.value = null overTask.value = null
} }
@ -1234,7 +1237,7 @@ function nopassfun(e){
> >
<SvgIcon <SvgIcon
style="cursor: pointer" style="cursor: pointer"
name="t5" name="t1"
@click.stop="approvalHandler([item])" @click.stop="approvalHandler([item])"
/> />
<SvgIcon <SvgIcon

Loading…
Cancel
Save