From 23b29745979ac3899848cbf0a255fdbe4ed00939 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Tue, 14 Jan 2025 15:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.env.development | 2 +- frontend/src/routers/index.ts | 1 - .../views/home/components/channelsTest.vue | 12 +++++----- frontend/src/views/home/components/table.vue | 14 +++++------ frontend/src/views/home/tabs/dashboard.vue | 23 +++++++++++++------ .../machine/device/components/devicePopup.vue | 8 +++++-- frontend/src/views/machine/device/index.vue | 23 +++++++++++++++---- 7 files changed, 55 insertions(+), 28 deletions(-) diff --git a/frontend/.env.development b/frontend/.env.development index 01e3f04..8f13788 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -19,6 +19,6 @@ VITE_API_URL=/api # 开发环境跨域代理,支持配置多个 -VITE_PROXY=[["/api","http://192.168.1.121:18092/"]] +VITE_PROXY=[["/api","http://192.168.1.124:18092/"]] #VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] # VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文 diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts index fbd5f6e..b4aa303 100644 --- a/frontend/src/routers/index.ts +++ b/frontend/src/routers/index.ts @@ -46,7 +46,6 @@ router.beforeEach(async (to, from, next) => { const authStore = useAuthStore() // 1.NProgress 开始 NProgress.start() - console.log('11111111111111'); // 2.动态设置标题 const title = import.meta.env.VITE_GLOB_APP_TITLE document.title = to.meta.title ? `${to.meta.title} - ${title}` : title diff --git a/frontend/src/views/home/components/channelsTest.vue b/frontend/src/views/home/components/channelsTest.vue index f3e6c73..82a9d55 100644 --- a/frontend/src/views/home/components/channelsTest.vue +++ b/frontend/src/views/home/components/channelsTest.vue @@ -241,17 +241,17 @@ watch(webMsgSend,function (newValue,oldValue){ item.devName === newValue.data.devName); if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在 firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4); - firstCoefficientVO.aVuXi = parseFloat(newValue.data.aVuXi).toFixed(4); + firstCoefficientVO.aVuXi = parseFloat((newValue.data.aVuXi / 10000).toFixed(4)).toString(); firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4); - firstCoefficientVO.bVuXi = parseFloat(newValue.data.bVuXi).toFixed(4); + firstCoefficientVO.bVuXi = parseFloat((newValue.data.bVuXi / 10000).toFixed(4)).toString(); firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4); - firstCoefficientVO.cVuXi = parseFloat(newValue.data.cVuXi).toFixed(4); + firstCoefficientVO.cVuXi = parseFloat((newValue.data.cVuXi / 10000).toFixed(4)).toString(); firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4); - firstCoefficientVO.aIeXi = parseFloat(newValue.data.aIeXi).toFixed(4); + firstCoefficientVO.aIeXi = parseFloat((newValue.data.aVuXi / 10000).toFixed(4)).toString(); firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4); - firstCoefficientVO.bIeXi = parseFloat(newValue.data.bIeXi).toFixed(4); + firstCoefficientVO.bIeXi = parseFloat((newValue.data.bVuXi / 10000).toFixed(4)).toString(); firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4); - firstCoefficientVO.cIeXi = parseFloat(newValue.data.cIeXi).toFixed(4); + firstCoefficientVO.cIeXi = parseFloat((newValue.data.cVuXi / 10000).toFixed(4)).toString(); //console.log(newValue.data.devName + '对象:', firstCoefficientVO); activeIndex.value++; } else { diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 875ebbe..1c6ff49 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -451,6 +451,13 @@ const getTableList = async (params: any) => { 'reportState': form.value.checkReportStatus, 'name':form.value.search }); + }else{//点击树根节点,表格显示无数据 + return getBoundPqDevList({'planId': '', + 'checkStateList': [0], + 'checkResult': form.value.checkResult, + 'reportState': form.value.checkReportStatus, + 'name':form.value.search + }); } }; @@ -579,9 +586,6 @@ const columns = reactive[]>([ }, { prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow}, ]) - - - // 跳转详情页 const toDetail = () => { router.push( @@ -1025,7 +1029,6 @@ const handleTest = async (val:string) => { }; - // 打开 drawer(新增、查看、编辑) const openDrawer = async (title: string, row: any) => { if (title === '查看') @@ -1109,9 +1112,6 @@ onBeforeMount(async () => { })) }) - - - const handleQuitClicked = () => { emit('batchGenerateClicked'); // 触发事件 }; diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index 5214565..e1dd53b 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -202,10 +202,6 @@ const tableRef2 = ref() const currentId = ref('') - - - - watch( () => form.value, (val, oldVal) => { @@ -271,7 +267,6 @@ const findPlanById = (plans: Plan.ReqPlan[], id: string): Plan.ReqPlan | undefin const getPieData = async (id: string) => { currentId.value = id // 设置当前ID - // 初始化计数对象 const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 } const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 } @@ -306,6 +301,10 @@ const getPieData = async (id: string) => { reportStateCount[t.reportState]++ } }) + + }else{ + + planName.value = '所选计划:' } // 检查 checkStateCount 是否全为 0 @@ -339,6 +338,7 @@ chartsData3.value = [ pieRef3.value.init() } const getTree = (data?: any) => { + treeRef.value.getTreeData(data) } //前往检测 @@ -434,9 +434,18 @@ onBeforeMount(async () => { } planList.value = (await getPlanListByPattern(reqPlan)) as ResultData - if (planList.value.data[0].children[0]) { - currentId.value = planList.value.data[0].children[0].id + for (let i = 0; i < planList.value.data.length; i++) { + if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) { + currentId.value = planList.value.data[i].children[0].id; // 直接赋值第一个 children 的 id + break; // 确保只执行一次 + } } + + // if (planList.value.data[0].children[0]) { + // currentId.value = planList.value.data[0].children[0].id + // console.log('currentId.value',planList.value.data[0]) + // } + if (chartsInfoRef.value) { resizeObserver.observe(chartsInfoRef.value) } diff --git a/frontend/src/views/machine/device/components/devicePopup.vue b/frontend/src/views/machine/device/components/devicePopup.vue index 06b1693..b97927b 100644 --- a/frontend/src/views/machine/device/components/devicePopup.vue +++ b/frontend/src/views/machine/device/components/devicePopup.vue @@ -41,7 +41,7 @@ /> - + > = { const rules = computed(() => { const dynamicRules = { ...baseRules }; + if (scene.value === '0'){//只有电科院需要展示 + dynamicRules.createDate= [{ required: true, message: '出厂日期必填!', trigger: 'blur' }]; + } if (scene.value !== '0') { dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }]; dynamicRules.hardwareVersion = [{ required: true, message: '固件版本必填!', trigger: 'blur' }]; dynamicRules.softwareVersion = [{ required: true, message: '软件版本必填!', trigger: 'blur' }]; dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }]; + } if (scene.value !== '2') { dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }]; dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }]; - dynamicRules.createDate= [{ required: true, message: '出厂日期必填!', trigger: 'blur' }]; + } diff --git a/frontend/src/views/machine/device/index.vue b/frontend/src/views/machine/device/index.vue index 688756e..27b887b 100644 --- a/frontend/src/views/machine/device/index.vue +++ b/frontend/src/views/machine/device/index.vue @@ -94,9 +94,10 @@ const columns = reactive[]>([ prop: 'createDate', label: '出厂日期', minWidth: 200, - search: { - span: 2, - render: () => { + isShow: appSceneStore.currentScene === '0', + ...(appSceneStore.currentScene === '0' ? { + search: { + render: () => { return (
[]>([
) }, - }, + }, + } : {}), + // search: { + // span: 2, + // render: () => { + // return ( + //
+ // + //
+ // ) + // }, + // }, }, { prop: 'devChns',