Commit aedda061 by zhaochengxiang

资产管理页面调整

parent c657a0f2
@import '../../../../variables.less'; @import '../../../../variables.less';
.asset-list { .asset-list {
.yy-list-item-action {
text-align: right;
}
.yy-card-head-title { .yy-card-head-title {
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
padding: 0; padding: 0;
} }
.yy-list-vertical .yy-list-item-action > li {
padding: 0 ; .highlight-row {
} .yy-table-cell {
.data-asset-spin { background-color: #e7f7ff !important;
height: calc(100vh - @header-height - @pm-4 - 53px - 52px + 1px);
}
.yy-checkbox-group {
height: calc(100vh - @header-height - @pm-4 - 53px - 52px - 53px) !important;
overflow: auto !important;
}
.yy-divider-horizontal {
margin: 0 !important;
}
.yy-list-vertical {
.yy-list-item-meta, .yy-list-item-meta-title {
margin-bottom: 0 !important;
}
} }
.yy-list-item {
padding: 0 !important;
} }
} }
\ No newline at end of file
...@@ -76,6 +76,7 @@ const AssetTree = (props) => { ...@@ -76,6 +76,7 @@ const AssetTree = (props) => {
}, },
callback: data => { callback: data => {
setCheckedKeys(data.dirIds||[]); setCheckedKeys(data.dirIds||[]);
onCheck && onCheck(data.dirIds||[]);
}, },
}) })
} }
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Row, Col, Checkbox, Typography, Space, Button, Switch } from 'antd'; import { Row, Col, Checkbox, Typography, Button, Switch, Modal } from 'antd';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import './FilterElement.less'; import './FilterElementModal.less';
const FilterElement = (props) => { const FilterElementModal = (props) => {
const { onCancel } = props; const { visible, onCancel } = props;
const [ elements, setElements ] = useState([]); const [ elements, setElements ] = useState([]);
const [ typesOfElements, setTypesOfElements ] = useState([]); const [ typesOfElements, setTypesOfElements ] = useState([]);
const [ selectedKeys, setSelectedKeys ] = useState([]); const [ selectedKeys, setSelectedKeys ] = useState([]);
const [ confirmLoading, setConfirmLoading ] = useState(false);
useEffect(() => { useEffect(() => {
...@@ -87,19 +88,56 @@ const FilterElement = (props) => { ...@@ -87,19 +88,56 @@ const FilterElement = (props) => {
const onOk = () => { const onOk = () => {
setConfirmLoading(true);
dispatch({ dispatch({
type: 'assetmanage.setupFilterElementIds', type: 'assetmanage.setupFilterElementIds',
payload: { payload: {
data: selectedKeys data: selectedKeys
}, },
callback: () => { callback: () => {
onCancel && onCancel(false, true); reset();
onCancel && onCancel(true);
},
error: () => {
reset();
} }
}) })
} }
const cancel = () => {
reset();
onCancel && onCancel();
}
const reset = () => {
setConfirmLoading(false);
}
return ( return (
<div className='filter-element' style={{ width: 500 }}> <Modal
forceRender
visible={visible}
title='资产要素过滤'
width={520}
onCancel={cancel}
footer={[
<Button
key="0"
onClick={cancel}
>
取消
</Button>,
<Button
key="1"
type="primary"
onClick={onOk}
loading={confirmLoading}
>
确定
</Button>,
]}
>
<div className='d-flex'> <div className='d-flex'>
<Switch <Switch
checkedChildren="全不选" checkedChildren="全不选"
...@@ -108,13 +146,13 @@ const FilterElement = (props) => { ...@@ -108,13 +146,13 @@ const FilterElement = (props) => {
style={{ marginLeft: 'auto' }} style={{ marginLeft: 'auto' }}
/> />
</div> </div>
<div style={{ maxHeight: 450, overflow: 'auto' }}> <div className='mt-3' style={{ maxHeight: 450, overflow: 'auto' }}>
{ {
(typesOfElements||[]).map((typeOfElements, index) => { (typesOfElements||[]).map((typeOfElements, index) => {
const _type = typeOfElements.type||''; const _type = typeOfElements.type||'';
return ( return (
<div> <div key={index}>
<div className='flex' style={{ alignItems: 'center', padding: '15px 0' }}> <div className='flex' style={{ alignItems: 'center', padding: '15px 0' }}>
<div style={{ width: 3, height: 14, backgroundColor: '#0069AC', marginRight: 5 }} /> <div style={{ width: 3, height: 14, backgroundColor: '#0069AC', marginRight: 5 }} />
<span style={{ fontWeight: 'bold', color: '#464646' }}>{_type||''}</span> <span style={{ fontWeight: 'bold', color: '#464646' }}>{_type||''}</span>
...@@ -141,16 +179,8 @@ const FilterElement = (props) => { ...@@ -141,16 +179,8 @@ const FilterElement = (props) => {
}) })
} }
</div> </div>
<div className='mt-3 d-flex pt-3' style={{ borderTop: '1px solid rgba(0, 0, 0, 0.06)' }} > </Modal>
<Space style={{ marginLeft: 'auto' }}>
<Button onClick={() => {
onCancel && onCancel();
}}>取消</Button>
<Button type='primary' onClick={onOk} >确定</Button>
</Space>
</div>
</div>
); );
} }
export default FilterElement; export default FilterElementModal;
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ const MetadataInfo = ({ value = '', config = true }) => { ...@@ -19,7 +19,7 @@ const MetadataInfo = ({ value = '', config = true }) => {
value => <span> value => <span>
{ {
(typeof metadata==='string') ? <span style={{ marginRight: 5 }}>{metadata||''}</span> : <a onClick={() => { (typeof metadata==='string') ? <span style={{ marginRight: 5 }}>{metadata||''}</span> : <a onClick={() => {
value?.setGlobalState({ value?.setGlobalState && value?.setGlobalState({
message: 'data-govern-show-metadata-message', message: 'data-govern-show-metadata-message',
data: metadata data: metadata
}) })
......
...@@ -7,7 +7,7 @@ import { showMessage } from '../../../../util'; ...@@ -7,7 +7,7 @@ import { showMessage } from '../../../../util';
const AssetMount = (props) => { const AssetMount = (props) => {
const { onCancel, visible, id, recycleIds, refrence = 'asset-manage' } = props; const { onCancel, visible, ids, refrence = 'asset-manage' } = props;
const [ dirIds, setDirIds ] = useState([]); const [ dirIds, setDirIds ] = useState([]);
const [ confirmLoading, setConfirmLoading ] = useState(false); const [ confirmLoading, setConfirmLoading ] = useState(false);
...@@ -28,7 +28,7 @@ const AssetMount = (props) => { ...@@ -28,7 +28,7 @@ const AssetMount = (props) => {
params: { params: {
dirId: dirIds.join(","), dirId: dirIds.join(","),
}, },
data: (refrence==='asset-recycle') ? recycleIds : [id||''] data: ids
}, },
callback: data => { callback: data => {
setConfirmLoading(false); setConfirmLoading(false);
...@@ -48,7 +48,7 @@ const AssetMount = (props) => { ...@@ -48,7 +48,7 @@ const AssetMount = (props) => {
return( return(
<Modal <Modal
title='挂载详情' title='变更目录详情'
visible={ visible } visible={ visible }
width={ 400 } width={ 400 }
confirmLoading={ confirmLoading } confirmLoading={ confirmLoading }
...@@ -63,7 +63,7 @@ const AssetMount = (props) => { ...@@ -63,7 +63,7 @@ const AssetMount = (props) => {
checkable={true} checkable={true}
showCustom={false} showCustom={false}
onCheck={onCheck} onCheck={onCheck}
tableId={refrence==='asset-manage'?id:''} tableId={(refrence==='asset-manage'&&(ids||[].length>0))?ids[0]:''}
reference='mount' reference='mount'
{...props} {...props}
/> />
......
...@@ -248,7 +248,7 @@ const AssetRecycle = (props) => { ...@@ -248,7 +248,7 @@ const AssetRecycle = (props) => {
<AssetMount <AssetMount
refrence='asset-recycle' refrence='asset-recycle'
visible={ assetMountVisible } visible={ assetMountVisible }
recycleIds={ batchMount ? selectedRowKeys : [ currentAssetId ] } ids={ batchMount ? selectedRowKeys : [ currentAssetId ] }
onCancel={ onAssetMountCancel } onCancel={ onAssetMountCancel }
{...props} {...props}
/> />
......
...@@ -753,7 +753,7 @@ const ImportActionTable = (props) => { ...@@ -753,7 +753,7 @@ const ImportActionTable = (props) => {
} }
{ {
record?.isPossibleNewTerm?.possible && <Typography.Link className='mr-3' onClick={() => { record?.isPossibleNewTerm?.possible && <Typography.Link className='mr-3' onClick={() => {
value?.setGlobalState({ value?.setGlobalState && value?.setGlobalState({
message: 'data-govern-show-standard-create', message: 'data-govern-show-standard-create',
data: { data: {
column: record, column: record,
......
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