|
@@ -1,4 +1,4 @@
|
|
|
- <style lang="less" scoped>
|
|
|
+<style lang="less" scoped>
|
|
|
@import './Index.less';
|
|
|
</style>
|
|
|
|
|
@@ -49,7 +49,7 @@
|
|
|
:key="index"
|
|
|
@click="hasModify ? handleConfirmSave({index},'2') : handleSubjectTap(index)">
|
|
|
<p class="gl-item-name">{{item.subjectName}}</p>
|
|
|
- <p class="gl-item-info"><span></span>册别数:{{ 0 }}</p>
|
|
|
+ <p class="gl-item-info"><span></span>册别数:{{ tabIndex === 0 ? schoolVolCount[index] : privateVolCount[index]}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</vuescroll>
|
|
@@ -65,7 +65,7 @@
|
|
|
<span style="margin-left:5px">册别</span>
|
|
|
</span>
|
|
|
<div>
|
|
|
- <Icon type="md-add" v-if="$access.can('admin.*|Volumn_Add') || tabIndex === 1" color="#fff" size="18" style="cursor:pointer;margin-right:10px" @click="onAddVolume" />
|
|
|
+ <Icon type="md-add" v-if="$access.can('admin.*|Volumn_Add') || tabIndex === 1" color="#fff" size="18" style="cursor:pointer;margin-right:10px" @click="onAddVolume" />
|
|
|
<Poptip title="筛选册别" placement="bottom-end" @on-popper-show="onPopperShow" v-show="volumeList.length">
|
|
|
<Icon type="ios-funnel" color="#fff" size="18" style="cursor:pointer;margin-right:10px" />
|
|
|
<div class="funnel-box" slot="content">
|
|
@@ -112,9 +112,9 @@
|
|
|
<Icon type="md-folder" title="内容资源数" style="margin-left:0" /> {{ item.itemCount }}
|
|
|
<Icon type="md-cube" title="关联知识点数" /> {{ item.resourceCount }}
|
|
|
</div>
|
|
|
- <span class="btn-edit" v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="编辑" @click.stop="onEditVolume(item)"><Icon type="md-create" size="20" color="#d2d2d2" /></span>
|
|
|
- <span class="btn-users" v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="共编使用者管理" @click.stop="onEditEditors(item)"><Icon type="md-people" size="22" color="#d2d2d2" /></span>
|
|
|
- <span class="btn-delete" v-if="$access.can('admin.*|Volumn_Delete') || tabIndex === 1" title="删除" @click.stop="onDeleteVolume(item)"><Icon type="md-trash" size="22" color="#d2d2d2" /></span>
|
|
|
+ <span class="btn-edit" v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="编辑" @click.stop="onEditVolume(item)"><Icon type="md-create" size="20" color="#d2d2d2" /></span>
|
|
|
+ <span class="btn-users" v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="共编使用者管理" @click.stop="onEditEditors(item)"><Icon type="md-people" size="22" color="#d2d2d2" /></span>
|
|
|
+ <span class="btn-delete" v-if="$access.can('admin.*|Volumn_Delete') || tabIndex === 1" title="删除" @click.stop="onDeleteVolume(item)"><Icon type="md-trash" size="22" color="#d2d2d2" /></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -135,7 +135,7 @@
|
|
|
<!--<span class="tree-version">v1.0.0</span>-->
|
|
|
</div>
|
|
|
<div>
|
|
|
- <Button @click="onSaveSyllabus" :disabled="!hasModify" v-if="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1">存储变更</Button>
|
|
|
+ <Button @click="onSaveSyllabus" :disabled="!hasModify" v-if="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1">存储变更</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Tree :volume="currentVolume" :treeData="treeData" ref="treeRef" :editable="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1" @onTreeUpdate="onTreeUpdate"></Tree>
|
|
@@ -161,7 +161,7 @@
|
|
|
<Modal v-model="isEditEditors" width="760" footer-hide class="add-volume-modal">
|
|
|
<div class="modal-header" slot="header">共编使用者管理</div>
|
|
|
<div class="modal-content">
|
|
|
- <AddEditors :editVolume="editVolume" @addFinish="onFinishAddVolume"></AddEditors>
|
|
|
+ <AddEditors :editVolume="editVolume" @addFinish="onFinishAddVolume"></AddEditors>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
|
|
@@ -192,12 +192,15 @@
|
|
|
isLoadSubject: false,
|
|
|
isLoadVolumes: false,
|
|
|
isLoadSyllabus: false,
|
|
|
+ volumnCounts: [],
|
|
|
currentPeriodIndex: null,
|
|
|
currentSubjectIndex: null,
|
|
|
currentVolume: null,
|
|
|
tabIndex: 0,
|
|
|
originData: {},
|
|
|
originSchoolData: {},
|
|
|
+ schoolVolCount: [],// 校本科目册别数量
|
|
|
+ privateVolCount: [],//个人科目册别数量
|
|
|
periodList: [],
|
|
|
gradeList: [],
|
|
|
semesterList: [],
|
|
@@ -228,9 +231,7 @@
|
|
|
},
|
|
|
created() {
|
|
|
this.initSchoolData()
|
|
|
-
|
|
|
- console.log("当前用户权限")
|
|
|
- console.log(this.$access)
|
|
|
+ this.initSyllabusCount()
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取当前学校学段学科等基本信息
|
|
@@ -249,6 +250,27 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 获取当前册别数量
|
|
|
+ initSyllabusCount() {
|
|
|
+ if (this.volumnCounts.length) {
|
|
|
+ this.schoolVolCount = this.volumnCounts[this.currentPeriodIndex].map(i => i[0])
|
|
|
+ this.privateVolCount = this.volumnCounts[this.currentPeriodIndex].map(i => i[1])
|
|
|
+ } else {
|
|
|
+ this.$api.syllabus.FindSyllabusCount({ schoolCode: this.schoolInfo.schoolCode }).then(res => {
|
|
|
+ if (!res.error) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.volumnCounts = res.result.data
|
|
|
+ this.schoolVolCount = res.result.data[this.currentPeriodIndex].map(i => i[0])
|
|
|
+ this.privateVolCount = res.result.data[this.currentPeriodIndex].map(i => i[1])
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$Message.warning('获取数据失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 根据学科获取所有册别信息
|
|
|
getVolumesData() {
|
|
|
let that = this
|
|
@@ -263,7 +285,7 @@
|
|
|
this.originVolumeList = list
|
|
|
this.handleVolumeTap(0, list.length > 0 ? list[0] : null)
|
|
|
this.searchVolume = ''
|
|
|
- setTimeout(function() {
|
|
|
+ setTimeout(function () {
|
|
|
that.isLoadVolumes = false
|
|
|
}, 400)
|
|
|
} else {
|
|
@@ -278,7 +300,7 @@
|
|
|
this.$api.syllabus.GetTreeByVolume({ volumeCode: volumeCode }).then(res => {
|
|
|
if (!res.error && res.result.data) {
|
|
|
this.treeData = res.result.data
|
|
|
- setTimeout(function() {
|
|
|
+ setTimeout(function () {
|
|
|
that.isLoadSyllabus = false
|
|
|
}, 400)
|
|
|
} else {
|
|
@@ -315,8 +337,9 @@
|
|
|
this.gradeList = this.periodList[index].grades // 切换学段后更新 年级 列表
|
|
|
this.semesterList = this.periodList[index].semesters // 切换学段后更新 学期 列表
|
|
|
this.handleSubjectTap(0)
|
|
|
+ this.initSyllabusCount()
|
|
|
this.searchSubject = ''
|
|
|
- setTimeout(function() {
|
|
|
+ setTimeout(function () {
|
|
|
that.isLoadSubject = false
|
|
|
}, 400)
|
|
|
}
|
|
@@ -324,11 +347,11 @@
|
|
|
|
|
|
// 学科点击事件
|
|
|
handleSubjectTap(index) {
|
|
|
- this.isLoadVolumes = true
|
|
|
- this.currentSubjectIndex = index
|
|
|
- this.currentParams.subjectCode = this.subjectList[index].subjectCode
|
|
|
- this.activeSubjectIndex = index
|
|
|
- this.getVolumesData()
|
|
|
+ this.isLoadVolumes = true
|
|
|
+ this.currentSubjectIndex = index
|
|
|
+ this.currentParams.subjectCode = this.subjectList[index].subjectCode
|
|
|
+ this.activeSubjectIndex = index
|
|
|
+ this.getVolumesData()
|
|
|
},
|
|
|
|
|
|
// 册别点击事件
|
|
@@ -349,6 +372,8 @@
|
|
|
this.$Message.success('册别已存在,已为您更新数据')
|
|
|
} else {
|
|
|
this.$Message.success('添加新册别成功')
|
|
|
+ this.volumnCounts = []
|
|
|
+ this.initSyllabusCount()
|
|
|
}
|
|
|
this.handleSubjectTap(this.currentSubjectIndex) // 获取最新册别数据
|
|
|
}
|
|
@@ -528,6 +553,9 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|