zs 8 bulan lalu
induk
melakukan
b4207874e9

+ 7 - 6
src/store/api/user/incubator.js

@@ -21,12 +21,12 @@ export const IncubatorStore = defineStore('incubator', () => {
     const res = await axios.$get(`${url}/list`, cond)
     return res
   }
-  const all = async ({ skip = 0, limit = undefined, ...info } = {}) => {
-    let cond = {}
-    if (skip) cond.skip = skip
-    if (limit) cond.limit = limit
-    cond = { ...cond, ...info }
-    const res = await axios.$get(`${url}/allList`, cond)
+  const all = async (payload) => {
+    const res = await axios.$get(`${url}/allList`, payload)
+    return res
+  }
+  const field = async (payload) => {
+    const res = await axios.$get(`${url}/field`, payload)
     return res
   }
   const statistics = async (payload) => {
@@ -58,6 +58,7 @@ export const IncubatorStore = defineStore('incubator', () => {
     query,
     list,
     all,
+    field,
     statistics,
     detail,
     fetch,

+ 13 - 3
src/views/elevenHatch/index.vue

@@ -23,7 +23,7 @@
                 </div>
                 <div class="boxall">
                   <div class="alltitle">行业领域占比情况</div>
-                  <echarts1></echarts1>
+                  <echarts1 :info_3="info_3"></echarts1>
                 </div>
               </div>
             </el-col>
@@ -162,7 +162,8 @@ 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 info = ref({ show: true })
-const info_2 = ref()
+const info_2 = ref({})
+const info_3 = ref({})
 const yearInfo = ref({})
 const year1 = ref('2023')
 const year2 = ref('2023')
@@ -188,6 +189,7 @@ onMounted(async () => {
   await searchYear()
   await searchcYear()
   await updateTime()
+  await searchField()
   loading.value = false
 })
 const searchOther = async () => {
@@ -239,6 +241,14 @@ const searchcYear = async () => {
   }
 }
 
+const searchField = async () => {
+  if (info.value.id) {
+    const data = { is_use: '0', incubator: info.value.id, status: '1' }
+    const res = await incubatorStore.field(data)
+    if (res.errcode == '0') info_3.value = res.data
+  }
+}
+
 // 创建一个函数来格式化时间并更新状态
 const updateTime = () => {
   const now = new Date()
@@ -283,7 +293,7 @@ const toYear1 = (e) => {
 //孵化基地企业产业占比
 const toYear2 = (e) => {
   year2.value = e
-  console.log(e)
+  searchcYear()
 }
 // 孵化基地汇总
 const toNum = (item) => {

+ 14 - 29
src/views/elevenHatch/path/echarts1.vue

@@ -10,9 +10,10 @@
 <script setup>
 import * as echarts from 'echarts'
 const echarts1 = ref()
-onMounted(() => {
-  echarts1View()
+const props = defineProps({
+  info_3: { type: Object, default: () => {} }
 })
+const { info_3 } = toRefs(props)
 function echarts1View() {
   const myChart1 = echarts.init(echarts1.value)
   const option1 = {
@@ -32,7 +33,7 @@ function echarts1View() {
         fontSize: 12
       },
       orient: 'vertical',
-      data: ['生物医药', '化工新材料', '先进装备制造', '高端服务', '光电子', '电子信息']
+      data: info_3.value.nameList
     },
     calculable: true,
     series: [
@@ -59,32 +60,7 @@ function echarts1View() {
             show: true
           }
         },
-        data: [
-          {
-            value: 10,
-            name: '生物医药'
-          },
-          {
-            value: 5,
-            name: '化工新材料'
-          },
-          {
-            value: 15,
-            name: '先进装备制造'
-          },
-          {
-            value: 25,
-            name: '高端服务'
-          },
-          {
-            value: 20,
-            name: '光电子'
-          },
-          {
-            value: 20,
-            name: '电子信息'
-          }
-        ]
+        data: info_3.value.list
       }
     ]
   }
@@ -93,4 +69,13 @@ function echarts1View() {
     myChart1.resize()
   })
 }
+watch(
+  info_3,
+  () => {
+    echarts1View()
+  },
+  {
+    deep: true
+  }
+)
 </script>