<template>
  <div class="study-syxx">
    <div class="syxx-top" v-show="!showDetail" style="margin-bottom: 10px;">
      <div class="syxx-operate">
        <div class="operate-img"></div>
        <div class="operate-left">{{ $t('page.business.study.studyFormPlan.syxx') }}</div>
      </div>
      <el-form ref="form" label-width="90px">
        <el-row>
          <el-col :span="6">
            <el-form-item :label="$t('page.business.study.studyFormPlan.symc')">
              {{ studyInfo.name }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('page.business.study.studyFormPlan.sybh')">
              {{ studyInfo.sn }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('page.business.study.studyFormPlan.syfzr')">
              {{ studyInfo.leaderName }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('page.business.study.studyFormPlan.cjsj')">
              {{ studyInfo.createTime }}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="syxx-content">
    </div>

  </div>
</template>

<script>
import { checkPermi, checkRole } from "@/utils/permission";
import { study_info } from "@/api/business/study/study"
import { studySubject_listByStudyId } from '@/api/business/study/studySubject'
export default {
  name: 'StudyWzlb',
  props: {
    study: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  watch: {
    study: {
      immediate: true,
      handler(v) {
        this.studyId = v.id
        this.getStudyInfo()
      }
    },
  },
  components: {  },
  data() {
    return {
      showDetail: false,
      studyId: '',
      studyInfo:{},
      subjectList: []
    }
  },
  created() {
  },
  methods: {
    checkPermi,
    checkRole,
    getstudySubject() {
      studySubject_listByStudyId({ studyId: this.studyId }).then(response => {
        this.subjectList = response.data;
      }).finally(() => {
        this.$modal.closeLoading()
      })
    },
    getStudyInfo() {
      this.$modal.loading()
      study_info({ id: this.studyId }).then(response => {
        this.studyInfo = response.data
        this.getstudySubject()
      }).finally(() => {
        this.$modal.closeLoading()
      })
    },
    showDetailCallback(val) {
      this.showDetail = val
      this.$emit('showDetail', val)
    }
  }
}
</script>
<style lang="scss" scoped>
.study-syxx {

  .syxx-top {
    background: #fff;
    padding: 20px;
    width: 100%;

    .syxx-operate {
      margin: 0px 0 10px 0;
      display: flex;
      flex-direction: row;
      align-items: center;
      color: #409eff;

      .operate-img {
        flex-shrink: 0;
        height: 15px;
        background: #409eff;
        width: 3px;
      }

      .operate-left {
        flex-shrink: 0;
        font-weight: bold;
        padding-left: 10px;
      }

      .operate-right {
        flex-grow: 1;
        text-align: right;

        .operate-icon {
          cursor: pointer;
        }
      }
    }
  }

  .syxx-content {
    
  }
}
</style>
