|
@@ -127,14 +127,22 @@
|
|
|
</DropdownMenu>
|
|
|
</Dropdown>
|
|
|
</span>
|
|
|
-
|
|
|
+ </div>
|
|
|
+ <div class="syllabus-content-tab">
|
|
|
+ <span class="tab-item" @click="onChooseTab('item')">
|
|
|
+ <span :class="['label',activeContentTab === 'item' ? 'label-active' : '']">{{ $t('syllabus.type2') }}({{ Math.max(nodeItems.length,0) }})</span>
|
|
|
+ </span>
|
|
|
+ <span class="tab-item" @click="onChooseTab('other')">
|
|
|
+ <span :class="['label',activeContentTab === 'other' ? 'label-active' : '']">{{ $t('syllabus.type6') }}({{ Math.max(curNode.rnodes.length - nodeItems.length,0) }})</span>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<div class="syllabus-tree-box">
|
|
|
- <EmptyData v-if="curNode.rnodes && !curNode.rnodes.length"></EmptyData>
|
|
|
- <div class="node-resource-box" v-else>
|
|
|
- <draggable class="list-group" tag="div" v-model="curNode.rnodes" v-bind="dragOptions" @end="onDragFilesEnd">
|
|
|
+ <EmptyData v-show="!tabResources.length" :top="220"></EmptyData>
|
|
|
+ <div class="node-resource-box" v-show="tabResources.length">
|
|
|
+ <ExerciseList :propsList="nodeItems" ref="exList" :examScope="isFullList" isAnalysis hasSas v-show="activeContentTab==='item'"></ExerciseList>
|
|
|
+ <draggable class="list-group" tag="div" v-model="tabResources" v-bind="dragOptions" @end="onDragFilesEnd" v-show="activeContentTab!=='item'">
|
|
|
<transition-group type="transition" :name="!drag ? 'flip-list' : null">
|
|
|
- <div class="node-resource-item" v-for="(item,index) in curNode.rnodes" :key="index" @click="onPreview(item)" :title="item.title">
|
|
|
+ <div class="node-resource-item" v-for="(item,index) in tabResources" :key="index" @click="onPreview(item)" :title="item.title">
|
|
|
<img src="../../assets/source/image.png" v-if="item.type === 'image'" />
|
|
|
<img src="../../assets/source/word.png" v-else-if="item.type === 'doc' && docType.includes(getSuffix(item.title))" />
|
|
|
<img src="../../assets/source/excel.png" v-else-if="item.type === 'doc' && excelType.includes(getSuffix(item.title))" />
|
|
@@ -395,6 +403,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ tabResources: [],
|
|
|
importPercent: 0,
|
|
|
isImporting: false,
|
|
|
newVolumeName: '',
|
|
@@ -486,11 +495,13 @@ export default {
|
|
|
flatArr: [],
|
|
|
myCreateChapters: [],
|
|
|
isSaveSyllabus: false,
|
|
|
+ nodeItems: [],
|
|
|
qrConfig: {
|
|
|
title: this.$t('syllabus.shareSyllabus'),
|
|
|
url: '',//二维码内容 不用转短网址,组件内部处理
|
|
|
shareContent: '',//复制链接内容,支持字符串模板,如果包含网址需要处理好短网址
|
|
|
},
|
|
|
+ activeContentTab: 'item',
|
|
|
shareQrModal: false,
|
|
|
targetId: null,
|
|
|
fieldArr: ['記憶记忆1', '理解2', '應用应用3', '分析4', '评价評鑒5', '创造創造6'],
|
|
@@ -523,6 +534,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onChooseTab(tab) {
|
|
|
+ this.activeContentTab = tab
|
|
|
+ this.tabResources = tab === 'item' ? this.nodeItems : this.curNode.rnodes.filter(i => i.type !== 'item')
|
|
|
+ console.error('onChooseTab', this.nodeItems, this.tabResources, this.curNode.rnodes)
|
|
|
+ },
|
|
|
onDownloadTemp(val) {
|
|
|
const fileUrl = this.files[val].link
|
|
|
console.log(this.$evTools.getBlobHost() + fileUrl)
|
|
@@ -800,6 +816,7 @@ export default {
|
|
|
this.gradeList = schoolBaseInfo.period[periodIndex].grades;
|
|
|
this.subjectList = schoolBaseInfo.period[periodIndex].subjects;
|
|
|
this.semesterList = schoolBaseInfo.period[periodIndex].semesters;
|
|
|
+ console.error('xxxxxxxxxxxxxxxx===getSchoolInfo', this.volumeList)
|
|
|
this.getVolumeList(true)
|
|
|
}
|
|
|
}
|
|
@@ -823,8 +840,7 @@ export default {
|
|
|
/* 提取富文本内容中的文本 */
|
|
|
async getItemSimpleText(item, sas) {
|
|
|
try {
|
|
|
- let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + item.cntr + item
|
|
|
- .link + sas)
|
|
|
+ let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + item.cntr + item.link + sas)
|
|
|
let itemJson = JSON.parse(indexJsonFile)
|
|
|
return itemJson.item[0].question.replace(/<[^>]+>/g, "") //去掉所有的html标记
|
|
|
} catch (e) {
|
|
@@ -868,12 +884,15 @@ export default {
|
|
|
}
|
|
|
this.hasModify = false
|
|
|
this.activeVolumeIndex = 0
|
|
|
+ console.error('xxxxxxxxxxxxxxxx===onChangeSyllabusTab')
|
|
|
+
|
|
|
type === 'fromCreate' ? this.getVolumeList(true) : this.getShareVolumeList(true)
|
|
|
},
|
|
|
/* 获取册别列表 */
|
|
|
getVolumeList(needRefresh) {
|
|
|
// 如果当前学校没有科目信息 直接返回
|
|
|
if (this.isSchool && !this.subjectList.length) return
|
|
|
+
|
|
|
this.isLoading = true
|
|
|
this.treeOrigin = []
|
|
|
this.curNode = {
|
|
@@ -1032,7 +1051,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- console.log(volume);
|
|
|
if (volume && volume.id !== this.curVolume.id) {
|
|
|
sessionStorage.removeItem('highlightId')
|
|
|
}
|
|
@@ -1396,15 +1414,35 @@ export default {
|
|
|
let itemNodeArr = data.data.rnodes.filter(i => i.type === 'item')
|
|
|
if (itemNodeArr.length) {
|
|
|
let sas = await this.$evTools.getBlobPrivateSas(itemNodeArr[0].cntr)
|
|
|
+ let promiseArr = []
|
|
|
+ // 获取关联的试题数据
|
|
|
itemNodeArr.forEach(async item => {
|
|
|
- item.title = await this.getItemSimpleText(item, sas)
|
|
|
+ promiseArr.push(new Promise(async (r, j) => {
|
|
|
+ let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + item.cntr + item.link + sas)
|
|
|
+ let jsonData = JSON.parse(indexJsonFile)
|
|
|
+ jsonData.exercise.question = jsonData.item[0].question
|
|
|
+ jsonData.exercise.option = jsonData.item[0].option
|
|
|
+ jsonData.exercise.id = jsonData.id
|
|
|
+ jsonData.exercise.pid = jsonData.pid
|
|
|
+ jsonData.exercise = await this.$evTools.doAddHost(jsonData.exercise, null, null, true)
|
|
|
+ r(jsonData.exercise)
|
|
|
+ }))
|
|
|
+ })
|
|
|
+ Promise.all(promiseArr).then(result => {
|
|
|
this.curNode = data.data
|
|
|
+ this.nodeItems = result
|
|
|
+ console.error(this.nodeItems)
|
|
|
+ this.onChooseTab('item')
|
|
|
})
|
|
|
} else {
|
|
|
+ this.nodeItems = []
|
|
|
this.curNode = data.data
|
|
|
+ this.onChooseTab('item')
|
|
|
}
|
|
|
} else {
|
|
|
this.curNode = data.data
|
|
|
+ this.tabResources = []
|
|
|
+ this.nodeItems = []
|
|
|
}
|
|
|
console.log('当前点击节点数据 ==== ', data.data.title, data.data.rnodes)
|
|
|
},
|
|
@@ -2700,6 +2738,8 @@ export default {
|
|
|
handler(n, o) {
|
|
|
if (n.length === 0) {
|
|
|
this.treeOrigin = []
|
|
|
+ this.nodeItems = []
|
|
|
+ this.tabResources = []
|
|
|
this.curNode = {
|
|
|
id: '',
|
|
|
rnodes: []
|
|
@@ -2711,9 +2751,13 @@ export default {
|
|
|
'$store.state.user.curPeriod': {
|
|
|
deep: true,
|
|
|
immediate: true,
|
|
|
- handler(n, o) {
|
|
|
+ handler(n, old) {
|
|
|
if (n && this.$route.name === 'syllabus') {
|
|
|
- this.getSchoolInfo(n.periodIndex)
|
|
|
+ this.nodeItems = []
|
|
|
+ this.tabResources = []
|
|
|
+ if (old && old.id) {
|
|
|
+ this.getSchoolInfo(n.periodIndex)
|
|
|
+ }
|
|
|
this.currentPeriodIndex = n.periodIndex
|
|
|
}
|
|
|
}
|