Commit 8caf4567 authored by Marcus's avatar Marcus
parent 68b1636d
<template>
<div class="infoheader">
<el-collapse v-model="activeNames">
<div v-for="item in helpData" :key="item.id">
<el-collapse-item :title="item.titleZh" :name="item.id">
<div v-html="item.contentZh" class="img">{{ item.contentZh }}</div>
<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>
......@@ -11,7 +11,7 @@
</template>
<script>
import { getInternalHelpDocPage} from "@/api/system/internalHelpDoc";
import {getInternalHelpDoc, getInternalHelpDocPage} from "@/api/system/internalHelpDoc";
export default {
data() {
return {
......@@ -22,9 +22,23 @@ export default {
created() {
getInternalHelpDocPage({ pageNo: 1, pageSize: 100 }).then((r) => {
this.helpData = r.data.list
this.activeNames = this.helpData.map(m => { return m.id })
})
}
},
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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment