浏览代码

修改相关推荐

zs 1 年之前
父节点
当前提交
09b77b18b9

+ 135 - 0
src/views/achievement/detail.vue

@@ -82,6 +82,51 @@
             </el-col>
             <el-col :span="24" class="four_2">{{ info.brief || '暂无' }}</el-col>
           </el-col>
+          <el-col :span="24" class="four">
+            <el-col :span="24" class="four_1">
+              <p>相关推荐</p>
+            </el-col>
+            <el-col :span="24" class="four_3">
+              <a-list :loading="loading" :grid="{ gutter: 16, column: 4 }" :data-source="list">
+                <template #renderItem="{ item }">
+                  <el-col :span="24" class="list">
+                    <el-col :span="24" class="name textOver">
+                      <el-tooltip effect="dark" :content="item.name" placement="top">
+                        {{ item.name || '暂无名称' }}
+                      </el-tooltip>
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>技术领域:</span>{{ getDict(item.field || '暂无技术领域', 'field') }}
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>成果地区:</span>{{ getArea(item.area || '暂无成果地区') }}
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>单位:</span>{{ item.user || '暂无单位' }}
+                    </el-col>
+                    <el-col :span="24" class="bottom">
+                      <a-button size="small" type="primary" @click="toView(item)">
+                        查看详情
+                      </a-button>
+                    </el-col>
+                  </el-col>
+                </template>
+              </a-list>
+              <el-col :span="24" class="page">
+                <el-pagination
+                  background
+                  layout="total, prev, pager, next"
+                  :page-sizes="[10, 20, 50, 100, 200]"
+                  :total="total"
+                  :page-size="limit"
+                  v-model:current-page="currentPage"
+                  @current-change="changePage"
+                  @size-change="sizeChange"
+                >
+                </el-pagination>
+              </el-col>
+            </el-col>
+          </el-col>
         </div>
       </el-col>
     </el-row>
@@ -114,11 +159,17 @@ const attributeList = ref([])
 const matureList = ref([])
 const sellList = ref([])
 const technologyList = ref([])
+// 成果列表
+const list = ref([])
+let skip = 0
+let limit = inject('limit')
+const total = ref(0)
 // 请求
 onMounted(async () => {
   loading.value = true
   await searchOther()
   await search()
+  await searchAchieve({ skip, limit })
   loading.value = false
 })
 const search = async () => {
@@ -128,6 +179,19 @@ const search = async () => {
     if (res.errcode == '0') info.value = res.data
   }
 }
