Commit aedda061 by zhaochengxiang

资产管理页面调整

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