|
@@ -432,8 +432,8 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
|
|
|
render: ({ row }: { row: any }) => {
|
|
|
if (!row.competency_tags || row.competency_tags.length === 0) return <span>-</span>;
|
|
|
|
|
|
- const displayTags = row.competency_tags.slice(0, 2); // 只取前两个标签
|
|
|
- const remainingCount = row.competency_tags.length - 2; // 计算剩余标签数量
|
|
|
+ const displayTags = row.competency_tags.slice(0, 2);
|
|
|
+ const remainingCount = row.competency_tags.length - 2;
|
|
|
|
|
|
return (
|
|
|
<div style="display: flex; gap: 4px; align-items: center;">
|
|
@@ -454,22 +454,26 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
|
|
|
placement="top"
|
|
|
effect="light"
|
|
|
popper-class="tag-tooltip"
|
|
|
- content={
|
|
|
- <div>
|
|
|
- <div style="font-weight: bold; margin-bottom: 5px">剩余{remainingCount}个标签:</div>
|
|
|
- {row.competency_tags.slice(2).map((tag: any) => (
|
|
|
- <div key={tag.id} style="margin: 3px 0">{tag.name}</div>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
- }
|
|
|
>
|
|
|
- <el-tag
|
|
|
- type="info"
|
|
|
- effect="plain"
|
|
|
- size="mini"
|
|
|
- >
|
|
|
- +{remainingCount}
|
|
|
- </el-tag>
|
|
|
+ {{
|
|
|
+ default: () => (
|
|
|
+ <el-tag
|
|
|
+ type="info"
|
|
|
+ effect="plain"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ +{remainingCount}
|
|
|
+ </el-tag>
|
|
|
+ ),
|
|
|
+ content: () => (
|
|
|
+ <div>
|
|
|
+ <div style="font-weight: bold; margin-bottom: 5px">剩余{remainingCount}个标签:</div>
|
|
|
+ {row.competency_tags.slice(2).map((tag: any) => (
|
|
|
+ <div key={tag.id} style="margin: 3px 0">{tag.name}</div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
</el-tooltip>
|
|
|
)}
|
|
|
</div>
|
|
@@ -913,22 +917,26 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
|
|
|
placement="top"
|
|
|
effect="light"
|
|
|
popper-class="tag-tooltip"
|
|
|
- content={
|
|
|
- <div>
|
|
|
- <div style="font-weight: bold; margin-bottom: 5px">剩余{remainingCount}个标签:</div>
|
|
|
- {row.tags.slice(2).map((tag: any) => (
|
|
|
- <div key={tag.id} style="margin: 3px 0">{tag.name}</div>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
- }
|
|
|
>
|
|
|
- <el-tag
|
|
|
- type="info"
|
|
|
- effect="plain"
|
|
|
- size="mini"
|
|
|
- >
|
|
|
- +{remainingCount}
|
|
|
- </el-tag>
|
|
|
+ {{
|
|
|
+ default: () => (
|
|
|
+ <el-tag
|
|
|
+ type="info"
|
|
|
+ effect="plain"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ +{remainingCount}
|
|
|
+ </el-tag>
|
|
|
+ ),
|
|
|
+ content: () => (
|
|
|
+ <div>
|
|
|
+ <div style="font-weight: bold; margin-bottom: 5px">剩余{remainingCount}个标签:</div>
|
|
|
+ {row.tags.slice(2).map((tag: any) => (
|
|
|
+ <div key={tag.id} style="margin: 3px 0">{tag.name}</div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
</el-tooltip>
|
|
|
)}
|
|
|
</div>
|