Commit 509e2f86 by zhaochengxiang

修改资产问题

parent b5e8a66f
......@@ -62,7 +62,7 @@ const AssetItem = (props) => {
backgroundColor: colors[index%colors.length]
}}
>
{ _type==='' ? '无' : _type.slice(0, 1) }
{ _type==='' ? '无' : _type.slice(0, 2) }
</Avatar>
<div className='textOverflow' style={{ flex: 1 }}>
<Row className='mb-3'>
......
......@@ -54,6 +54,8 @@ const AssetTable = (props) =>{
}, [ keyword, pagination ])
const changeCurrent=(page,size)=>{
setCheckAllValue(false);
setSelectedKeys([]);
setPagination({ pageNum: page, pageSize: size });
}
......
import React, { useEffect, useState } from 'react';
import { Modal, Checkbox, Row, Col, Divider, Input, Typography, Form } from 'antd';
import { Modal, Checkbox, Row, Col, Divider, Input, Typography, Form, Switch } from 'antd';
import { dispatch } from '../../../../model';
......@@ -12,6 +12,7 @@ const UpdateTaskModal = (props) => {
const [ currentTask, setCurrentTask ] = useState({});
const [ keyword, setKeyword ] = useState('');
const [ confirmLoading, setConfirmLoading ] = useState(false);
const [ checkAllValue, setCheckAllValue ] = useState(false);
const [ form ] = Form.useForm();
......@@ -122,6 +123,7 @@ const UpdateTaskModal = (props) => {
setSchemas([]);
setSelectedSchemas([]);
setTaskSettings({});
setCheckAllValue(false);
form.resetFields();
}
......@@ -129,6 +131,18 @@ const UpdateTaskModal = (props) => {
setKeyword(e.target.value||'');
}
const onCheckAll =(checked)=>{
setCheckAllValue(checked);
if (checked) {
const _newSelectedSchemas = Array.from(new Set([...selectedSchemas, ...filterSchemas]));;
setSelectedSchemas(_newSelectedSchemas);
} else {
setSelectedSchemas(selectedSchemas.filter(schema=>!filterSchemas.includes(schema)));
}
}
const onCheckChange = (e) => {
if (e.target.checked) {
setSelectedSchemas([...selectedSchemas, e.target.value]);
......@@ -162,7 +176,7 @@ const UpdateTaskModal = (props) => {
confirmLoading={confirmLoading}
>
<Divider>schema信息</Divider>
<div className='mb-3'>
<div className='d-flex mb-3' style={{ alignItems: 'center' }}>
<span className='mr-3'>schema搜索:</span>
<Input
placeholder="请输入schema名称"
......@@ -171,6 +185,13 @@ const UpdateTaskModal = (props) => {
onChange={onSearchInputChange}
style={{ width: 230 }}
/>
<Switch
checkedChildren="全不选"
unCheckedChildren="全选"
checked={ checkAllValue }
onChange={ onCheckAll }
style={{ marginLeft: 'auto' }}
/>
</div>
<div style={{ maxHeight: 300, overflow: 'auto' }}>
<Row className='mb-3'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment