فهرست منبع

监听项目变化

duy 1 سال پیش
والد
کامیت
49d84a506f
1فایلهای تغییر یافته به همراه13 افزوده شده و 1 حذف شده
  1. 13 1
      src/views/count/index.vue

+ 13 - 1
src/views/count/index.vue

@@ -74,7 +74,7 @@
 </template>
 
 <script setup>
-import { onMounted, onUnmounted, ref } from 'vue'
+import { onMounted, onUnmounted, ref, watch } from 'vue'
 import BarLabelEcharts from '~com/echarts/BarLabel.vue'
 import stackEcharts from '~com/echarts/stackEcharts.vue'
 import split from 'split.js'
@@ -85,7 +85,19 @@ const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId)
 
 
+//监听变量值
+//监听变量值
+watch(() => [
+    useAppState.projectId,
+], ([pid]) => {
+    projectId.value = pid
+    if ( areaId.value) {
+        getAreProgress()
+        getPlanDatas()
+        getPlanDatas1()
+     }
 
+})
 //树节点被点击
 const treeNodeTap = ({ node, data }) => {
     areaId.value = data.id