mirror of
https://gitee.com/dromara/go-view.git
synced 2024-11-30 02:38:30 +08:00
fix: 去除定时存储数据的逻辑
This commit is contained in:
parent
afc6cf04a1
commit
2f43ddd59b
@ -330,3 +330,23 @@ export const JSONParse = (data: string) => {
|
||||
export const setTitle = (title?: string) => {
|
||||
title && (document.title = title)
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理网页关闭事件
|
||||
*/
|
||||
export const addWindowUnload = () => {
|
||||
// 关闭网页出现离开提示
|
||||
window.onbeforeunload = function (e) {
|
||||
e = e || window.event
|
||||
// 兼容IE8和Firefox 4之前的版本
|
||||
if (e) {
|
||||
e.returnValue = '您确定要离开当前页面吗?请确认是否保存数据!'
|
||||
}
|
||||
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
|
||||
return '您确定要离开当前页面吗?请确认是否保存数据!'
|
||||
}
|
||||
// 返回销毁事件函数
|
||||
return () => {
|
||||
window.onbeforeunload = null
|
||||
}
|
||||
}
|
@ -87,7 +87,14 @@ import { onMounted, computed, provide } from 'vue'
|
||||
import { chartColors } from '@/settings/chartThemes/index'
|
||||
import { MenuEnum } from '@/enums/editPageEnum'
|
||||
import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
|
||||
import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle, colorCustomMerge } from '@/utils'
|
||||
import {
|
||||
animationsClass,
|
||||
getFilterStyle,
|
||||
getTransformStyle,
|
||||
getBlendModeStyle,
|
||||
colorCustomMerge,
|
||||
addWindowUnload
|
||||
} from '@/utils'
|
||||
import { useContextMenu } from '@/views/chart/hooks/useContextMenu.hook'
|
||||
import { MenuOptionsItemType } from '@/views/chart/hooks/useContextMenu.hook.d'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
@ -110,6 +117,9 @@ const chartEditStore = useChartEditStore()
|
||||
const { handleContextMenu } = useContextMenu()
|
||||
const { dataSyncFetch, intervalDataSyncUpdate } = useSync()
|
||||
|
||||
// 加入网页关闭提示
|
||||
addWindowUnload()
|
||||
|
||||
// 编辑时注入scale变量,消除警告
|
||||
provide(SCALE_KEY, null)
|
||||
|
||||
@ -186,7 +196,7 @@ onMounted(() => {
|
||||
// 获取数据
|
||||
dataSyncFetch()
|
||||
// 定时更新数据
|
||||
intervalDataSyncUpdate()
|
||||
// intervalDataSyncUpdate()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user