+const searchAchieve = async (query = { skip: 0, limit }) => {
+  const info = {
+    skip: query.skip,
+    limit: query.limit,
+    is_use: '0',
+    status: '1'
+  }
+  const res = await store.query(info)
+  if (res.errcode == '0') {
+    list.value = res.data
+    total.value = res.total
+  }
+}
 const searchOther = async () => {
   let result
   // 成熟度
@@ -180,6 +244,21 @@ const toUnit = () => {
 const toCollection = () => {
   console.log('收藏')
 }
+// 查看
+const toView = (item) => {
+  router.push({ path: '/achievement/detail', query: { id: item.id || item._id } })
+}
+const currentPage = ref(1)
+// 分页
+const changePage = (page = currentPage.value) => {
+  searchAchieve({ skip: (page - 1) * limit, limit: limit })
+}
+const sizeChange = (limits) => {
+  console.log(limits)
+  limit = limits
+  currentPage.value = 1
+  searchAchieve({ skip: 0, limit: limit })
+}
 </script>
 <style scoped lang="scss">
 .main {
@@ -330,6 +409,62 @@ const toCollection = () => {
         background: #2374ff;
       }
     }
+    .four_3 {
+      margin: 20px;
+
+      .list {
+        border: 1px solid #edeff2;
+        background: #fff;
+        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.03);
+        border-radius: 2px;
+        width: 280px;
+        height: 180px;
+        margin-bottom: 15px;
+        cursor: pointer;
+        transition: all 0.3s;
+        padding: 15px;
+        .name {
+          font-size: 16px;
+          color: #121834;
+          height: 16px;
+          line-height: 13px;
+          font-weight: 500;
+          margin: 10px 0;
+        }
+
+        .name:hover {
+          color: #2374ff;
+        }
+
+        .two_1 {
+          font-size: 12px;
+          text-align: justify;
+          line-height: 12px;
+          font-weight: 400;
+          letter-spacing: 0;
+          color: #8f97a3;
+          margin-top: 15px;
+
+          span:last-child {
+            color: #525a68;
+          }
+        }
+        .bottom {
+          text-align: right;
+        }
+      }
+
+      .list:hover {
+        background: #f0f7ff;
+        box-shadow: 0 0 16px rgba(205, 205, 205, 0.6);
+      }
+
+      .page {
+        display: flex;
+        flex-direction: row-reverse;
+        padding: 20px;
+      }
+    }
   }
   .pointer {
     display: flex;

+ 2 - 2
src/views/company/detail.vue

@@ -22,11 +22,11 @@
                   </el-col>
                   <el-col :span="8" class="button">
                     <el-col :span="24" class="one_1">
-                      <el-col :span="6" class="file" @click="toCollection">
+                      <el-col :span="5" class="file" @click="toCollection">
                         <el-icon><Star /></el-icon>
                         收藏
                       </el-col>
-                      <el-col :span="6" class="file">
+                      <el-col :span="8" class="file">
                         <a-button type="primary" @click="toChat"> 在线洽谈 </a-button>
                       </el-col>
                     </el-col>

+ 140 - 3
src/views/demand/detail.vue

@@ -5,8 +5,8 @@
         <div class="w_1200">
           <el-col :span="24" class="one">
             <el-row :span="24" class="one_1">
-              <el-col :span="20" class="title">{{ info.name || '暂无标题' }}</el-col>
-              <el-col :span="4" class="file" @click="toCollection">
+              <el-col :span="23" class="title">{{ info.name || '暂无标题' }}</el-col>
+              <el-col :span="1" class="file" @click="toCollection">
                 <el-icon><Star /></el-icon>
                 收藏
               </el-col>
@@ -71,6 +71,51 @@
             </el-col>
             <el-col :span="24" class="four_2">{{ info.brief || '暂无' }}</el-col>
           </el-col>
+          <el-col :span="24" class="four">
+            <el-col :span="24" class="four_1">
+              <p>相关推荐</p>
+            </el-col>
+            <el-col :span="24" class="four_3">
+              <a-list :loading="loading" :grid="{ gutter: 16, column: 4 }" :data-source="list">
+                <template #renderItem="{ item }">
+                  <el-col :span="24" class="list">
+                    <el-col :span="24" class="name textOver">
+                      <el-tooltip effect="dark" :content="item.name" placement="top">
+                        {{ item.name || '暂无名称' }}
+                      </el-tooltip>
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>技术领域:</span>{{ getDict(item.field || '暂无技术领域', 'field') }}
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>成果地区:</span>{{ getArea(item.area || '暂无成果地区') }}
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>单位:</span>{{ item.user || '暂无单位' }}
+                    </el-col>
+                    <el-col :span="24" class="bottom">
+                      <a-button size="small" type="primary" @click="toView(item)">
+                        查看详情
+                      </a-button>
+                    </el-col>
+                  </el-col>
+                </template>
+              </a-list>
+              <el-col :span="24" class="page">
+                <el-pagination
+                  background
+                  layout="total, prev, pager, next"
+                  :page-sizes="[10, 20, 50, 100, 200]"
+                  :total="total"
+                  :page-size="limit"
+                  v-model:current-page="currentPage"
+                  @current-change="changePage"
+                  @size-change="sizeChange"
+                >
+                </el-pagination>
+              </el-col>
+            </el-col>
+          </el-col>
         </div>
       </el-col>
     </el-row>
@@ -84,8 +129,10 @@ import { get } from 'lodash-es'
 const $checkRes = inject('$checkRes')
 // 接口
 import { DemandStore } from '@/store/api/platform/demand'
+import { AchievementStore } from '@/store/api/platform/achievement'
 import { DictDataStore } from '@/store/api/system/dictData'
 const store = DemandStore()
+const achievementStore = AchievementStore()
 const dictDataStore = DictDataStore()
 import { UserStore } from '@/store/user'
 const userStore = UserStore()
@@ -102,11 +149,17 @@ const methodList = ref([])
 const urgentList = ref([])
 const fieldList = ref([])
 const demandList = ref([])
+// 成果列表
+const list = ref([])
+let skip = 0
+let limit = inject('limit')
+const total = ref(0)
 // 请求
 onMounted(async () => {
   loading.value = true
   await searchOther()
   await search()
+  await searchAchieve({ skip, limit })
   loading.value = false
 })
 const search = async () => {
@@ -116,6 +169,19 @@ const search = async () => {
     if (res.errcode == '0') info.value = res.data
   }
 }
+const searchAchieve = async (query = { skip: 0, limit }) => {
+  const info = {
+    skip: query.skip,
+    limit: query.limit,
+    is_use: '0',
+    status: '1'
+  }
+  const res = await achievementStore.query(info)
+  if (res.errcode == '0') {
+    list.value = res.data
+    total.value = res.total
+  }
+}
 const searchOther = async () => {
   let result
   // 合作方式
@@ -157,6 +223,21 @@ const toDocking = () => {
 const toCollection = () => {
   console.log('收藏')
 }
+// 查看
+const toView = (item) => {
+  router.push({ path: '/achievement/detail', query: { id: item.id || item._id } })
+}
+const currentPage = ref(1)
+// 分页
+const changePage = (page = currentPage.value) => {
+  searchAchieve({ skip: (page - 1) * limit, limit: limit })
+}
+const sizeChange = (limits) => {
+  console.log(limits)
+  limit = limits
+  currentPage.value = 1
+  searchAchieve({ skip: 0, limit: limit })
+}
 </script>
 <style scoped lang="scss">
 .main {
@@ -180,7 +261,7 @@ const toCollection = () => {
       .file {
         display: flex;
         align-items: center;
-        justify-content: end;
+        justify-content: space-between;
         font-family: PingFangSC-Regular;
         font-size: 14px;
         color: #2374ff;
@@ -303,6 +384,62 @@ const toCollection = () => {
         background: #2374ff;
       }
     }
+    .four_3 {
+      margin: 20px;
+
+      .list {
+        border: 1px solid #edeff2;
+        background: #fff;
+        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.03);
+        border-radius: 2px;
+        width: 280px;
+        height: 180px;
+        margin-bottom: 15px;
+        cursor: pointer;
+        transition: all 0.3s;
+        padding: 15px;
+        .name {
+          font-size: 16px;
+          color: #121834;
+          height: 16px;
+          line-height: 13px;
+          font-weight: 500;
+          margin: 10px 0;
+        }
+
+        .name:hover {
+          color: #2374ff;
+        }
+
+        .two_1 {
+          font-size: 12px;
+          text-align: justify;
+          line-height: 12px;
+          font-weight: 400;
+          letter-spacing: 0;
+          color: #8f97a3;
+          margin-top: 15px;
+
+          span:last-child {
+            color: #525a68;
+          }
+        }
+        .bottom {
+          text-align: right;
+        }
+      }
+
+      .list:hover {
+        background: #f0f7ff;
+        box-shadow: 0 0 16px rgba(205, 205, 205, 0.6);
+      }
+
+      .page {
+        display: flex;
+        flex-direction: row-reverse;
+        padding: 20px;
+      }
+    }
   }
   .pointer {
     display: flex;

+ 19 - 0
src/views/innovation/detail.vue

@@ -79,6 +79,10 @@
               <div v-html="info.brief"></div>
             </el-row>
           </el-col>
+          <el-col :span="24" class="thr">
+            <el-col :span="24" class="thr_1"> 相关推荐 </el-col>
+            <el-col :span="24" class="thr_2"> 1111 </el-col>
+          </el-col>
         </div>
       </el-col>
     </el-row>
@@ -378,5 +382,20 @@ provide('submitForm', submitForm)
       }
     }
   }
+  .thr {
+    margin: 20px 0;
+    background: #ffffff;
+    border-radius: 10px;
+    padding: 15px;
+    .thr_1 {
+      padding: 10px;
+      font-family: PingFangSC-Semibold;
+      font-size: 18px;
+      color: #383b40;
+      letter-spacing: 0;
+      line-height: 18px;
+      font-weight: 600;
+    }
+  }
 }
 </style>

