From eac320cfa11efb3485485c1c13b728135d701cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Tue, 10 Oct 2023 17:12:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=90=9C=E7=B4=A2=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2+=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=E5=90=8D=E5=AD=97=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/firmwareUpgrade/index.js | 4 ++-- .../sections/firmwareUpgrade/components/addFirmwareModal.jsx | 2 +- .../sections/firmwareUpgrade/containers/firmwareLibrary.jsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/app/lib/controllers/firmwareUpgrade/index.js b/api/app/lib/controllers/firmwareUpgrade/index.js index fcbbc91..3f0efe6 100644 --- a/api/app/lib/controllers/firmwareUpgrade/index.js +++ b/api/app/lib/controllers/firmwareUpgrade/index.js @@ -277,7 +277,7 @@ async function deleteFirmware(ctx){ async function getThingMessages(ctx){ try{ const {thingIds,device_meta_id,searchVal}=ctx.request.body - + const res= await ctx.app.fs.craw.post(ApiTable.getThingMessages,{data:{thingIds,device_meta_id}}) // console.log('xxxxxx',res) let rslt=[] @@ -312,7 +312,7 @@ async function getThingMessages(ctx){ } let result if(searchVal&&rslt&&rslt.length){ - result= rslt.filter(item=>item.deviceName===searchVal) + result= rslt.filter(item=>item.deviceName.includes(searchVal) ) } if(!searchVal){ result=rslt diff --git a/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx b/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx index 88d0883..c75952e 100644 --- a/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx +++ b/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx @@ -106,7 +106,7 @@ const AddFirmwareModal = (props) => { 'firmwareName':recordRow?.firmwareName, 'deviceName':recordRow?.device_meta_id, 'versionNo':recordRow?.versionNo, - 'files':recordRow?[{ url: `${domain}/${recordRow?.filepath}`, name: recordRow?.firmwareName }]:[], + 'files':recordRow?[{ url: `${domain}/${recordRow?.filepath}`, name: recordRow?.filepath.split('/')[recordRow?.filepath.split('/')?.length-1] }]:[], 'remark':recordRow?.remark }} getFormApi={formApi => api.current = formApi} labelCol={{ span: 7,offset:1}} wrapperCol={{span: 15,offset:1}} labelPosition='left' > diff --git a/web/client/src/sections/firmwareUpgrade/containers/firmwareLibrary.jsx b/web/client/src/sections/firmwareUpgrade/containers/firmwareLibrary.jsx index 564eb48..5a5af28 100644 --- a/web/client/src/sections/firmwareUpgrade/containers/firmwareLibrary.jsx +++ b/web/client/src/sections/firmwareUpgrade/containers/firmwareLibrary.jsx @@ -32,7 +32,7 @@ const FirmwareLibrary = (props) => { },[]) const searchHandler=()=>{ - const query={version:searchVal,device_meta_name:searchVal} + const query={version:searchVal,filename:searchVal} getData(query) }