修改 key列表查询组件

This commit is contained in:
wangsongsole 2022-07-28 11:27:25 +08:00
parent 634b7ad29e
commit 43adddd11f
2 changed files with 14 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @Author: Wind * @Author: Wind
* @Date: 2022-07-25 10:53:41 * @Date: 2022-07-25 10:53:41
* @LastEditors: Wind * @LastEditors: Wind
* @LastEditTime: 2022-07-28 09:49:31 * @LastEditTime: 2022-07-28 11:26:12
* @Description:key列表查询组件 * @Description:key列表查询组件
* @FilePath: \frontend\src\components\keysFind\index.jsx * @FilePath: \frontend\src\components\keysFind\index.jsx
*/ */
@ -57,6 +57,16 @@ export default ({ onQuery }) => {
}) })
}, []) }, [])
function onChange(data) {
return {
date: data.date.length || null,
reseller: data.reseller?.key,
plan: data.plan?.key,
state: data.state?.key,
key: data.key || null
}
}
return ( return (
<div className='keysFind'> <div className='keysFind'>
<Form> <Form>
@ -116,13 +126,13 @@ export default ({ onQuery }) => {
</FormItem> </FormItem>
<div> <div>
<Button type='primary' onClick={() => onQuery(models)}> <Button type='primary' onClick={() => onQuery(onChange(models))}>
查询 查询
</Button> </Button>
<Button <Button
onClick={() => { onClick={() => {
setModels(init()) setModels(init())
onQuery(init()) onQuery(onChange(init()))
}}> }}>
重置 重置
</Button> </Button>

View File

@ -101,13 +101,13 @@ export default class acclist extends React.Component {
} }
getKeyCodeList(data) { getKeyCodeList(data) {
console.log(data, this.state.conditionalQuery)
let queryParams = _.omitBy( let queryParams = _.omitBy(
{ ...data, ...this.state.conditionalQuery }, { ...data, ...this.state.conditionalQuery },
(value) => { (value) => {
return _.isNaN(value) || _.isNil(value) return _.isNaN(value) || _.isNil(value)
} }
) )
console.log(queryParams)
let id = sessionStorage.getItem('key_batch_id') let id = sessionStorage.getItem('key_batch_id')
getkeyDetailList(id, queryParams).then((res) => { getkeyDetailList(id, queryParams).then((res) => {