瀏覽代碼

feat: 处理新需求

zhangyuhan 1 年之前
父節點
當前提交
d4cd5acfb3
共有 1 個文件被更改,包括 14 次插入10 次删除
  1. 14 10
      apps/bigmember_pc/src/views/article-content/components/RecommendEnt.vue

+ 14 - 10
apps/bigmember_pc/src/views/article-content/components/RecommendEnt.vue

@@ -27,31 +27,32 @@ function getRecommendEntInfo(list) {
           link: item.link,
           link: item.link,
           tags: [
           tags: [
             {
             {
-              value: resItem.contactCount || 0,
+              value: resItem.contactCount || '-',
               unit: '个',
               unit: '个',
               label: '联系人'
               label: '联系人'
             },
             },
             {
             {
-              value: resItem.biddingCount || 0,
+              value: resItem.biddingCount || '-',
               unit: '条',
               unit: '条',
               label: '招标动态'
               label: '招标动态'
             },
             },
             {
             {
-              value: resItem.projectCount || 0,
+              value: resItem.projectCount || '-',
               unit: '个',
               unit: '个',
               label: '采购项目数量'
               label: '采购项目数量'
             },
             },
             {
             {
-              value: formatMoney(resItem.bidamountCount, { type: 'number' }),
-              unit: formatMoney(resItem.bidamountCount, { type: 'unit' }),
+              value:
+                formatMoney(resItem.bidamountCount, { type: 'number' }) || '-',
+              unit: formatMoney(resItem.bidamountCount, { type: 'unit' }) || '',
               label: '采购规模'
               label: '采购规模'
             },
             },
             {
             {
-              value: resItem.cooperate || 0,
+              value: resItem.cooperate || '-',
               unit: '个',
               unit: '个',
               label: '合作企业'
               label: '合作企业'
             }
             }
-          ].filter((v) => v.value),
+          ],
           origin: res.data
           origin: res.data
         }
         }
         recommendList.value = [].concat(resultList)
         recommendList.value = [].concat(resultList)
@@ -70,7 +71,10 @@ const list = computed(() => {
 getRecommendEntInfo(list.value)
 getRecommendEntInfo(list.value)
 
 
 const recommendEntList = computed(() => {
 const recommendEntList = computed(() => {
-  return recommendList.value.filter((v) => v.name && v.tags.length > 0)
+  return recommendList.value.filter((v) => {
+    const hasTwoTag = v?.tags?.filter((v) => v.value !== '-').length >= 2
+    return v.name && hasTwoTag
+  })
 })
 })
 
 
 function doOpen(item) {
 function doOpen(item) {
@@ -115,7 +119,7 @@ function doOpen(item) {
           <div class="number-info-item" v-for="(tag, i) in item.tags" :key="i">
           <div class="number-info-item" v-for="(tag, i) in item.tags" :key="i">
             <div class="highlight-number">
             <div class="highlight-number">
               <span class="highlight-number-label">{{ tag.value }}</span>
               <span class="highlight-number-label">{{ tag.value }}</span>
-              <span>{{ tag.unit }}</span>
+              <span v-if="tag.value !== '-'">{{ tag.unit }}</span>
             </div>
             </div>
             <span>{{ tag.label }}</span>
             <span>{{ tag.label }}</span>
           </div>
           </div>
@@ -158,7 +162,7 @@ function doOpen(item) {
     display: flex;
     display: flex;
     flex-direction: row;
     flex-direction: row;
     align-items: center;
     align-items: center;
-    justify-content: flex-start;
+    justify-content: space-between;
     font-size: 14px;
     font-size: 14px;
     line-height: 22px;
     line-height: 22px;
     color: #686868;
     color: #686868;