|
@@ -1,5 +1,14 @@
|
|
|
<template>
|
|
|
<div class="record-container">
|
|
|
+ <div class="exam-action-wrap">
|
|
|
+ <span>
|
|
|
+ <Tooltip :max-width="180" :content="$t('cusMgt.autoShareTips')">
|
|
|
+ <Icon type="ios-information-circle-outline" />
|
|
|
+ </Tooltip>
|
|
|
+ {{$t('cusMgt.autoShare')}}
|
|
|
+ </span>
|
|
|
+ <i-switch :loading="sLoading" v-model="isAuto" size="small" @on-change="setAutoPublish" />
|
|
|
+ </div>
|
|
|
<vuescroll>
|
|
|
<Alert v-show="rcdParams.scope == 'private'" show-icon type="warning" closable>
|
|
|
{{$t('cusMgt.recordTips')}}
|
|
@@ -96,6 +105,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
import RcdPoster from "../../homepage/RcdPoster.vue"
|
|
|
export default {
|
|
|
components: {
|
|
@@ -117,13 +127,47 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isAuto: false,//是否自动发布课堂记录
|
|
|
+ sLoading: false,
|
|
|
btnLoading: false,
|
|
|
editName: '',
|
|
|
recordList: [],
|
|
|
editRdStatus: false,
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ lessonShow: 'user/getTeacherLessonShow',//是否自动发布课堂记录
|
|
|
+ }),
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ //切换是否自动发布课堂记录
|
|
|
+ setAutoPublish() {
|
|
|
+ this.sLoading = true
|
|
|
+ let show = this.lessonShow
|
|
|
+ if (this.isAuto) {
|
|
|
+ show.push('student')
|
|
|
+ } else {
|
|
|
+ let index = show.findIndex(item => item === 'student')
|
|
|
+ if (index > -1) show.splice(index, 1)
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ "opt": "UpdateLessonShow",
|
|
|
+ "lessonShow": show
|
|
|
+ }
|
|
|
+ this.$api.schoolUser.setTeacherInfo(params).then(
|
|
|
+ res => {
|
|
|
+ this.$Message.success(this.$t('teachermgmt.setOk'))
|
|
|
+ this.$store.commit('user/setLessonShow', show)
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('teachermgmt.setErr'))
|
|
|
+ this.isAuto = !this.isAuto
|
|
|
+ }
|
|
|
+ ).finally(() => {
|
|
|
+ this.sLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
//分享、取消分享给学生
|
|
|
toggleShare(data) {
|
|
|
if (data && data.id) {
|
|
@@ -348,6 +392,18 @@ export default {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ },
|
|
|
+ lessonShow: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(n, o) {
|
|
|
+ console.log(typeof n)
|
|
|
+ if (n && Array.isArray(n)) {
|
|
|
+ this.isAuto = n.includes('student')
|
|
|
+ } else {
|
|
|
+ this.isAuto = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|