info.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div id="info">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight">
  5. <el-col :span="24" class="one">
  6. <component :is="partsSearch" :is_back="true" @toBack="toBack()"></component>
  7. </el-col>
  8. <el-col :span="24" class="two">
  9. <component :is="studioInfo" :info="info"></component>
  10. </el-col>
  11. </el-col>
  12. </el-row>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import partsSearch from '@common/src/components/frame/c-search.vue';
  17. import studioInfo from '@/components/common/studio/info.vue';
  18. import { useRoute } from 'vue-router';
  19. import type { Ref } from 'vue';
  20. import { ref, onMounted } from 'vue';
  21. import { StudioStore } from '@common/src/stores/studio/studios/studio'; // 列表
  22. import { ScientistsettleStore } from '@common/src/stores/studio/studios/scientistsettle';
  23. import type { IQueryResult } from '@/util/types.util';
  24. const scientistsettle = ScientistsettleStore();
  25. const studio = StudioStore();
  26. let route = useRoute();
  27. let info: Ref<{ team: any[] }> = ref({ team: [] });
  28. onMounted(async () => {
  29. await search();
  30. });
  31. const search = async () => {
  32. if (route.query.id) {
  33. let id = route.query.id;
  34. const res: IQueryResult = await studio.fetch(id);
  35. info.value = res.data as { team: any };
  36. await sarchTeam();
  37. }
  38. };
  39. const sarchTeam = async () => {
  40. let id = route.query.id;
  41. let list = [];
  42. let res = await scientistsettle.query({ studio_id: id });
  43. if (res.total > 0) {
  44. let data = res.data[0];
  45. list = data.team;
  46. }
  47. info.value.team = list;
  48. };
  49. const toBack = () => {
  50. window.history.go(-1);
  51. };
  52. </script>
  53. <style lang="scss" scoped></style>