feat: 为项目标题添加可点击链接功能

This commit is contained in:
dmy
2026-01-20 23:47:51 +08:00
parent bdc62a2975
commit 4bace565e4
4 changed files with 115 additions and 6 deletions

View File

@@ -26,7 +26,20 @@
</el-icon> </el-icon>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="title" label="Title" min-width="150" /> <el-table-column label="Title" min-width="150">
<template #default="scope">
<a
v-if="scope.row.url"
:href="scope.row.url"
target="_blank"
class="project-link"
@click.stop
>
{{ scope.row.title }}
</a>
<span v-else>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column prop="source" label="Source" min-width="100" /> <el-table-column prop="source" label="Source" min-width="100" />
<el-table-column prop="publishDate" label="Date" width="95"> <el-table-column prop="publishDate" label="Date" width="95">
<template #default="scope">{{ formatDate(scope.row.publishDate) }}</template> <template #default="scope">{{ formatDate(scope.row.publishDate) }}</template>
@@ -126,6 +139,17 @@ const togglePin = async (item: any) => {
width: 100%; width: 100%;
} }
.project-link {
color: var(--el-text-color-primary);
text-decoration: none;
cursor: pointer;
transition: color 0.2s;
}
.project-link:hover {
color: var(--el-color-primary);
}
.pagination { .pagination {
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;

View File

@@ -40,7 +40,20 @@
</el-icon> </el-icon>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="title" label="项目名称" min-width="150" /> <el-table-column label="项目名称" min-width="150">
<template #default="scope">
<a
v-if="scope.row.url"
:href="scope.row.url"
target="_blank"
class="project-link"
@click.stop
>
{{ scope.row.title }}
</a>
<span v-else>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column prop="source" label="来源" min-width="80" /> <el-table-column prop="source" label="来源" min-width="80" />
<el-table-column prop="publishDate" label="发布日期" width="95"> <el-table-column prop="publishDate" label="发布日期" width="95">
<template #default="scope"> <template #default="scope">
@@ -102,8 +115,21 @@
</div> </div>
<div v-else> <div v-else>
<el-table :data="bidsByDateRange" style="width: 100%" size="small" class="bids-table"> <el-table :data="bidsByDateRange" style="width: 100%" size="small" class="bids-table">
<el-table-column prop="title" label="项目名称" min-width="150" /> <el-table-column label="项目名称" min-width="150">
<el-table-column prop="source" label="来源" min-width="80" /> <template #default="scope">
<a
v-if="scope.row.url"
:href="scope.row.url"
target="_blank"
class="project-link"
@click.stop
>
{{ scope.row.title }}
</a>
<span v-else>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column prop="source" label="来源" width="80" />
<el-table-column prop="publishDate" label="发布日期" width="95"> <el-table-column prop="publishDate" label="发布日期" width="95">
<template #default="scope"> <template #default="scope">
{{ formatDate(scope.row.publishDate) }} {{ formatDate(scope.row.publishDate) }}
@@ -416,6 +442,17 @@ const togglePin = async (item: AIRecommendation) => {
width: 100%; width: 100%;
} }
.project-link {
color: var(--el-text-color-primary);
text-decoration: none;
cursor: pointer;
transition: color 0.2s;
}
.project-link:hover {
color: var(--el-color-primary);
}
a { a {
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;

View File

@@ -64,7 +64,20 @@
</el-icon> </el-icon>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="title" label="Title" min-width="150" /> <el-table-column label="Title" min-width="150">
<template #default="scope">
<a
v-if="scope.row.url"
:href="scope.row.url"
target="_blank"
class="project-link"
@click.stop
>
{{ scope.row.title }}
</a>
<span v-else>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column prop="source" label="Source" min-width="90" /> <el-table-column prop="source" label="Source" min-width="90" />
<el-table-column prop="publishDate" label="Date" width="100"> <el-table-column prop="publishDate" label="Date" width="100">
<template #default="scope">{{ formatDate(scope.row.publishDate) }}</template> <template #default="scope">{{ formatDate(scope.row.publishDate) }}</template>
@@ -372,6 +385,17 @@ if (!dateRange.value) {
width: 100%; width: 100%;
} }
.project-link {
color: var(--el-text-color-primary);
text-decoration: none;
cursor: pointer;
transition: color 0.2s;
}
.project-link:hover {
color: var(--el-color-primary);
}
.card-header { .card-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@@ -30,7 +30,20 @@
</el-icon> </el-icon>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="title" label="项目名称" min-width="150" /> <el-table-column label="项目名称" min-width="150">
<template #default="scope">
<a
v-if="scope.row.url"
:href="scope.row.url"
target="_blank"
class="project-link"
@click.stop
>
{{ scope.row.title }}
</a>
<span v-else>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column prop="source" label="来源" min-width="100" /> <el-table-column prop="source" label="来源" min-width="100" />
<el-table-column prop="publishDate" label="发布日期" width="95"> <el-table-column prop="publishDate" label="发布日期" width="95">
<template #default="scope"> <template #default="scope">
@@ -117,6 +130,17 @@ defineExpose({
width: 100%; width: 100%;
} }
.project-link {
color: var(--el-text-color-primary);
text-decoration: none;
cursor: pointer;
transition: color 0.2s;
}
.project-link:hover {
color: var(--el-color-primary);
}
a { a {
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;