华西海圻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.

78 lines
1.5 KiB

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