zs hace 2 años
padre
commit
80e5c95f3a

+ 1 - 1
src/components/common/studio/info.vue

@@ -9,7 +9,7 @@
             </span>
           </template>
           <template #team>
-            <component :is="CTable" :fields="teamfields" :opera="[]" :data="form.team" :usePage="false"> </component>
+            <component style="width: 100%" :is="CTable" :fields="teamfields" :opera="[]" :data="form.team" :usePage="false"> </component>
           </template>
           <template #hz_fields>
             <span v-for="(i, index) in form.hzfieldsList" :key="index" class="direction">

+ 3 - 3
src/views/user/scientist/studio/index.vue

@@ -146,9 +146,9 @@ const partSearch = (form: { [x: string]: any }) => {
   search({ skip, limit });
 };
 // 查看详情
-const toView = async (data: { studio_id: string }) => {
-  if (data.studio_id) {
-    router.push({ path: '/user/scientist/studio/info', query: { id: data.studio_id } });
+const toView = async (data: { studio_id: string; _id: string }) => {
+  if (data.studio_id && data._id) {
+    router.push({ path: '/user/scientist/studio/info', query: { id: data.studio_id, scientist_id: data._id } });
   } else {
     ElMessage({ message: '暂无工作室信息', type: 'warning' });
   }

+ 9 - 2
src/views/user/scientist/studio/info.vue

@@ -19,10 +19,13 @@ import { useRoute } from 'vue-router';
 import type { Ref } from 'vue';
 import { ref, onMounted } from 'vue';
 import { StudioStore } from '@common/src/stores/studio/studios/studio'; // 列表
+import { ScientistsettleStore } from '@common/src/stores/studio/studios/scientistsettle'; // 入驻科学家工作室
 import type { IQueryResult } from '@/util/types.util';
 const studio = StudioStore();
+const scientistsettle = ScientistsettleStore();
 let route = useRoute();
-let info: Ref<{}> = ref({});
+interface dataItem {}
+let info: Ref<{ team: Array<dataItem> }> = ref({ team: [] });
 onMounted(async () => {
   await search();
 });
@@ -30,7 +33,11 @@ const search = async () => {
   if (route.query && route.query.id) {
     let id = route.query.id;
     const res: IQueryResult = await studio.fetch(id);
-    info.value = res.data as {};
+    info.value = res.data as { team: Array<dataItem> };
+    if (route.query.scientist_id) {
+      const arr = await scientistsettle.fetch(route.query.scientist_id);
+      info.value.team = arr.data.team;
+    }
   }
 };
 const toBack = () => {