Merge pull request 'zdg' (#233) from zdg into main

Reviewed-on: #233
This commit is contained in:
zhengdegang 2024-09-20 13:54:51 +08:00
commit 7da4defed4
3 changed files with 14 additions and 8 deletions

View File

@ -89,6 +89,8 @@ const userStore = useUserStore()
const visible = ref(false) // const visible = ref(false) //
const myClassActive = ref({}) // APT const myClassActive = ref({}) // APT
const imChatRef = ref(null) // im-chat ref const imChatRef = ref(null) // im-chat ref
const emit = defineEmits(['close'])
const classForm = reactive({ // () const classForm = reactive({ // ()
form: {}, itemOption: [], option: {} form: {}, itemOption: [], option: {}
}) })
@ -137,6 +139,7 @@ const handleClose = async () => {
reset() // reset() //
await chat?.logout() await chat?.logout()
chat = null chat = null
emit('close')
} }
// - // -
const initData = () => { const initData = () => {

View File

@ -52,8 +52,8 @@
</div> </div>
</div> </div>
<div class="prepare-body-main-item-btn"> <div class="prepare-body-main-item-btn">
<el-button v-if="activeClassId==item.id" type="success" @click="clickStartClass(item)">上课中</el-button> <!-- <el-button v-if="activeClassId==item.id" type="success" @click="clickStartClass(item)">上课中</el-button> -->
<el-button v-else type="primary" @click="clickStartClass(item)">上课</el-button> <el-button type="primary" @click="clickStartClass(item)">上课</el-button>
</div> </div>
<div class="prepare-body-main-item-tool"> <div class="prepare-body-main-item-tool">
<el-popover <el-popover
@ -74,7 +74,7 @@
</el-button> </el-button>
</div> </div>
<div class="item-popover-item"> <div class="item-popover-item">
<el-button text @click="deleteTalk(item)" :disabled="activeClassId==item.id"> <el-button text @click="deleteTalk(item)">
<i class="iconfont icon-shanchu"></i> <i class="iconfont icon-shanchu"></i>
<span>删除</span> <span>删除</span>
</el-button> </el-button>

View File

@ -20,7 +20,6 @@
:key="index" :key="index"
:item="item" :item="item"
:index="index" :index="index"
:activeClassId="activeClass?.id"
@on-delete="deleteTalk" @on-delete="deleteTalk"
@on-start-class="startClass" @on-start-class="startClass"
> >
@ -161,7 +160,7 @@
@add-success="initReserv" @add-success="initReserv"
></reserv> ></reserv>
<!-- 上课配置 --> <!-- 上课配置 -->
<class-start ref="calssRef"/> <class-start ref="calssRef" @close="closeChange"/>
</template> </template>
<script setup> <script setup>
import { Check,Plus } from '@element-plus/icons-vue' import { Check,Plus } from '@element-plus/icons-vue'
@ -305,10 +304,10 @@ export default {
methods: { methods: {
startClass(item) { startClass(item) {
// console.log(item, sessionStore) // console.log(item, sessionStore)
if(item.fileFlag === '课件') {
// () // ()
const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null
if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作') if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作')
if(item.fileFlag === '课件') {
this.openReserv() this.openReserv()
} }
if(item.fileFlag === 'apt') { if(item.fileFlag === 'apt') {
@ -319,6 +318,10 @@ export default {
sessionStore.set('activeClass', item) sessionStore.set('activeClass', item)
this.activeClass = item this.activeClass = item
}, },
closeChange() { // -
this.activeClass = null
sessionStore.delete('activeClass')
},
initReserv(id) { initReserv(id) {
getClassInfo(id).then((res) => { getClassInfo(id).then((res) => {
this.curClassReserv = res.data this.curClassReserv = res.data