Browse Source

feat:搜索按钮模糊查询+文件回显名字错误问题

dev
zhaobing’ 1 year ago
parent
commit
eac320cfa1
  1. 2
      api/app/lib/controllers/firmwareUpgrade/index.js
  2. 2
      web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx
  3. 2
      web/client/src/sections/firmwareUpgrade/containers/firmwareLibrary.jsx

2
api/app/lib/controllers/firmwareUpgrade/index.js

@ -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

2
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' >
<Form.Input field='firmwareName' label='固件版本名称:' style={{with:'80%'}} rules={[{ required: true, message: '固件版本名称必填' }]}></Form.Input>

2
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)
}

Loading…
Cancel
Save