<template>
  <div class="Page" v-if="showPage">
    <div class="processNames">{{ detail.processName }}</div>

    <div class="types">{{ name }}</div>

    <div class="conts" v-html="detail.needToKnow"></div>
  </div>
</template>

<script>
export default {
  name: 'detail',
  components: {},
  props: {},
  data() {
    return {
      showPage: false,
      id: '',
      detail: {},
      classList: {},
      name: '',
    }
  },
  computed: {},
  watch: {},
  onLoad(option) {
    this.id = option.id
    this.getDetail()
  },
  onShow() {},
  methods: {
    getDetail() {
      this.$instance.post(`/app/approval-process-def/info-id?id=${this.id}`).then((res) => {
        if (res.code == 0) {
          this.detail = res.data
          this.typeList()
        }
      })
    },

    typeList() {
      this.$instance
        .post(`/app/zwspapprovalclassification/list-xcx`, null, {
          params: {
            current: 1,
            status: 1,
            size: 9999,
          },
        })
        .then((res) => {
          if (res.code == 0) {
            this.classList = res.data.records
            if (this.classList) {
              this.classList.map((e) => {
                if (this.detail.classificationId == e.id) {
                  this.name = e.desc
                }
              })
              this.showPage = true
            }
          }
        })
    },
  },
}
</script>

<style scoped lang="scss">
.Page {
  padding: 32px 32px 48px 32px;
  background: #fff;
  .processNames {
    font-size: 48px;
    font-weight: 600;
  }
  .types {
    padding-top: 16px;
    font-size: 30px;
    color: #999999;
  }
  .conts {
    padding-top: 64px;
    font-size: 36px;
    line-height: 64px;
  }
}
</style>
