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

Reviewed-on: #389
This commit is contained in:
zhengdegang 2024-11-01 12:55:07 +08:00
commit 7d20a7ee50
3 changed files with 37 additions and 27 deletions

View File

@ -129,7 +129,7 @@ const sendHomework = (row,type) => {
}
//
const closeHomework = async() => {
ipcMsgSend('tool-sphere:set:ignore', true)
// ipcMsgSend('tool-sphere:set:ignore', true)
}

View File

@ -74,6 +74,7 @@ const list = computed(() => props.data.map((o,i) => {
onMounted(() => {
posBtnAll = btnRef.value.getBoundingClientRect()
hPost.value = Math.round(posBtnAll.height)
// btnRef.value.style.marginTop = -hPost.value / 2 + 'px'
curNode = sessionStore?.get?.('subject.curNode')
})
// === ===
@ -101,7 +102,10 @@ const clickHandel = (o, e) => {
emit('change', o)
}
const closeActive = () =>{
isVisible.value = false
if (isVisible.value) { //
isVisible.value = false
emit('change', { prop: 'close' })
}
}
defineExpose({closeActive})
</script>
@ -111,8 +115,8 @@ defineExpose({closeActive})
position: fixed;
top: 50%;
transform: translateY(-50%);
z-index: 1;
right: 10px;
//min-height: 40vh;
min-width: 4em;
border-radius: 4em;
background-color: rgba(18,18,18,0.3);

View File

@ -1,5 +1,7 @@
<template>
<div class="warp-all">
<!-- 遮罩层 -->
<div class="mask" v-show="isMask" @click="maskChange(true)"></div>
<!-- 画板 -->
<board-vue v-model="tabActive" v-show="isShow" ref="boardVueRef"></board-vue>
@ -62,7 +64,8 @@ const isDrag = ref(false) // 开始拖拽
const dragtime = ref(0) // -
const isShow = ref(false) // -
const isOver = ref(false) //
const isOpenBook = ref(false)
const isOpenBook = ref(false) // pdf
const isMask = ref(false) //
const toolStore = useToolState() //
const boardVueRef=ref(null) // ref
const upvoteRef = ref(null) // ref
@ -93,7 +96,7 @@ onMounted(async() => {
// window.test1 = toolStore
getClassInfo() // ex3
resetStatus() // -
console.log(sideVueRef.value.isVisible)
})
// ==== ===
@ -143,7 +146,7 @@ const logoHandle = (e,t) => {
// -穿
const mouseChange = (bool) => {
let resBool = false
console.log('mouseChange:', bool, resBool)
// console.log('mouseChange:', bool, resBool)
if (!bool) return setIgnore(resBool) // 穿
if (tabActive.value == 'select') resBool = !!bool
else {
@ -152,12 +155,10 @@ const mouseChange = (bool) => {
const isPdf = !resBool && toolStore.isPdfWin
if (isPdf) resBool = true
}
console.log('mouseChange:', bool, resBool)
// console.log('mouseChange:', bool, resBool)
setIgnore(resBool)
}
const touchChange = (e) => {
console.log(e)
}
// im-chat: {type, data}
const chatChange = (type, data, ...args) => {
if (type == 'createGroup') { // -
@ -189,14 +190,6 @@ const setIgnore = (bool) => {ipcMsgSend('tool-sphere:set:ignore', bool)}
// : |
const resetStatus = () => {
if (toolStore.isToolWin) return // -
// -
// ipcMain?.removeHandler('tool-sphere:reset') //
// ipcMain?.handle?.('tool-sphere:reset', () => {
// setTimeout(() => {
// boardVueRef.value.handleMode(tabActive.value)
// mouseChange(1)
// }, 500)
// })
toolStore.isToolWin = true //
}
// :
@ -206,15 +199,10 @@ const sideMouse = e => {
setIgnore(false) // -穿
return
}
mouseChange(type == 'mouseleave')
// //
// if (type == 'mouseleave') {
// timingSide = setTimeout(() => {
// sideVueRef.value.closeActive()
// }, 500)
// } else { //
// if (!!timingSide) clearTimeout(timingSide)
// }
//
const bool = isMask.value && type =='mouseleave'
if (bool) mouseChange(false) // 穿
else mouseChange(type == 'mouseleave')
}
// :
const sideChange = async o => {
@ -230,7 +218,11 @@ const sideChange = async o => {
isOpenBook.value = true
}
break
case 'close': //
maskChange(false)
break
case 'resource': //
isMask.value = !isMask.value
break
case 'interact': //
break
@ -267,6 +259,13 @@ const sideChange = async o => {
}
}
// -
const maskChange = (bool) => {
isMask.value = false
bool && sideVueRef.value.closeActive() //
mouseChange(true) // 穿
}
// === ===
watchEffect(() => {
if (isOver.value) return // ,
@ -286,6 +285,12 @@ watchEffect(() => {
.warp-all{
position: relative;
}
//
.mask{
position: fixed;
inset: 0;
background: rgba(1, 1, 1, 0.3);
}
//
.tool-bottom-all{
// width: 45vw;
@ -328,6 +333,7 @@ watchEffect(() => {
}
}
}
//
.a-fade-leave-active,.a-fade-enter-active{
transition: all .3s;
}