Pārlūkot izejas kodu

档案统计接口对接1

duy 2 gadi atpakaļ
vecāks
revīzija
a3d2cddeb0
2 mainītis faili ar 77 papildinājumiem un 29 dzēšanām
  1. 33 0
      src/api/modules/using/stats.js
  2. 44 29
      src/views/using/stats.vue

+ 33 - 0
src/api/modules/using/stats.js

@@ -0,0 +1,33 @@
+import {httpApi} from "../../request/httpApi";
+
+export default {
+    //档案统计-已组案卷
+    async getallArchiveByContractType(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/allArchiveByContractType',
+            method: 'get',
+            params: form,
+        
+        }, msg);
+    },
+    //获取档案年限占比 
+    async getallArchiveAge(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/allArchiveAgeByContractType',
+            method: 'get',
+            params: form,
+        
+        }, msg);
+    },
+    //获取已销毁案卷
+    async getallArchiveDestory(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/allDeletedArchiveByContractType',
+            method: 'get',
+            params: form,
+        
+        }, msg);
+    },
+ 
+}
+

+ 44 - 29
src/views/using/stats.vue

@@ -64,6 +64,8 @@ import {useAppStore} from "~src/store";
 import BarChart from "./components/echarts/BarChart.vue"
 import ArrRoundChart from "./components/echarts/ArrRoundChart.vue"
 import RoundPieChart from "./components/echarts/RoundPieChart.vue"
+import archivesStatsApi from "~api/using/stats.js";
+import {getObjValue,getArrValue} from "js-fast-way"
 
 //变量
 const useAppState = useAppStore()
@@ -73,6 +75,9 @@ const projectInfo = ref(useAppState.getProjectInfo);
 
 //渲染完成
 onMounted(() => {
+    gethasBeenChartData()
+    getfixedChartData()
+    getdestroyChartData()
 
 })
 
@@ -108,7 +113,19 @@ const isHasBeenLoading = ref(false)
 const hasBeenChartData = ref({
     key1: 3210, key2: 850, key3: 1203
 })
-
+//获取已组案卷
+const gethasBeenChartData = async () => {
+  
+    const { error, code, data } = await archivesStatsApi.getallArchiveByContractType({
+        projectId: projectId.value,
+       
+    });
+    if (!error && code === 200) {
+        hasBeenChartData.value = getObjValue(data);
+    } else {
+        hasBeenChartData.value = {};
+    }
+}
 
 //档案年限占比 图表数据
 const fixedChartRef = ref(null)
@@ -120,7 +137,20 @@ const fixedChartData = ref([
     { value: 484, name: '10年' },
     { value: 300, name: '5年' }
 ])
-
+//获取档案年限
+const getfixedChartData = async () => {
+    isLoading.value = true
+    const { error, code, data } = await archivesStatsApi.getallArchiveAge({
+        projectId: projectId.value,
+       
+    });
+    if (!error && code === 200) {
+        console.log(data,'data');
+        fixedChartData.value = getArrValue(data);
+    } else {
+        fixedChartData.value = [];
+    }
+}
 
 //已销毁案卷 图表配置
 const destroyChartRef = ref(null)
@@ -136,39 +166,24 @@ const isDestroyLoading = ref(false)
 const destroyChartData = ref({
     key1: 202, key2: 150, key3: 100
 })
-
-//初始数据获取
-const isLoading = ref(false)
-const tableData = ref([])
-const getTableData = async () => {
-    /*isLoading.value = true
-    const { error, code, data } = await DataApi.queryContractTreeMaterialProgress({
+//获取已销毁案卷
+const getdestroyChartData = async () => {
+    const { error, code, data } = await archivesStatsApi.getallArchiveDestory({
         projectId: projectId.value,
-        contractId: contractId.value,
-        parentId: ''
+       
     });
-    isLoading.value = false
     if (!error && code === 200) {
-        tableData.value = getArrValue(data['treeMaterialProgressList']);
+        destroyChartData.value = getObjValue(data);
     } else {
-        tableData.value = [];
-    }*/
+        destroyChartData.value = [];
+    }
 }
+//初始数据获取
+const isLoading = ref(false)
+const tableData = ref([])
+
+
 
-//懒加载数据
-const loadData = async (row, treeNode, resolve) => {
-    /*const { error, code, data } = await DataApi.queryContractTreeMaterialProgress({
-        projectId: projectId.value,
-        contractId: row.contractId || contractId.value,
-        parentId: row.id
-    });
-    if (!error && code === 200) {
-        resolve(getArrValue(data['treeMaterialProgressList']))
-    } else {
-        resolve([])
-    }*/
-    resolve([])
-}
 
 </script>