index.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <Page :title="`${currentRoutingInformation?.name}详情`">
  3. <template v-slot:body>
  4. <!-- 商机 -->
  5. <template v-if="currentRoutingInformation?.key == 'business'">
  6. <Business />
  7. </template>
  8. <!-- 线索 -->
  9. <template v-if="currentRoutingInformation?.key == 'thread'">
  10. <Thread />
  11. </template>
  12. <!-- 客户 -->
  13. <template v-if="currentRoutingInformation?.key == 'customer'">
  14. <Customer />
  15. </template>
  16. <!-- 联系人 -->
  17. <template v-if="currentRoutingInformation?.key == 'contacts'">
  18. <Contacts />
  19. </template>
  20. <!-- 任务 -->
  21. <template v-if="currentRoutingInformation?.key == 'tasks'">
  22. <Tasks />
  23. </template>
  24. <!-- 产品管理 -->
  25. <template v-if="currentRoutingInformation?.key == 'product'">
  26. <Product />
  27. </template>
  28. <!-- 合同管理 -->
  29. <template v-if="currentRoutingInformation?.key == 'contract'">
  30. <Contract />
  31. </template>
  32. <!-- 销售订单 -->
  33. <template v-if="currentRoutingInformation?.key == 'order'">
  34. <Order />
  35. </template>
  36. </template>
  37. </Page>
  38. </template>
  39. <script setup>
  40. import { ref } from 'vue';
  41. import { useLifecycle } from '@hooks/useCommon.js';
  42. import useRouterStore from "@store/useRouterStore.js";
  43. import Business from "@pages/pageComponents/business/detail.vue"
  44. import Thread from "@pages/pageComponents/thread/detail.vue"
  45. import Customer from "@pages/pageComponents/customer/detail.vue"
  46. import Contacts from "@pages/pageComponents/contacts/detail.vue"
  47. import Tasks from "@pages/pageComponents/tasks/detail.vue"
  48. import Product from "@pages/pageComponents/product/detail.vue"
  49. import Contract from "@pages/pageComponents/contract/detail.vue"
  50. import Order from "@pages/pageComponents/order/detail.vue"
  51. const router = useRouterStore()
  52. const queryParameters = ref({})
  53. const currentRoutingInformation = ref({})
  54. function reloadListData(data) {
  55. const { routerInfo = '', parameter = '' } = data
  56. queryParameters.value = JSON.parse(parameter)
  57. currentRoutingInformation.value = JSON.parse(routerInfo)
  58. }
  59. useLifecycle({
  60. load: () => {
  61. router.on('detailParameter', (data) => {
  62. reloadListData(data)
  63. })
  64. }
  65. });
  66. </script>
  67. <style lang='scss' scoped>
  68. /* 样式代码 */
  69. </style>