+ 141 - 0
src/views/project/detail.vue

@@ -74,6 +74,51 @@
             </el-col>
             <el-col :span="24" class="four_2">{{ info.brief || '暂无' }}</el-col>
           </el-col>
+          <el-col :span="24" class="four">
+            <el-col :span="24" class="four_1">
+              <p>相关推荐</p>
+            </el-col>
+            <el-col :span="24" class="four_3">
+              <a-list :loading="loading" :grid="{ gutter: 16, column: 4 }" :data-source="list">
+                <template #renderItem="{ item }">
+                  <el-col :span="24" class="list">
+                    <el-col :span="24" class="name textOver">
+                      <el-tooltip effect="dark" :content="item.name" placement="top">
+                        {{ item.name || '暂无名称' }}
+                      </el-tooltip>
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>技术领域:</span>{{ getDict(item.field || '暂无技术领域', 'field') }}
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>成果地区:</span>{{ getArea(item.area || '暂无成果地区') }}
+                    </el-col>
+                    <el-col :span="24" class="two_1">
+                      <span>单位:</span>{{ item.user || '暂无单位' }}
+                    </el-col>
+                    <el-col :span="24" class="bottom">
+                      <a-button size="small" type="primary" @click="toView(item)">
+                        查看详情
+                      </a-button>
+                    </el-col>
+                  </el-col>
+                </template>
+              </a-list>
+              <el-col :span="24" class="page">
+                <el-pagination
+                  background
+                  layout="total, prev, pager, next"
+                  :page-sizes="[10, 20, 50, 100, 200]"
+                  :total="total"
+                  :page-size="limit"
+                  v-model:current-page="currentPage"
+                  @current-change="changePage"
+                  @size-change="sizeChange"
+                >
+                </el-pagination>
+              </el-col>
+            </el-col>
+          </el-col>
         </div>
       </el-col>
     </el-row>
