Commit 0b401d06 by zhaochengxiang

标签

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