zs 8 tháng trước cách đây
mục cha
commit
b413f57b0e

+ 5 - 0
src/store/api/user/incubator.js

@@ -29,6 +29,10 @@ export const IncubatorStore = defineStore('incubator', () => {
     const res = await axios.$get(`${url}/field`, payload)
     return res
   }
+  const cfield = async (payload) => {
+    const res = await axios.$get(`${url}/cfield`, payload)
+    return res
+  }
   const statistics = async (payload) => {
     const res = await axios.$get(`${url}/statistics`, payload)
     return res
@@ -59,6 +63,7 @@ export const IncubatorStore = defineStore('incubator', () => {
     list,
     all,
     field,
+    cfield,
     statistics,
     detail,
     fetch,

+ 47 - 8
src/views/elevenHatch/index.vue

@@ -21,9 +21,23 @@
                     </div>
                   </div>
                 </div>
-                <div class="boxall">
+                <div class="boxall" v-show="is_show">
                   <div class="alltitle">行业领域占比情况</div>
-                  <echarts1 :info_3="info_3"></echarts1>
+                  <echarts1 :info_3="info_3" @dataChange="dataChange"></echarts1>
+                </div>
+                <div class="boxall" v-show="!is_show">
+                  <div class="alltitle">
+                    <div>企业信息</div>
+                    <button class="button type1" @click="toBack2">返回</button>
+                  </div>
+                  <div class="wraptit"><span>企业名称</span></div>
+                  <div class="one">
+                    <vue3-seamless-scroll :list="oneList" :hover="true" :step="0.2" :wheel="true" :isWatch="true" class="scroll">
+                      <div class="wrap" v-for="(item, index) in oneList" :key="index" @click="toCView(item)">
+                        <div class="other">{{ item.name || '暂无名称' }}</div>
+                      </div>
+                    </vue3-seamless-scroll>
+                  </div>
                 </div>
               </div>
             </el-col>
@@ -161,6 +175,7 @@ import video_4 from '/images/video_4.jpg'
 import loadingUrl from '../elevenHatch/images/loading.gif'
 const twoList = ref([{ url: video_1 }, { url: video_2 }, { url: video_3 }, { url: video_4 }])
 const thrList = ref([])
+const is_show = ref(true)
 const info = ref({ show: true })
 const info_2 = ref({})
 const info_3 = ref({})
@@ -178,6 +193,7 @@ const column = ref([
 ])
 // 列表
 const list_1 = ref([])
+const oneList = ref([])
 let skip = 0
 let limit = 10
 const total = ref(0)
@@ -249,6 +265,18 @@ const searchField = async () => {
   }
 }
 
+const searchcField = async (name) => {
+  if (info.value.id) {
+    const data = {
+      incubator: info.value.id,
+      industry: name,
+      status: '1'
+    }
+    const res = await incubatorStore.cfield(data)
+    if (res.errcode == '0') oneList.value = res.data
+  }
+}
+
 // 创建一个函数来格式化时间并更新状态
 const updateTime = () => {
   const now = new Date()
@@ -302,11 +330,21 @@ const toNum = (item) => {
 // 返回
 const toBack = async () => {
   info.value.show = true
+  is_show.value = true
   await search()
 }
+// 返回
+const toBack2 = async () => {
+  is_show.value = true
+}
 // 查看企业信息
 const toCView = (item) => {
-  router.push({ path: `/company/detail`, query: { id: item.company } })
+  router.push({ path: `/company/detail`, query: { id: item.company || item.id } })
+}
+// 点击饼图
+const dataChange = async (name) => {
+  await searchcField(name)
+  is_show.value = false
 }
 const currentPage = ref(1)
 // 分页
@@ -416,6 +454,10 @@ const sizeChange = (limits) => {
         position: relative;
         margin-bottom: 10px;
         z-index: 10;
+        .compField {
+          height: 296px;
+          width: 100%;
+        }
         .center_list {
           display: flex;
           flex-wrap: wrap;
@@ -719,7 +761,7 @@ const sizeChange = (limits) => {
         letter-spacing: 2px;
       }
       .one {
-        height: 72px;
+        height: 240px;
         overflow: hidden;
         .scroll {
           width: 100%;
@@ -729,11 +771,8 @@ const sizeChange = (limits) => {
             border: 1px solid rgba(25, 186, 139, 0.17);
             padding: 10px;
             margin: 0 0 10px 0;
-            .other:first-child {
-              width: 40%;
-            }
             .other {
-              width: 30%;
+              width: 100%;
               color: rgba(255, 255, 255, 0.6);
               text-align: center;
               text-overflow: ellipsis;

+ 5 - 0
src/views/elevenHatch/path/echarts1.vue

@@ -14,6 +14,7 @@ const props = defineProps({
   info_3: { type: Object, default: () => {} }
 })
 const { info_3 } = toRefs(props)
+const emits = defineEmits(['dataChange'])
 function echarts1View() {
   const myChart1 = echarts.init(echarts1.value)
   const option1 = {
@@ -68,6 +69,10 @@ function echarts1View() {
   window.addEventListener('resize', function () {
     myChart1.resize()
   })
+  // 饼图点击跳转到指定页面
+  myChart1.on('click', function (param) {
+    emits('dataChange', param.name)
+  })
 }
 watch(
   info_3,