forked from github/dataease
fix: 自定义SQL编辑页无法调节左侧侧边栏宽度 #6535
This commit is contained in:
parent
303be6026e
commit
674b3fbe66
@ -159,6 +159,18 @@ const calculateHeight = (e: MouseEvent) => {
|
|||||||
dragHeight.value = e.pageY - 164
|
dragHeight.value = e.pageY - 164
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const calculateWidth = (e: MouseEvent) => {
|
||||||
|
if (e.pageX < 240) {
|
||||||
|
LeftWidth.value = 240
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (e.pageX > 400) {
|
||||||
|
LeftWidth.value = 400
|
||||||
|
return
|
||||||
|
}
|
||||||
|
LeftWidth.value = e.pageX
|
||||||
|
}
|
||||||
|
|
||||||
const insertParamToCodeMirror = (value: string) => {
|
const insertParamToCodeMirror = (value: string) => {
|
||||||
codeCom.value.dispatch({
|
codeCom.value.dispatch({
|
||||||
changes: { from: 0, to: codeCom.value.state.doc.toString().length, insert: '' }
|
changes: { from: 0, to: codeCom.value.state.doc.toString().length, insert: '' }
|
||||||
@ -329,6 +341,7 @@ const copyInfo = async (value: string) => {
|
|||||||
|
|
||||||
const mouseupDrag = () => {
|
const mouseupDrag = () => {
|
||||||
const dom = document.querySelector('.sql-eidtor')
|
const dom = document.querySelector('.sql-eidtor')
|
||||||
|
dom.removeEventListener('mousemove', calculateWidth)
|
||||||
dom.removeEventListener('mousemove', calculateHeight)
|
dom.removeEventListener('mousemove', calculateHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +390,7 @@ const saveVariable = () => {
|
|||||||
ElMessage.success('参数设置成功')
|
ElMessage.success('参数设置成功')
|
||||||
}
|
}
|
||||||
const mousedownDrag = () => {
|
const mousedownDrag = () => {
|
||||||
document.querySelector('.sql-eidtor').addEventListener('mousemove', calculateHeight)
|
document.querySelector('.sql-eidtor').addEventListener('mousemove', calculateWidth)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user