Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
ff02cb9a
提交
ff02cb9a
authored
4月 08, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:禁用localstorage存储仪表盘数据 容易导致浏览器本地存储越界
上级
8d61299f
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
24 行增加
和
40 行删除
+24
-40
ContextMenu.vue
...d/src/components/canvas/components/Editor/ContextMenu.vue
+2
-2
Toolbar.vue
frontend/src/components/canvas/components/Toolbar.vue
+0
-4
panel.js
frontend/src/store/modules/panel.js
+15
-1
index.vue
frontend/src/views/panel/edit/index.vue
+7
-26
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+0
-4
PanelViewShow.vue
frontend/src/views/panel/list/PanelViewShow.vue
+0
-3
没有找到文件。
frontend/src/components/canvas/components/Editor/ContextMenu.vue
浏览文件 @
ff02cb9a
...
...
@@ -42,8 +42,8 @@ export default {
methods
:
{
edit
()
{
// 编辑时临时保存 当前修改的画布
localStorage
.
setItem
(
'canvasDataEditT
mp'
,
JSON
.
stringify
(
this
.
componentData
))
localStorage
.
setItem
(
'canvasStyleEditT
mp'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
this
.
$store
.
dispatch
(
'panel/setComponentDataTe
mp'
,
JSON
.
stringify
(
this
.
componentData
))
this
.
$store
.
dispatch
(
'panel/setCanvasStyleDataTe
mp'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
if
(
this
.
curComponent
.
component
===
'user-view'
)
{
this
.
$store
.
dispatch
(
'chart/setViewId'
,
null
)
this
.
$store
.
dispatch
(
'chart/setViewId'
,
this
.
curComponent
.
propValue
.
viewId
)
...
...
frontend/src/components/canvas/components/Toolbar.vue
浏览文件 @
ff02cb9a
...
...
@@ -197,8 +197,6 @@ export default {
},
save
()
{
localStorage
.
setItem
(
'canvasData'
,
JSON
.
stringify
(
this
.
componentData
))
localStorage
.
setItem
(
'canvasStyle'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
// 保存到数据库
const
requestInfo
=
{
id
:
this
.
$store
.
state
.
panel
.
panelInfo
.
id
,
...
...
@@ -218,8 +216,6 @@ export default {
},
clickPreview
()
{
localStorage
.
setItem
(
'canvasData'
,
JSON
.
stringify
(
this
.
componentData
))
localStorage
.
setItem
(
'canvasStyle'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
const
url
=
'#/preview'
window
.
open
(
url
,
'_blank'
)
}
...
...
frontend/src/store/modules/panel.js
浏览文件 @
ff02cb9a
...
...
@@ -6,7 +6,9 @@ const getDefaultState = () => {
id
:
null
,
name
:
''
,
preStyle
:
null
}
},
canvasStyleDataTemp
:
null
,
// 页面全局临时存储数据
componentDataTemp
:
null
// 画布组件临时存储数据
}
}
...
...
@@ -18,6 +20,12 @@ const mutations = {
},
setPanelInfo
:
(
state
,
panelInfo
)
=>
{
state
.
panelInfo
=
panelInfo
},
setCanvasStyleDataTemp
:
(
state
,
canvasStyleDataTemp
)
=>
{
state
.
canvasStyleDataTemp
=
canvasStyleDataTemp
},
setComponentDataTemp
:
(
state
,
componentDataTemp
)
=>
{
state
.
componentDataTemp
=
componentDataTemp
}
}
...
...
@@ -27,6 +35,12 @@ const actions = {
},
setPanelInfo
({
commit
},
panelInfo
)
{
commit
(
'setPanelInfo'
,
panelInfo
)
},
setCanvasStyleDataTemp
({
commit
},
canvasStyleDataTemp
)
{
commit
(
'setCanvasStyleDataTemp'
,
canvasStyleDataTemp
)
},
setComponentDataTemp
({
commit
},
componentDataTemp
)
{
commit
(
'setComponentDataTemp'
,
componentDataTemp
)
}
}
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
ff02cb9a
...
...
@@ -195,24 +195,18 @@ export default {
},
methods
:
{
init
(
panelId
)
{
// 清理原有画布本地数据
localStorage
.
setItem
(
'canvasData'
,
null
)
localStorage
.
setItem
(
'canvasStyle'
,
null
)
// 如果临时画布有数据 则使用临时画布数据(视图编辑的时候 会保存临时画布数据)
if
(
localStorage
.
getItem
(
'canvasDataEditTmp'
)
&&
localStorage
.
getItem
(
'canvasStyleEditTmp'
))
{
localStorage
.
setItem
(
'canvasData'
,
localStorage
.
getItem
(
'canvasDataEditTmp'
))
localStorage
.
setItem
(
'canvasStyle'
,
localStorage
.
getItem
(
'canvasStyleEditTmp'
))
const
componentDataTemp
=
this
.
$store
.
state
.
panel
.
componentDataTemp
const
canvasStyleDataTemp
=
this
.
$store
.
state
.
panel
.
canvasStyleDataTemp
if
(
componentDataTemp
&&
canvasStyleDataTemp
)
{
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
JSON
.
parse
(
componentDataTemp
)))
this
.
$store
.
commit
(
'setCanvasStyle'
,
JSON
.
parse
(
canvasStyleDataTemp
))
}
else
if
(
panelId
)
{
get
(
'panel/group/findOne/'
+
panelId
).
then
(
response
=>
{
localStorage
.
setItem
(
'canvasData'
,
response
.
data
.
panelData
)
localStorage
.
setItem
(
'c
anvasStyle'
,
response
.
data
.
panelStyle
)
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
response
.
data
.
panelData
)
)
this
.
$store
.
commit
(
'setC
anvasStyle'
,
response
.
data
.
panelStyle
)
})
}
// 清理临时画布本地数据
localStorage
.
setItem
(
'canvasDataEditTmp'
,
null
)
localStorage
.
setItem
(
'canvasStyleEditTmp'
,
null
)
this
.
restore
()
},
save
()
{
...
...
@@ -244,19 +238,6 @@ export default {
})
},
// 画布
restore
()
{
// 用保存的数据恢复画布
let
canvasData
=
null
if
((
canvasData
=
localStorage
.
getItem
(
'canvasData'
))
!==
null
&&
canvasData
!==
'null'
)
{
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
JSON
.
parse
(
canvasData
)))
}
if
(
canvasData
&&
canvasData
!==
'null'
)
{
this
.
$store
.
commit
(
'setCanvasStyle'
,
JSON
.
parse
(
localStorage
.
getItem
(
'canvasStyle'
)))
}
},
resetID
(
data
)
{
data
.
forEach
(
item
=>
{
item
.
id
=
uuid
.
v1
()
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
ff02cb9a
...
...
@@ -420,8 +420,6 @@ export default {
if
(
data
.
nodeType
===
'panel'
)
{
// 加载视图数据
this
.
$nextTick
(()
=>
{
localStorage
.
setItem
(
'canvasData'
,
null
)
localStorage
.
setItem
(
'canvasStyle'
,
null
)
get
(
'panel/group/findOne/'
+
data
.
id
).
then
(
response
=>
{
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
JSON
.
parse
(
response
.
data
.
panelData
)))
this
.
$store
.
commit
(
'setCanvasStyle'
,
JSON
.
parse
(
response
.
data
.
panelStyle
))
...
...
@@ -522,8 +520,6 @@ export default {
},
edit
(
data
)
{
// 清空临时画布
localStorage
.
setItem
(
'canvasDataEditTmp'
,
null
)
localStorage
.
setItem
(
'canvasStyleEditTmp'
,
null
)
this
.
$store
.
dispatch
(
'panel/setPanelInfo'
,
data
)
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'PanelEdit'
})
},
...
...
frontend/src/views/panel/list/PanelViewShow.vue
浏览文件 @
ff02cb9a
...
...
@@ -48,9 +48,6 @@ export default {
},
methods
:
{
clickPreview
()
{
debugger
localStorage
.
setItem
(
'canvasData'
,
JSON
.
stringify
(
this
.
componentData
))
localStorage
.
setItem
(
'canvasStyle'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
const
url
=
'#/preview/'
+
this
.
$store
.
state
.
panel
.
panelInfo
.
id
window
.
open
(
url
,
'_blank'
)
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论