detail.vue 642 B

123456789101112131415161718192021222324252627282930
  1. <script setup>
  2. import { ref } from "vue";
  3. import { onLoad } from "@dcloudio/uni-app";
  4. import Form from "./components/form.vue";
  5. // 当前查看的任务 id
  6. const id = ref(null);
  7. // 从路由参数读取详情 id
  8. onLoad((options) => {
  9. id.value = Number(options.id) || null;
  10. });
  11. </script>
  12. <template>
  13. <view class="page">
  14. <scroll-view scroll-y="true" style="height: 100%">
  15. <!-- 详情页复用同一表单组件,只读展示 -->
  16. <Form type="detail" :id="id"></Form>
  17. </scroll-view>
  18. </view>
  19. </template>
  20. <style lang="scss" scoped>
  21. @import "@/style/work-order-segmented.scss";
  22. .page {
  23. padding-bottom: 0;
  24. }
  25. </style>