|
@@ -21,7 +21,7 @@
|
|
|
<!-- <el-table-column label="元器件应用" align="center" prop="applications"/>-->
|
|
|
<el-table-column label="元器件应用" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ truncatedApplications(scope.row.applications) }}
|
|
|
+ {{ scope.row.applications }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="相关推荐" align="center">
|
|
@@ -298,7 +298,15 @@ export default {
|
|
|
apps.push(one.usedBy)
|
|
|
}
|
|
|
// console.log("apps:")
|
|
|
- this.$set(this.componentList[i], 'applications', apps);
|
|
|
+
|
|
|
+ if (apps && apps.length > 3) {
|
|
|
+ this.$set(this.componentList[i], 'applications', apps.slice(0, 3).join(', ') + '...');
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$set(this.componentList[i], 'applications', apps.join(', '));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// this.componentList[i].applications = apps
|
|
|
|
|
|
})
|
|
@@ -334,13 +342,7 @@ export default {
|
|
|
this.pageviewTime.componentId = row.id
|
|
|
this.pageviewTime.usedBy = row.applications.toString()
|
|
|
},
|
|
|
- truncatedApplications(applications) {
|
|
|
- if (applications && applications.length > 3) {
|
|
|
- return applications.slice(0, 3).join(', ') + '...';
|
|
|
- } else {
|
|
|
- return applications.join(', ');
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
//监听元器件详情dialog关闭
|
|
|
closedialog(){
|
|
|
this.currentTime = Date.now()
|