<template>
  <div>
    <h3 class="see-title">{{ name }}</h3>
    <ul>
      <li>创建人：{{ creatby }}</li>
      <li>坐席组：{{ groupCode }}</li>
      <li>ivr类型：{{ ivrType }}</li>
      <li>是否启用：{{ isenble }}</li>
      <li>创建时间：{{ creatTime }}</li>
    </ul>
    <hr>
    <div class="centents">
      <p class="words-title">IVR内容</p>
      <div class="centents-con">
        <pre>{{ ivrContent }}</pre>
      </div>
    </div>
  </div>
</template>
<script>
import { getIVRConfigure } from '@/api/telCall/ivrConfigureManage'
export default {
  name: 'SeeIvrConfigure',
  props: {
    rowid: {
      type: String,
      default: ''
    },
    layerid: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      name: 'ivr名称',
      creatby: '8000',
      groupCode: '咨询组',
      ivrType: '呼入',
      isenble: '启用',
      creatTime: '2018-10-30',
      ivrContent: ''
    }
  },
  created() {
    if (this.rowid) {
      this.getDetail(this.rowid)
    }
  },
  methods: {
    // 获取详情
    getDetail(rid) {
      getIVRConfigure(rid).then(response => {
        if (response.state.toLowerCase() === 'success') {
          const res = response.data
          this.name = res.ivrname
          this.creatby = res.createbyuser
          this.groupCode = res.groupname
          if (res.isenable === 1) {
            this.isenble = '启用'
          } else {
            this.isenble = '不启用'
          }

          if (res.ivrtype === 1) {
            this.ivrType = '呼入'
          } else if (res.ivrtype === 2) {
            this.ivrType = '满意度'
          } else {
            this.ivrType = '自动外呼'
          }
          this.creatTime = res.createtime
          this.ivrContent = res.ivrcontent
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
@import "src/../../../../styles/mixin.scss";
.centents-con {
  padding: 0 15px;
}
.see-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  padding: 10px 0 20px 0;
  margin: 0;
}
hr {
  margin-top: 20px;
  margin-bottom: 20px;
  border: 0;
  border-top: 1px solid #eee;
}
ul {
  @include clearfix;
  list-style: none;
  padding: 10px 0 0 0;
  font-size: 13px;
  color: #676a6c;
  li {
    float: left;
    width: 33.3333%;
    margin-bottom: 10px;
  }
}
.words-title {
  font-size: 14px;
  color: #7a7a7a;
  margin-bottom: 10px;
  font-weight: 600;
}
</style>

