fix: 修复引用分段详情弹框和执行详情里的文档名称不能点的缺陷

--bug=1049682 --user=王孝刚 【应用】引用分段详情弹框和执行详情里的文档名称不能点 https://www.tapd.cn/57709429/s/1619877
This commit is contained in:
wxg0103 2024-11-28 14:37:16 +08:00 committed by wxg
parent c3d92e8dc8
commit be1ddeb252
2 changed files with 38 additions and 12 deletions

View File

@ -20,7 +20,12 @@
</div> </div>
<div class="ml-8" v-else> <div class="ml-8" v-else>
<a <a
@click="openLink(item.source_url)" :href="
item.source_url && !item.source_url.endsWith('/')
? item.source_url + '/'
: item.source_url
"
target="_blank"
class="ellipsis" class="ellipsis"
:title="item?.document_name?.trim()" :title="item?.document_name?.trim()"
> >
@ -98,14 +103,6 @@ const uniqueParagraphList = computed(() => {
}) || [] }) || []
) )
}) })
function openLink(url: string) {
// url//
if (url && !url.endsWith('/')) {
url += '/'
}
window.open(url, '_blank')
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.source_dataset-button { .source_dataset-button {

View File

@ -20,9 +20,25 @@
<el-text class="flex align-center" style="width: 70%"> <el-text class="flex align-center" style="width: 70%">
<img :src="getImgUrl(data?.document_name?.trim())" alt="" width="20" class="mr-4" /> <img :src="getImgUrl(data?.document_name?.trim())" alt="" width="20" class="mr-4" />
<span class="ellipsis" :title="data?.document_name?.trim()"> <template v-if="meta?.source_url">
{{ data?.document_name.trim() }}</span <a
> :href="
meta?.source_url && !meta?.source_url.endsWith('/')
? meta?.source_url + '/'
: meta?.source_url
"
target="_blank"
class="ellipsis"
:title="data?.document_name?.trim()"
>
{{ data?.document_name?.trim() }}
</a>
</template>
<template v-else>
<span class="ellipsis" :title="data?.document_name?.trim()">
{{ data?.document_name?.trim() }}
</span>
</template>
</el-text> </el-text>
<div class="flex align-center" style="line-height: 32px"> <div class="flex align-center" style="line-height: 32px">
<AppAvatar class="mr-8 avatar-blue" shape="square" :size="18"> <AppAvatar class="mr-8 avatar-blue" shape="square" :size="18">
@ -37,6 +53,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getImgUrl } from '@/utils/utils' import { getImgUrl } from '@/utils/utils'
import { computed } from 'vue'
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
@ -47,11 +65,22 @@ const props = defineProps({
default: 0 default: 0
} }
}) })
const isMetaObject = computed(() => typeof props.data.meta === 'object')
const parsedMeta = computed(() => {
try {
return JSON.parse(props.data.meta)
} catch (e) {
return {}
}
})
const meta = computed(() => (isMetaObject.value ? props.data.meta : parsedMeta.value))
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.paragraph-source-card-height { .paragraph-source-card-height {
height: 260px; height: 260px;
} }
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.paragraph-source-card-height { .paragraph-source-card-height {
height: 285px; height: 285px;