Commit 0b401d06 by zhaochengxiang

标签

parent 0392fd9d
...@@ -472,15 +472,19 @@ const AssetAction = (props) => { ...@@ -472,15 +472,19 @@ const AssetAction = (props) => {
} }
</div> </div>
</Descriptions.Item> </Descriptions.Item>
{/* <Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 15 }}> <Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 15 }}>
<AppContext.Consumer> <AppContext.Consumer>
{ {
value => { value => {
if (readOnly) {
return <Tag isAdmin={false} styleType='complex' id={id} creator={value?.user?.userName||''} onAssetTag={onAssetTag} />
}
return (currentAction==='add'||currentAction==='edit')?<Tag styleType='complex' id={id} creator={value?.user?.userName||''} onAssetTag={onAssetTag} />:<Tag id={id} creator={value?.user?.userName||''} /> return (currentAction==='add'||currentAction==='edit')?<Tag styleType='complex' id={id} creator={value?.user?.userName||''} onAssetTag={onAssetTag} />:<Tag id={id} creator={value?.user?.userName||''} />
} }
} }
</AppContext.Consumer> </AppContext.Consumer>
</Descriptions.Item> */} </Descriptions.Item>
{/* <Descriptions.Item {/* <Descriptions.Item
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>关联关系</div>} label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>关联关系</div>}
style={{ paddingBottom: 0 }} style={{ paddingBottom: 0 }}
......
...@@ -34,7 +34,7 @@ const ClassifySelect = ({ value = '', data = [], onChange, ...restProps }) => { ...@@ -34,7 +34,7 @@ const ClassifySelect = ({ value = '', data = [], onChange, ...restProps }) => {
} }
const AddTagModal = (props) => { const AddTagModal = (props) => {
const { visible, onCancel, id, type, creator, onAssetTag } = props; const { visible, onCancel, id, type, creator, onAssetTag, isAdmin } = props;
const [ step, setStep ] = useState(0); const [ step, setStep ] = useState(0);
const [ keyword, setKeyword ] = useState(''); const [ keyword, setKeyword ] = useState('');
...@@ -65,11 +65,12 @@ const AddTagModal = (props) => { ...@@ -65,11 +65,12 @@ const AddTagModal = (props) => {
creator, creator,
}, },
callback: data => { callback: data => {
setMatchTags(data||[]); const filterData = (data||[]).filter(item => isAdmin?item.type==='public':item.type==='private');
setMatchTags(filterData||[]);
let tagExsit = false, _selectTag = null; let tagExsit = false, _selectTag = null;
const _options = []; const _options = [];
(data||[]).forEach(item => { (filterData||[]).forEach(item => {
_options.push({ _options.push({
value: item.tagId, value: item.tagId,
label: ( label: (
...@@ -101,7 +102,7 @@ const AddTagModal = (props) => { ...@@ -101,7 +102,7 @@ const AddTagModal = (props) => {
}) })
if (!tagExsit) { if (!tagExsit && !isAdmin) {
_options.push({ _options.push({
value: -1, value: -1,
label: ( label: (
...@@ -400,14 +401,14 @@ const AddTagModal = (props) => { ...@@ -400,14 +401,14 @@ const AddTagModal = (props) => {
{ {
step === 0 && <span> step === 0 && <span>
<AutoComplete <AutoComplete
style={{ width: '80%', marginRight: 5 }} style={{ width: '100%' }}
allowClear allowClear
value={keyword} value={keyword}
onChange={onKeywordChange} onChange={onKeywordChange}
options={options} options={options}
onSelect={onSelect} onSelect={onSelect}
/> />
<Checkbox onChange={onOnlyTagChange} checked={onlyTag}>仅打标签</Checkbox> {/* <Checkbox onChange={onOnlyTagChange} checked={onlyTag}>仅打标签</Checkbox> */}
</span> </span>
} }
{ {
......
...@@ -6,7 +6,7 @@ import AddTagModal from './Component/AddTagModal'; ...@@ -6,7 +6,7 @@ import AddTagModal from './Component/AddTagModal';
import { dispatch } from '../../../model'; import { dispatch } from '../../../model';
const TagColumn = (props) => { const TagColumn = (props) => {
const { id, type = 'dataAsset', creator = '', styleType = 'simple', onAssetTag } = props; const { id, type = 'dataAsset', creator = '', styleType = 'simple', onAssetTag, isAdmin = true } = props;
const [ ownTags, setOwnTags ] = useState([]); const [ ownTags, setOwnTags ] = useState([]);
const [ addTagModalVisible, setAddTagModalVisible ] = useState(false); const [ addTagModalVisible, setAddTagModalVisible ] = useState(false);
...@@ -42,7 +42,8 @@ const TagColumn = (props) => { ...@@ -42,7 +42,8 @@ const TagColumn = (props) => {
resourceIds: id, resourceIds: id,
type, type,
creator, creator,
includeAll: true includeAll: true,
includePrivate: !isAdmin
} }
}, },
callback: data => { callback: data => {
...@@ -124,7 +125,7 @@ const TagColumn = (props) => { ...@@ -124,7 +125,7 @@ const TagColumn = (props) => {
return ( return (
<Tag <Tag
key={index} key={index}
closable closable={item.type==='private'}
onClose={e => { onClose={e => {
e.preventDefault(); e.preventDefault();
handleClose(index); handleClose(index);
...@@ -155,6 +156,7 @@ const TagColumn = (props) => { ...@@ -155,6 +156,7 @@ const TagColumn = (props) => {
id={id} id={id}
type={type} type={type}
creator={creator} creator={creator}
isAdmin={isAdmin}
onCancel={onAddTagModalCancel} onCancel={onAddTagModalCancel}
onAssetTag={onAssetTagCancel} onAssetTag={onAssetTagCancel}
/> />
......
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