refactor: dashboard sq-text loss blur

This commit is contained in:
wangjiahao
2025-07-21 14:47:38 +08:00
parent 9c23895fc6
commit 1c8e768ea6
3 changed files with 12 additions and 10 deletions
+5 -1
View File
@@ -38,7 +38,11 @@ export const dashboardStore = defineStore('dashboard', {
setFullscreenFlag(val: boolean) {
this.fullscreenFlag = val
},
setCurComponent(value: any) {
setCurComponent: function (value: any) {
if (!value && this.curComponent) {
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
this.curComponent.editing = false
}
this.curComponent = value
this.curComponentId = value && value.id ? value.id : null
},
@@ -735,10 +735,13 @@ function containerMouseDown(e: MouseEvent) {
infoBox.value.startX = e.pageX
infoBox.value.startY = e.pageY
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
if (curComponent.value?.component !== 'SQText') {
e.preventDefault()
e.stopPropagation()
}
// if (curComponent.value?.component !== 'SQText') {
// e.preventDefault()
// e.stopPropagation()
// }
e.preventDefault()
e.stopPropagation()
}
function getNowPosition(addSizeX: number, addSizeY: number, moveXSize: number, moveYSize: number) {
@@ -65,11 +65,6 @@ const init = reactive({
menubar: false,
placeholder: '',
inline: true,
setup: function (editor: any) {
editor.on('blur', function () {
configItem.value.editing = false
})
},
})
const isDisabled = computed(() => props.disabled || !configItem.value.editing)