|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<div
|
|
|
class="article-item"
|
|
|
- :class="{ 'style-for-gray': config.gray, 'style-for-table': config.table }"
|
|
|
+ :class="{ 'style-for-gray': config.gray, 'style-for-table': config.table, 'style-for-push': config.push }"
|
|
|
>
|
|
|
- <div class="flex-center">
|
|
|
+ <div :class="{'flex-center': !config.push}">
|
|
|
<input
|
|
|
v-if="config.collect"
|
|
|
@change="changeCheck($event)"
|
|
@@ -17,7 +17,8 @@
|
|
|
<div class="content-item">
|
|
|
<div
|
|
|
v-html="calcTitle"
|
|
|
- class="a-i-left ellipsis visited-hd"
|
|
|
+ class="a-i-left visited-hd"
|
|
|
+ :class="config.push ? 'ellipsis-3' : 'ellipsis'"
|
|
|
@click="onClick"
|
|
|
></div>
|
|
|
</div>
|
|
@@ -31,6 +32,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div v-if="config.push && article.detail" class="a-i-detail ellipsis" v-html="calcDetail"></div>
|
|
|
<div class="a-i-right">
|
|
|
<div class="tags">
|
|
|
<span
|
|
@@ -237,7 +239,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { Tag, Popover, Table, TableColumn } from 'element-ui'
|
|
|
-import { moneyUnit, dateFromNow, replaceKeyword } from '@/utils/'
|
|
|
+import { moneyUnit, dateFromNow, replaceKeyword, extractKeywords } from '@/utils/'
|
|
|
import { mapGetters, mapState } from 'vuex'
|
|
|
import { getPowerUrl } from '@/utils/power/redirect'
|
|
|
export default {
|
|
@@ -271,7 +273,8 @@ export default {
|
|
|
return {
|
|
|
gray: false,
|
|
|
table: false,
|
|
|
- collect: false
|
|
|
+ collect: false,
|
|
|
+ push: false
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -286,7 +289,9 @@ export default {
|
|
|
budget: '', // 金额
|
|
|
publishTime: 0, // 时间
|
|
|
matchKeys: [], // 高亮的关键词
|
|
|
- ca_fileExists: false
|
|
|
+ ca_fileExists: false,
|
|
|
+ detail: '', // 正文
|
|
|
+ filetext_search: false // 关键词在附件中
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -325,8 +330,46 @@ export default {
|
|
|
this.article.matchKeys,
|
|
|
['<span class="highlight-text">', '</span>']
|
|
|
)
|
|
|
- return `${this.index}. ${hightLightedTitle}`
|
|
|
+ if (this.article.filetext_search) {
|
|
|
+ return `${this.index}. ${hightLightedTitle}${this.calcFileText}`
|
|
|
+ } else {
|
|
|
+ return `${this.index}. ${hightLightedTitle}`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理正文显示
|
|
|
+ calcDetail() {
|
|
|
+ const extractDetail = extractKeywords(this.article.detail, this.article.matchKeys)
|
|
|
+ return replaceKeyword(
|
|
|
+ extractDetail,
|
|
|
+ this.article.matchKeys,
|
|
|
+ ['<span class="highlight-text">', '</span>']
|
|
|
+ )
|
|
|
+ },
|
|
|
+ // 处理关键词在附件中
|
|
|
+ calcFileText() {
|
|
|
+ const inFile = this.article.filetext_search
|
|
|
+ const keywords = this.article.matchKeys
|
|
|
+ if (inFile) {
|
|
|
+ const keyword = keywords[0]
|
|
|
+ if (keywords.length > 3) {
|
|
|
+ return `(<span class="highlight-text">${keyword.substring(0,3)}</span>...在附件中)`
|
|
|
+ } else {
|
|
|
+ return `(<span class="highlight-text">${keyword}</span>在附件中)`
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理关键词在附件中
|
|
|
+ calcFiletext_search() {
|
|
|
+ const extractFiletext = extractKeywords(this.article.filetext_search, this.article.matchKeys,)
|
|
|
+ return replaceKeyword(
|
|
|
+ extractFiletext,
|
|
|
+ this.article.matchKeys,
|
|
|
+ ['<span class="highlight-text">', '</span>']
|
|
|
+ )
|
|
|
},
|
|
|
+ // 处理关键词在附件中
|
|
|
showDetailModel() {
|
|
|
const isOldVip = this.isVipBefore
|
|
|
const isMember = this.bigmember
|
|
@@ -550,7 +593,8 @@ $border-color: #ececec;
|
|
|
line-height: 24px;
|
|
|
}
|
|
|
.a-i-left {
|
|
|
- display: inline-block;
|
|
|
+ // display: inline-block;
|
|
|
+ font-size: 16px;
|
|
|
margin-right: 60px;
|
|
|
cursor: pointer;
|
|
|
// max-width: 650px;
|
|
@@ -568,6 +612,13 @@ $border-color: #ececec;
|
|
|
.a-i-right {
|
|
|
padding: 8px 0 0 30px;
|
|
|
}
|
|
|
+ .a-i-detail{
|
|
|
+ width: calc(100% - 84px);
|
|
|
+ padding: 6px 0 0 30px;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 22px;
|
|
|
+ color: #686868;
|
|
|
+ }
|
|
|
.time-container {
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
@@ -617,6 +668,20 @@ $border-color: #ececec;
|
|
|
line-height: 18px;
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
+ &.style-for-push{
|
|
|
+ .custom-checkbox {
|
|
|
+ margin-top: 5px;
|
|
|
+ }
|
|
|
+ .a-i-left{
|
|
|
+ font-size: 15px;
|
|
|
+ }
|
|
|
+ .time-container{
|
|
|
+ align-items: unset;
|
|
|
+ }
|
|
|
+ .time-text{
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.right-actions {
|
|
|
display: flex;
|