Commit 1af4b7b0 by zhaochengxiang

bug fix

parent 8f163018
......@@ -299,9 +299,11 @@ const FC = (props) => {
<Tooltip title={((selectedRows??[]).length === 0) ? '请先选择资产' : ''}>
<Button onClick={onExportClick} disabled={(selectedRows??[]).length === 0}>导出</Button>
</Tooltip>
<Tooltip title={((selectedRows??[]).length === 0) ? '请先选择资产' : ''}>
<Button onClick={onPublishClick} disabled={(selectedRows??[]).length === 0}>发布</Button>
</Tooltip>
{
isAdmin && <Tooltip title={((selectedRows??[]).length === 0) ? '请先选择资产' : ''}>
<Button onClick={onPublishClick} disabled={(selectedRows??[]).length === 0}>发布</Button>
</Tooltip>
}
<Tooltip title={((selectedRows??[]).length === 0) ? '请先选择资产' : ''}>
<Button onClick={onDeletesClick} disabled={(selectedRows??[]).length === 0}>删除</Button>
</Tooltip>
......
......@@ -8,6 +8,7 @@ import './ExchangeOwner.less';
const FC = ({ visible, id, onCancel }) => {
const [service, setService] = useState(undefined);
const [loading, setLoading] = useState(false);
const [loadingOwners, setLoadingOwners] = useState(false);
const [owners, setOwners] = useState(undefined);
const [currentOwner, setCurrentOwner] = useState(undefined);
......@@ -37,12 +38,15 @@ const FC = ({ visible, id, onCancel }) => {
}
const getOwners = () => {
setLoadingOwners(true);
dispatch({
type: 'pds.getOwners',
callback: (data) => {
setLoadingOwners(false);
setOwners(data);
},
error: () => {
setLoadingOwners(false);
}
})
}
......@@ -59,9 +63,9 @@ const FC = ({ visible, id, onCancel }) => {
}
}
const cancel = () => {
const cancel = (refresh = false) => {
reset();
onCancel?.();
onCancel?.(refresh);
}
const onOk = () => {
......@@ -76,7 +80,7 @@ const FC = ({ visible, id, onCancel }) => {
},
callback: () => {
setLoading(false);
onCancel?.(true);
cancel(true);
},
error: () => {
setLoading(false);
......@@ -87,12 +91,13 @@ const FC = ({ visible, id, onCancel }) => {
const reset = () => {
setService(undefined);
setLoading(false);
setLoadingOwners(false);
}
const footer = [
<Button
key="0"
onClick={cancel}
onClick={() => { cancel() }}
>
取消
</Button>,
......@@ -112,7 +117,7 @@ const FC = ({ visible, id, onCancel }) => {
title='更换管理人'
width={800}
destroyOnClose
onCancel={cancel}
onCancel={() => { cancel() }}
footer={footer}
>
<Spin spinning={loading}>
......@@ -131,7 +136,7 @@ const FC = ({ visible, id, onCancel }) => {
<Space>
<div>管理人:</div>
<div style={{ width: 200 }}>
<SelectUsers type='edit' users={owners} value={currentOwner} onChange={onOwnerChange} />
<SelectUsers type='edit' loading={loadingOwners} users={owners} value={currentOwner} onChange={onOwnerChange} />
</div>
</Space>
</Spin>
......
......@@ -8,7 +8,7 @@ const {Option} = Select
const SelectUser:React.FC=(props)=>{
const {value,onChange,users,type,loading, terms,publishedValue} = props
const {value,onChange,users,type,loading=false, terms,publishedValue} = props
const [searchValue, setSearchValue] = useState(undefined)
......
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