info.vue 1.23 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
<template>
  <div class="infoheader">
    <el-collapse v-model="activeNames"  @change="handleChange">
      <div v-for="(item, index) in helpData" :key="item.id">
        <el-collapse-item :title="(index + 1) + '. ' + (isChinese ? item.titleZh : item.titleEn)" :name="index">
          <div v-html="isChinese ? item.contentZh : item.contentEn" class="img"></div>
        </el-collapse-item>
      </div>
    </el-collapse>
  </div>
</template>

<script>
import {getInternalHelpDoc, getInternalHelpDocPage} from "@/api/system/internalHelpDoc";
export default {
  data() {
    return {
      activeNames: [],
      helpData: []
    }
  },
  created() {
    getInternalHelpDocPage({ pageNo: 1, pageSize: 100 }).then((r) => {
      this.helpData = r.data.list
    })
  },
  methods: {
    handleChange(val) {
      console.log(val)
      if (val.length > 0 &&!this.helpData[val].contentZh && !this.helpData[val].contentEn){
        getInternalHelpDoc(this.helpData[val].id).then(r => {
          this.$set(this.helpData, val, r.data)
        })
      }
    }
  },
  computed:{
    isChinese(){
      return this.$i18n.locale === 'zh_CN'
    }
  },
}
</script>

<style scoped>
  .infoheader{
    padding:20px
  }
  ::v-deep img{
    max-width: 100%;
  }
</style>