Commit 5a84e083 by 胡悦

修复命中文本样式

1 parent 1979b544
...@@ -24,12 +24,18 @@ ...@@ -24,12 +24,18 @@
{{ scope.row.score }}/{{ scope.row.sumScore }} {{ scope.row.score }}/{{ scope.row.sumScore }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="scriptRec" label="命中文本" align="center"> <el-table-column prop="processedScriptRec" label="命中文本" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip :content="scope.row.processedScriptRec" placement="top" effect="light"> <template v-if="scope.row.processedScriptRec">
<div class="text-ellipsis">{{ scope.row.processedScriptRec }}</div> <el-tooltip placement="top" effect="light">
<div slot="content" v-html="scope.row.processedScriptRec"></div>
<div class="text-ellipsis" v-html="scope.row.processedScriptRec"></div>
</el-tooltip> </el-tooltip>
</template> </template>
<template v-else>
<div class="text-ellipsis">暂无命中文本</div>
</template>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -50,10 +56,20 @@ export default { ...@@ -50,10 +56,20 @@ export default {
}, },
computed: { computed: {
processedQualityList() { processedQualityList() {
return this.qualityData.map(item => ({ return this.qualityData.map(item => {
let hitTextArr = ''
try {
hitTextArr = JSON.parse(item.hitText);
} catch (e) {
hitTextArr = '';
}
return {
...item, ...item,
processedScriptRec: item.scriptRec?.replace(/[\[\]"]/g, '') || '' processedScriptRec: (hitTextArr && hitTextArr.length)
})) ? hitTextArr.map(text => text.replace(/\n/g, '<br>')).join('')
: ''
}
})
} }
}, },
mounted() { mounted() {
...@@ -114,4 +130,13 @@ export default { ...@@ -114,4 +130,13 @@ export default {
} }
} }
} }
.text-ellipsis {
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/* 定义文本的行数 */
overflow: hidden;
text-overflow: ellipsis;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!