feat: 完善标签编辑
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
Typography
|
||||
} from '@douyinfe/semi-ui';
|
||||
import EditChannel from '../pages/Channel/EditChannel';
|
||||
import { IconTreeTriangleDown } from '@douyinfe/semi-icons';
|
||||
import { IconList, IconTreeTriangleDown } from '@douyinfe/semi-icons';
|
||||
import { loadChannelModels } from './utils.js';
|
||||
import EditTagModal from '../pages/Channel/EditTagModal.js';
|
||||
|
||||
@@ -56,6 +56,20 @@ function renderType(type) {
|
||||
);
|
||||
}
|
||||
|
||||
function renderTagType(type) {
|
||||
return (
|
||||
<Tag
|
||||
color='light-blue'
|
||||
prefixIcon={<IconList />}
|
||||
size='large'
|
||||
shape='circle'
|
||||
type='light'
|
||||
>
|
||||
标签聚合
|
||||
</Tag>
|
||||
);
|
||||
}
|
||||
|
||||
const ChannelsTable = () => {
|
||||
const columns = [
|
||||
// {
|
||||
@@ -90,7 +104,11 @@ const ChannelsTable = () => {
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
render: (text, record, index) => {
|
||||
return <div>{renderType(text)}</div>;
|
||||
if (record.children === undefined) {
|
||||
return <>{renderType(text)}</>;
|
||||
} else {
|
||||
return <>{renderTagType(0)}</>;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -441,7 +459,8 @@ const ChannelsTable = () => {
|
||||
let channelGroupsStr = channels[i].group;
|
||||
channelGroupsStr.split(',').forEach((item, index) => {
|
||||
if (tagChannelDates.group.indexOf(item) === -1) {
|
||||
tagChannelDates.group += item + ',';
|
||||
// join
|
||||
tagChannelDates.group += ',' + item;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user