@@ -87,8 +132,10 @@ import { get } from 'lodash-es'
 const $checkRes = inject('$checkRes')
 // 接口
 import { ProjectStore } from '@/store/api/platform/project'
+import { AchievementStore } from '@/store/api/platform/achievement'
 import { DictDataStore } from '@/store/api/system/dictData'
 const store = ProjectStore()
+const achievementStore = AchievementStore()
 const dictDataStore = DictDataStore()
 import { UserStore } from '@/store/user'
 const userStore = UserStore()
@@ -106,11 +153,17 @@ const typeList = ref([])
 const maturityList = ref([])
 const skillList = ref([])
 const cooperateList = ref([])
+// 成果列表
+const list = ref([])
+let skip = 0
+let limit = inject('limit')
+const total = ref(0)
 // 请求
 onMounted(async () => {
   loading.value = true
   await searchOther()
   await search()
+  await searchAchieve({ skip, limit })
   loading.value = false
 })
 const search = async () => {
@@ -120,6 +173,19 @@ const search = async () => {
     if (res.errcode == '0') info.value = res.data
   }
 }
+const searchAchieve = async (query = { skip: 0, limit }) => {
+  const info = {
+    skip: query.skip,
+    limit: query.limit,
+    is_use: '0',
+    status: '1'
+  }
+  const res = await achievementStore.query(info)
+  if (res.errcode == '0') {
+    list.value = res.data
+    total.value = res.total
+  }
+}
 const searchOther = async () => {
   let result
   // 行业分类
@@ -148,6 +214,10 @@ const getDict = (data, model) => {
   else if (model == 'type') res = typeList.value.find((f) => f.value == data)
   return get(res, 'label')
 }
+// 地区
+const getArea = (data) => {
+  if (data) return data.join(',')
+}
 // 在线洽谈
 const toChat = () => {
   router.push({ path: '/chat', query: { id: info.value.id || info.value._id } })
@@ -160,6 +230,21 @@ const toDocking = () => {
 const toCollection = () => {
   console.log('收藏')
 }
+// 查看
+const toView = (item) => {
+  router.push({ path: '/achievement/detail', query: { id: item.id || item._id } })
+}
+const currentPage = ref(1)
+// 分页
+const changePage = (page = currentPage.value) => {
+  searchAchieve({ skip: (page - 1) * limit, limit: limit })
+}
+const sizeChange = (limits) => {
+  console.log(limits)
+  limit = limits
+  currentPage.value = 1
+  searchAchieve({ skip: 0, limit: limit })
+}
 </script>
 <style scoped lang="scss">
 .main {
@@ -306,6 +391,62 @@ const toCollection = () => {
         background: #2374ff;
       }
     }
+    .four_3 {
+      margin: 20px;
+
+      .list {
+        border: 1px solid #edeff2;
+        background: #fff;
+        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.03);
+        border-radius: 2px;
+        width: 280px;
+        height: 180px;
+        margin-bottom: 15px;
+        cursor: pointer;
+        transition: all 0.3s;
+        padding: 15px;
+        .name {
+          font-size: 16px;
+          color: #121834;
+          height: 16px;
+          line-height: 13px;
+          font-weight: 500;
+          margin: 10px 0;
+        }
+
+        .name:hover {
+          color: #2374ff;
+        }
+
+        .two_1 {
+          font-size: 12px;
+          text-align: justify;
+          line-height: 12px;
+          font-weight: 400;
+          letter-spacing: 0;
+          color: #8f97a3;
+          margin-top: 15px;
+
+          span:last-child {
+            color: #525a68;
+          }
+        }
+        .bottom {
+          text-align: right;
+        }
+      }
+
+      .list:hover {
+        background: #f0f7ff;
+        box-shadow: 0 0 16px rgba(205, 205, 205, 0.6);
+      }
+
+      .page {
+        display: flex;
+        flex-direction: row-reverse;
+        padding: 20px;
+      }
+    }
   }
   .pointer {
     display: flex;