diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index daef84f..a938c5c 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -328,11 +328,15 @@ const checkStatus: Dict[] = [ const checkReportStatus: Dict[] = [ { id: "0", - label: '已生成', + label: '未生成', }, { id: "1", - label: '未生成', + label: '已生成', + }, + { + id: "2", + label: '未检', }, ] //检测结果数组 @@ -379,8 +383,9 @@ const proTable = ref(); const boundPqDevList=ref([])//根据检测计划id查询出所有已绑定的设备 const getTableList = async (params: any) => { -<<<<<<< HEAD - const checkStateList = ref() +console.log('activeTabs',form.activeTabs) + if(props.id){ + const checkStateList = ref() if(form.value.checkStatus != null){ checkStateList.value = [form.value.checkStatus] }else{ @@ -389,17 +394,11 @@ const getTableList = async (params: any) => { return getBoundPqDevList({'planId': props.id,  'checkStateList': checkStateList.value, 'checkResult': form.value.checkResult, - 'reportState ': form.value.checkReportStatus, + 'reportState': form.value.checkReportStatus, 'name':form.value.search }); -======= - debugger - if(props.id) { - // const pqDevList_Result2 = await getBoundPqDevList({'planId': props.id,'checkStateList':[0,1,2]}); - // boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[]; - return getBoundPqDevList({'planId': props.id,'checkStateList':[0,1,2]}); } ->>>>>>> 07d02307e2507c32fc2b3c8b745b074d7a9bb74d + }; @@ -478,10 +477,20 @@ const columns = reactive[]>([ minWidth: 100, sortable:true, render: scope => { - return ( - scope.row.checkState === 0 ? '已生成' : '未生成' - ) - }, + if (scope.row.reportState === 0) + { + return '未生成'; + } + else if (scope.row.reportState === 1) + { + return '已生成'; + } + else if (scope.row.reportState === 2) + { + return '未检'; + } + return ''; + } }, { prop: 'documentState', @@ -491,7 +500,7 @@ const columns = reactive[]>([ isShow: documentStateShow, render: scope => { return ( - scope.row.documentState === 0 ? '未归档' : '归档' + scope.row.documentState === 0 ? '未归档' : '已归档' ) }, }, diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index 8e8514b..c56e073 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -115,7 +115,7 @@ import Table from "../components/table.vue"; //import { data } from "@/api/plan/static.json"; import deviceDataList from '@/api/device/device/deviceData' import {getPlanListByPattern } from '@/api/plan/plan.ts' -import { onMounted, onUnmounted, ref, watch } from "vue"; +import { onBeforeMount, onMounted, onUnmounted, ref, watch } from "vue"; import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store import { useDictStore } from '@/stores/modules/dict' import { type Plan } from "@/api/plan/interface"; @@ -272,13 +272,10 @@ const getPieData = async (id: string) => { currentId.value = id; // 设置当前ID //handleCheckFunction(0)//切换左侧树,默认css功能是设备检测 const boundPqDevList=ref([])//根据检测计划id查询出所有已绑定的设备 -<<<<<<< HEAD const pqDevList_Result2 = await getBoundPqDevList({'planId': id,'checkStateList':[0,1,2,3]}); -======= - const pqDevList_Result2 = await getBoundPqDevList({'planId': id,'checkStateList':[0,1,2]}); ->>>>>>> 07d02307e2507c32fc2b3c8b745b074d7a9bb74d + boundPqDevList.value = pqDevList_Result2.data as Device.ResPqDev[]; -console.log('饼图列',boundPqDevList) + console.log('饼图列',boundPqDevList) // 初始化计数对象 const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 }; // 遍历 boundPqDevList 并更新计数对象 @@ -314,14 +311,14 @@ console.log('饼图列',boundPqDevList) { value: checkStateCount[3], name: "归档", itemStyle: { color: '#5470c6' } }, ]; chartsData2.value = [ - { value: checkResultCount[0], name: "未检" , itemStyle: { color: '#fac858' } }, - { value: checkResultCount[1], name: "不符合" , itemStyle: { color: '#ee6666' } }, - { value: checkResultCount[2], name: "符合", itemStyle: { color: '#91cc75' } }, + { value: checkResultCount[2], name: "未检" , itemStyle: { color: '#fac858' } }, + { value: checkResultCount[0], name: "不符合" , itemStyle: { color: '#ee6666' } }, + { value: checkResultCount[1], name: "符合", itemStyle: { color: '#91cc75' } }, ]; chartsData3.value = [ - { value: reportStateCount[0], name: "未检" , itemStyle: { color: '#fac858' } }, - { value: reportStateCount[1], name: "未生成" , itemStyle: { color: '#ee6666' } }, - { value: reportStateCount[2], name: "已生成", itemStyle: { color: '#91cc75' } }, + { value: reportStateCount[2], name: "未检" , itemStyle: { color: '#fac858' } }, + { value: reportStateCount[0], name: "未生成" , itemStyle: { color: '#ee6666' } }, + { value: reportStateCount[1], name: "已生成", itemStyle: { color: '#91cc75' } }, ]; pieRef1.value.init(); @@ -425,15 +422,12 @@ onBeforeMount(async () => { code: 0, state: 0 }; -<<<<<<< HEAD - const planList = await getPlanListByPattern(reqPlan); -======= + // debugger; const planList = await getPlanListByPattern(reqPlan); if (planList.data[0].children[0]) { currentId.value = planList.data[0].children[0].id; } ->>>>>>> 07d02307e2507c32fc2b3c8b745b074d7a9bb74d if (chartsInfoRef.value) { resizeObserver.observe(chartsInfoRef.value); }