This commit is contained in:
2026-04-10 09:12:40 +08:00
parent 9c44064f51
commit 797ca258f8
9 changed files with 285 additions and 25 deletions

View File

@@ -13,12 +13,24 @@
v-for="(item, index) in chanFerForm"
:key="item.p_refer_id != null ? item.p_refer_id : `ref-row-${index}`"
class="ref-item-row"
:class="{ 'has-change': item.is_change == 1, 'is-repeat': item.is_repeat == 1 }"
:class="{ 'has-change': item.is_change == 1, 'is-repeat': item.is_repeat == 1, 'uncited-row': isUncitedReference(item) }"
>
<div class="ref-content-area">
<div v-if="item.refer_type == 'journal'" class="reference-item">
<b class="ref-number-prefix">{{ index + 1 }}.</b>
<template v-if="!isUncitedReference(item)">
<b class="ref-number-prefix">{{ index + 1 }}.</b>
</template>
<el-tag
v-else
class="uncited-tag"
size="mini"
type="info"
effect="plain"
style="margin-right: 8px"
>
{{ $t('wordCite.uncited') }}
</el-tag>
<span class="author-text">{{ item.author }} </span>
<span v-html="formatTitle(item.title)"></span>. <em class="journal-name">{{ item.joura }}</em
@@ -31,14 +43,38 @@
</div>
<div v-if="item.refer_type == 'book'" class="reference-item">
<b class="ref-number-prefix">{{ index + 1 }}.</b>
<template v-if="!isUncitedReference(item)">
<b class="ref-number-prefix">{{ index + 1 }}.</b>
</template>
<el-tag
v-else
class="uncited-tag"
size="mini"
type="info"
effect="plain"
style="margin-right: 8px"
>
{{ $t('wordCite.uncited') }}
</el-tag>
{{ item.author }} <span v-html="formatTitle(item.title)"></span>. {{ item.dateno }}.
<br />
<a class="doiLink" :href="item.isbn" target="_blank">{{ item.isbn }}</a>
</div>
<div v-if="item.refer_type == 'other'" class="reference-item">
<b class="ref-number-prefix">{{ index + 1 }}.</b>
<template v-if="!isUncitedReference(item)">
<b class="ref-number-prefix">{{ index + 1 }}.</b>
</template>
<el-tag
v-else
class="uncited-tag"
size="mini"
type="info"
effect="plain"
style="margin-right: 8px"
>
{{ $t('wordCite.uncited') }}
</el-tag>
<span v-html="formatTitle(item.refer_frag)"></span>
</div>
</div>
@@ -325,6 +361,11 @@ export default {
type: Array,
required: true
},
/** 父组件传入的正文首次出现顺序(被引用的 p_refer_id 列表);不在其中的视为“未引用” */
citeOrderFromParent: {
type: Array,
default: () => null
},
gridData: {
type: String,
default: ''
@@ -340,6 +381,13 @@ export default {
}
},
methods: {
isUncitedReference(row) {
const id = row && row.p_refer_id != null ? String(row.p_refer_id) : '';
if (!id) return false;
const order = Array.isArray(this.citeOrderFromParent) ? this.citeOrderFromParent.map(String) : [];
if (!order.length) return false;
return !order.includes(id);
},
/** 与当前 chanFerForm 数组顺序一致:行内 index 置为 1-based 序号(排序/正文重排后同步) */
syncReferenceRowIndices() {
const list = this.chanFerForm;
@@ -1961,6 +2009,25 @@ export default {
background-color: #f9fbff;
}
.uncited-row .ref-content-area,
.uncited-row .reference-item,
.uncited-row .author-text,
.uncited-row em,
.uncited-row span {
color: #909399 !important;
}
.uncited-row .doiLink,
.uncited-row .doi-link-text {
color: #909399 !important;
}
::v-deep .uncited-tag.el-tag {
background-color: #f56c6c !important;
border-color: #f56c6c !important;
color: #fff !important;
}
/* 序号与状态 */
.ref-index-area {
width: 50px;