Explorar o código

修改首页查看更多

zs hai 1 ano
pai
achega
19df479aa8
Modificáronse 2 ficheiros con 25 adicións e 20 borrados
  1. 4 7
      src/views/home/index.vue
  2. 21 13
      src/views/project/index.vue

+ 4 - 7
src/views/home/index.vue

@@ -9,7 +9,7 @@
           <el-col :span="24" class="one">
             <el-col :span="24" class="one_1">
               <el-col :span="12" class="left">汇聚科技创新的创新赛道</el-col>
-              <el-col :span="12" class="right" @click="toMore('/project')">查看全部项目</el-col>
+              <el-col :span="12" class="right" @click="selectMenu('project')">查看全部项目</el-col>
             </el-col>
             <el-col :span="24" class="one_2">
               <el-col :span="4" class="left">
@@ -53,7 +53,7 @@
           <el-col :span="24" class="one">
             <el-col :span="24" class="one_1">
               <el-col :span="12" class="left">汇聚各种行业的专家</el-col>
-              <el-col :span="12" class="right" @click="toMore('/expert')">查看更多专家</el-col>
+              <el-col :span="12" class="right" @click="selectMenu('expert')">查看更多专家</el-col>
             </el-col>
             <el-col :span="24" class="one_3">
               <el-col :span="24" class="table_1">
@@ -113,7 +113,7 @@
           <el-col :span="24" class="one">
             <el-col :span="24" class="one_1">
               <el-col :span="12" class="left">汇聚各类优质的企业</el-col>
-              <el-col :span="12" class="right" @click="toMore('/company')">查看更多企业</el-col>
+              <el-col :span="12" class="right" @click="selectMenu('company')">查看更多企业</el-col>
             </el-col>
             <el-col :span="24" class="one_4">
               <el-col
@@ -167,6 +167,7 @@
 <script setup>
 const $checkRes = inject('$checkRes')
 import { get } from 'lodash-es'
+const selectMenu = inject('selectMenu')
 // 接口
 import { DictDataStore } from '@/store/api/system/dictData'
 import { ProjectStore } from '@/store/api/platform/project'
@@ -416,10 +417,6 @@ const getArea = (data) => {
 const toView = (item) => {
   console.log(item)
 }
-// 查看更多
-const toMore = (path) => {
-  router.push({ path })
-}
 // 类型
 const mouseOver = (item) => {
   active.value = item.type

+ 21 - 13
src/views/project/index.vue

@@ -32,16 +32,16 @@
                     </el-tooltip>
                   </el-col>
                   <el-col :span="24" class="two_1">
-                    <span>服务机构: </span>{{ item.unit || '暂无服务机构' }}
+                    <span>合作类型: </span>{{ getDict(item.maturity, 'maturity') }}
                   </el-col>
                   <el-col :span="24" class="two_1">
-                    <span>项目编号: </span>{{ item.no || '暂无项目编号' }}
+                    <span>技术成熟度: </span>{{ getDict(item.cooperate, 'cooperate') }}
                   </el-col>
                   <el-col :span="24" class="two_1">
-                    <span>发布日期: </span>{{ item.notice_time || '暂无发布日期' }}
+                    <span>发布日期: </span>{{ item.time }}
                   </el-col>
                   <el-col :span="24" class="bottom">
-                    <div class="status">挂牌公告</div>
+                    <div class="status">{{ getDict(item.type, 'type') }}</div>
                     <div class="button" @click="toView">查看详情</div>
                   </el-col>
                 </el-col>
@@ -88,7 +88,10 @@ let skip = 0
 let limit = inject('limit')
 const total = ref(20)
 // 字典表
-const fieldList = ref([])
+// 字典表
+const projectList = ref([])
+const maturityList = ref([])
+const industryList = ref([])
 const searchList = ref([
   {
     title: '技术领域',
@@ -172,9 +175,16 @@ onMounted(async () => {
 })
 const searchOther = async () => {
   let result
-  // 技术领域
-  result = await dictDataStore.query({ code: 'field', is_use: '0' })
-  if ($checkRes(result)) fieldList.value = result.data
+  // 合作类型
+  result = await dictDataStore.query({ code: 'projectType', is_use: '0' })
+  if ($checkRes(result)) projectList.value = result.data
+  // 成熟度
+  result = await dictDataStore.query({ code: 'projectMaturity', is_use: '0' })
+  if ($checkRes(result)) maturityList.value = result.data
+  // 行业分类
+  result = await dictDataStore.query({ code: 'industry', is_use: '0' })
+  if ($checkRes(result)) industryList.value = result.data
+  // 企业状态
 }
 const search = async (query = { skip: 0, limit }) => {
   const info = {
@@ -193,13 +203,11 @@ const search = async (query = { skip: 0, limit }) => {
 // 字典数据转换
 const getDict = (data, model) => {
   let res
-  if (model == 'field') res = fieldList.value.find((f) => f.value == data)
+  if (model == 'cooperate') res = projectList.value.find((f) => f.value == data)
+  else if (model == 'maturity') res = maturityList.value.find((f) => f.value == data)
+  else if (model == 'type') res = industryList.value.find((f) => f.value == data)
   return get(res, 'label')
 }
-// 地区显示
-const getArea = (data) => {
-  if (data) return data.join(',')
-}
 const currentPage = ref(1)
 // 分页
 const changePage = (page = currentPage.value) => {