华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.5 KiB

  1. <!-- 饲养间使用管理 -->
  2. <template>
  3. <div class="study-tbbd">
  4. <div class="tbbd-left" v-show="!showDetail">
  5. <sbject :study="study" @change="changeSubject" />
  6. </div>
  7. <div class="tbbd-right" v-if="studyInfo.studySubjectId != ''">
  8. <syjList :study="studyInfo" @showDetail="showDetailCallback" />
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. import sbject from './suject.vue'
  14. import syjList from './syjList.vue'
  15. export default {
  16. name: 'StudySyj',
  17. props: {
  18. study: {
  19. type: Object,
  20. default: () => {
  21. return {}
  22. }
  23. }
  24. },
  25. watch: {
  26. study: {
  27. immediate: true,
  28. handler(v) {
  29. this.studyInfo = {
  30. studyId: v.id,
  31. studyLeader: v.leader,
  32. studySubjectId: ''
  33. }
  34. },
  35. deep: true,
  36. },
  37. },
  38. components: { sbject, syjList },
  39. computed: {},
  40. filters: {},
  41. data() {
  42. return {
  43. showDetail: false,
  44. studyInfo: {
  45. studyId: this.study.id,
  46. studyLeader: this.study.leader,
  47. studySubjectId: ''
  48. }
  49. }
  50. },
  51. created() { },
  52. methods: {
  53. changeSubject(val) {
  54. this.studyInfo.studySubjectId = val
  55. },
  56. showDetailCallback(val) {
  57. this.showDetail = val
  58. this.$emit('showDetail', val)
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .study-tbbd {
  65. display: flex;
  66. flex-direction: row;
  67. .tbbd-left {
  68. background: #fff;
  69. padding: 20px;
  70. margin-right: 10px;
  71. flex-shrink: 0;
  72. width: 350px;
  73. }
  74. .tbbd-right {
  75. flex-grow: 1;
  76. overflow: hidden;
  77. }
  78. }
  79. </style>