Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
7cc5169a
提交
7cc5169a
authored
11月 29, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 前端增加菜单缓存,加快相应速度
上级
521b35f9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
116 行增加
和
40 行删除
+116
-40
authModel.js
frontend/src/api/authModel/authModel.js
+3
-3
chart.js
frontend/src/api/chart/chart.js
+1
-1
panel.js
frontend/src/api/panel/panel.js
+6
-4
Group.vue
frontend/src/views/chart/group/Group.vue
+21
-7
DatasetGroupSelectorTree.vue
...end/src/views/dataset/common/DatasetGroupSelectorTree.vue
+13
-5
Group.vue
frontend/src/views/dataset/group/Group.vue
+16
-8
index.vue
frontend/src/views/login/index.vue
+13
-1
index.vue
frontend/src/views/panel/edit/index.vue
+1
-0
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+42
-11
没有找到文件。
frontend/src/api/authModel/authModel.js
浏览文件 @
7cc5169a
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
export
function
queryAuthModel
(
data
)
{
export
function
queryAuthModel
(
data
,
loading
=
true
,
timeout
=
30000
)
{
return
request
({
return
request
({
url
:
'authModel/queryAuthModel'
,
url
:
'authModel/queryAuthModel'
,
method
:
'post'
,
method
:
'post'
,
loading
:
true
,
loading
:
loading
,
timeout
:
30000
,
timeout
:
timeout
,
data
data
})
})
}
}
frontend/src/api/chart/chart.js
浏览文件 @
7cc5169a
...
@@ -40,7 +40,7 @@ export function chartGroupTree(data) {
...
@@ -40,7 +40,7 @@ export function chartGroupTree(data) {
return
request
({
return
request
({
url
:
'/chart/group/tree'
,
url
:
'/chart/group/tree'
,
method
:
'post'
,
method
:
'post'
,
loading
:
tru
e
,
loading
:
fals
e
,
data
data
})
})
}
}
...
...
frontend/src/api/panel/panel.js
浏览文件 @
7cc5169a
...
@@ -36,20 +36,22 @@ export function querySubjectWithGroup(data) {
...
@@ -36,20 +36,22 @@ export function querySubjectWithGroup(data) {
})
})
}
}
export
function
defaultTree
(
data
)
{
export
function
defaultTree
(
data
,
loading
=
true
,
timeout
=
30000
)
{
return
request
({
return
request
({
url
:
'/panel/group/defaultTree'
,
url
:
'/panel/group/defaultTree'
,
method
:
'post'
,
method
:
'post'
,
loading
:
true
,
loading
:
loading
,
timeout
:
timeout
,
data
data
})
})
}
}
export
function
groupTree
(
data
)
{
export
function
groupTree
(
data
,
loading
=
true
,
timeout
=
30000
)
{
return
request
({
return
request
({
url
:
'/panel/group/tree'
,
url
:
'/panel/group/tree'
,
method
:
'post'
,
method
:
'post'
,
loading
:
true
,
loading
:
loading
,
timeout
:
timeout
,
data
data
})
})
}
}
...
...
frontend/src/views/chart/group/Group.vue
浏览文件 @
7cc5169a
...
@@ -337,6 +337,11 @@ export default {
...
@@ -337,6 +337,11 @@ export default {
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
null
default
:
null
},
mountedInit
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
}
}
},
},
data
()
{
data
()
{
...
@@ -440,10 +445,11 @@ export default {
...
@@ -440,10 +445,11 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
treeNode
(
this
.
groupForm
)
if
(
this
.
mountedInit
)
{
this
.
refresh
()
this
.
treeNode
(
true
)
// this.chartTree()
this
.
refresh
()
this
.
getChartGroupTree
()
this
.
getChartGroupTree
()
}
},
},
methods
:
{
methods
:
{
clickAdd
(
param
)
{
clickAdd
(
param
)
{
...
@@ -620,9 +626,17 @@ export default {
...
@@ -620,9 +626,17 @@ export default {
})
})
},
},
treeNode
(
group
)
{
treeNode
(
cache
=
false
)
{
queryAuthModel
({
modelType
:
'chart'
}).
then
(
res
=>
{
const
modelInfo
=
localStorage
.
getItem
(
'chart-tree'
)
this
.
tData
=
res
.
data
const
userCache
=
(
modelInfo
&&
cache
)
if
(
userCache
)
{
this
.
tData
=
JSON
.
parse
(
modelInfo
)
}
queryAuthModel
({
modelType
:
'chart'
},
!
userCache
).
then
(
res
=>
{
localStorage
.
setItem
(
'chart-tree'
,
JSON
.
stringify
(
res
.
data
))
if
(
!
userCache
)
{
this
.
tData
=
res
.
data
}
})
})
},
},
...
...
frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue
浏览文件 @
7cc5169a
...
@@ -181,7 +181,7 @@ export default {
...
@@ -181,7 +181,7 @@ export default {
this
.
unionDataChange
()
this
.
unionDataChange
()
},
},
'table'
:
function
()
{
'table'
:
function
()
{
this
.
treeNode
(
this
.
groupForm
)
this
.
treeNode
()
},
},
filterText
(
val
)
{
filterText
(
val
)
{
this
.
searchPids
=
[]
this
.
searchPids
=
[]
...
@@ -193,7 +193,7 @@ export default {
...
@@ -193,7 +193,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
treeNode
(
t
his
.
groupForm
)
this
.
treeNode
(
t
rue
)
},
},
created
()
{
created
()
{
this
.
kettleState
()
this
.
kettleState
()
...
@@ -223,9 +223,17 @@ export default {
...
@@ -223,9 +223,17 @@ export default {
}
}
},
},
treeNode
(
group
)
{
treeNode
(
cache
)
{
queryAuthModel
({
modelType
:
'dataset'
}).
then
(
res
=>
{
const
modelInfo
=
localStorage
.
getItem
(
'dataset-tree'
)
this
.
data
=
res
.
data
const
userCache
=
(
modelInfo
&&
cache
)
if
(
userCache
)
{
this
.
data
=
JSON
.
parse
(
modelInfo
)
}
queryAuthModel
({
modelType
:
'dataset'
},
!
userCache
).
then
(
res
=>
{
localStorage
.
setItem
(
'dataset-tree'
,
JSON
.
stringify
(
res
.
data
))
if
(
!
userCache
)
{
this
.
data
=
res
.
data
}
})
})
},
},
nodeClick
(
data
,
node
)
{
nodeClick
(
data
,
node
)
{
...
...
frontend/src/views/dataset/group/Group.vue
浏览文件 @
7cc5169a
...
@@ -325,7 +325,7 @@ export default {
...
@@ -325,7 +325,7 @@ export default {
this
.
kettleState
()
this
.
kettleState
()
},
},
mounted
()
{
mounted
()
{
this
.
treeNode
(
t
his
.
groupForm
)
this
.
treeNode
(
t
rue
)
this
.
refresh
()
this
.
refresh
()
},
},
methods
:
{
methods
:
{
...
@@ -407,7 +407,7 @@ export default {
...
@@ -407,7 +407,7 @@ export default {
showClose
:
true
showClose
:
true
})
})
this
.
expandedArray
.
push
(
group
.
pid
)
this
.
expandedArray
.
push
(
group
.
pid
)
this
.
treeNode
(
group
.
pid
)
this
.
treeNode
()
})
})
}
else
{
}
else
{
return
false
return
false
...
@@ -451,7 +451,7 @@ export default {
...
@@ -451,7 +451,7 @@ export default {
message
:
this
.
$t
(
'dataset.delete_success'
),
message
:
this
.
$t
(
'dataset.delete_success'
),
showClose
:
true
showClose
:
true
})
})
this
.
treeNode
(
data
.
pid
)
this
.
treeNode
()
})
})
}).
catch
(()
=>
{
}).
catch
(()
=>
{
})
})
...
@@ -469,7 +469,7 @@ export default {
...
@@ -469,7 +469,7 @@ export default {
message
:
this
.
$t
(
'dataset.delete_success'
),
message
:
this
.
$t
(
'dataset.delete_success'
),
showClose
:
true
showClose
:
true
})
})
this
.
treeNode
(
data
.
sceneId
)
this
.
treeNode
()
this
.
$store
.
dispatch
(
'dataset/setTable'
,
new
Date
().
getTime
())
this
.
$store
.
dispatch
(
'dataset/setTable'
,
new
Date
().
getTime
())
})
})
}).
catch
(()
=>
{
}).
catch
(()
=>
{
...
@@ -496,9 +496,17 @@ export default {
...
@@ -496,9 +496,17 @@ export default {
}
}
},
},
treeNode
(
group
)
{
treeNode
(
cache
)
{
queryAuthModel
({
modelType
:
'dataset'
}).
then
(
res
=>
{
const
modelInfo
=
localStorage
.
getItem
(
'dataset-tree'
)
this
.
tData
=
res
.
data
const
userCache
=
(
modelInfo
&&
cache
)
if
(
userCache
)
{
this
.
tData
=
JSON
.
parse
(
modelInfo
)
}
queryAuthModel
({
modelType
:
'dataset'
},
!
userCache
).
then
(
res
=>
{
localStorage
.
setItem
(
'dataset-tree'
,
JSON
.
stringify
(
res
.
data
))
if
(
!
userCache
)
{
this
.
tData
=
res
.
data
}
})
})
},
},
...
@@ -682,7 +690,7 @@ export default {
...
@@ -682,7 +690,7 @@ export default {
this
.
searchTree
(
val
)
this
.
searchTree
(
val
)
}
else
{
}
else
{
this
.
isTreeSearch
=
false
this
.
isTreeSearch
=
false
this
.
treeNode
(
this
.
groupForm
)
this
.
treeNode
()
}
}
},
},
filterNode
(
value
,
data
)
{
filterNode
(
value
,
data
)
{
...
...
frontend/src/views/login/index.vue
浏览文件 @
7cc5169a
...
@@ -92,7 +92,13 @@ export default {
...
@@ -92,7 +92,13 @@ export default {
axiosFinished
:
false
,
axiosFinished
:
false
,
loginTypes
:
[
0
],
loginTypes
:
[
0
],
isPluginLoaded
:
false
,
isPluginLoaded
:
false
,
contentShow
:
false
contentShow
:
false
,
clearLocalStorage
:
[
'panel-main-tree'
,
'panel-default-tree'
,
'chart-tree'
,
'dataset-tree'
]
}
}
},
},
computed
:
{
computed
:
{
...
@@ -178,8 +184,14 @@ export default {
...
@@ -178,8 +184,14 @@ export default {
}
}
} */
} */
},
},
initCache
()
{
this
.
clearLocalStorage
.
forEach
(
item
=>
{
localStorage
.
removeItem
(
item
)
})
},
handleLogin
()
{
handleLogin
()
{
this
.
initCache
()
this
.
clearOidcMsg
()
this
.
clearOidcMsg
()
this
.
$refs
.
loginForm
.
validate
(
valid
=>
{
this
.
$refs
.
loginForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
7cc5169a
...
@@ -191,6 +191,7 @@
...
@@ -191,6 +191,7 @@
:opt-from=
"'panel'"
:opt-from=
"'panel'"
:advice-group-id=
"adviceGroupId"
:advice-group-id=
"adviceGroupId"
style=
"height: 0px;width:0px;padding:0px;overflow: hidden"
style=
"height: 0px;width:0px;padding:0px;overflow: hidden"
:mounted-init=
"false"
@
newViewInfo=
"newViewInfo"
@
newViewInfo=
"newViewInfo"
/>
/>
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
7cc5169a
...
@@ -233,6 +233,7 @@ import {
...
@@ -233,6 +233,7 @@ import {
DEFAULT_COMMON_CANVAS_STYLE_STRING
DEFAULT_COMMON_CANVAS_STYLE_STRING
}
from
'@/views/panel/panel'
}
from
'@/views/panel/panel'
import
TreeSelector
from
'@/components/TreeSelector'
import
TreeSelector
from
'@/components/TreeSelector'
import
{
queryAuthModel
}
from
'@/api/authModel/authModel'
export
default
{
export
default
{
name
:
'PanelList'
,
name
:
'PanelList'
,
...
@@ -334,7 +335,11 @@ export default {
...
@@ -334,7 +335,11 @@ export default {
searchMap
:
{
searchMap
:
{
all
:
this
.
$t
(
'commons.all'
),
all
:
this
.
$t
(
'commons.all'
),
folder
:
this
.
$t
(
'commons.folder'
)
folder
:
this
.
$t
(
'commons.folder'
)
}
},
initLocalStorage
:
[
'chart'
,
'dataset'
]
}
}
},
},
computed
:
{
computed
:
{
...
@@ -367,9 +372,20 @@ export default {
...
@@ -367,9 +372,20 @@ export default {
this
.
$store
.
commit
(
'setComponentData'
,
[])
this
.
$store
.
commit
(
'setComponentData'
,
[])
this
.
$store
.
commit
(
'setCanvasStyle'
,
DEFAULT_COMMON_CANVAS_STYLE_STRING
)
this
.
$store
.
commit
(
'setCanvasStyle'
,
DEFAULT_COMMON_CANVAS_STYLE_STRING
)
this
.
defaultTree
()
this
.
defaultTree
()
this
.
tree
(
this
.
groupForm
)
this
.
tree
(
true
)
this
.
initCache
()
},
},
methods
:
{
methods
:
{
initCache
()
{
// 初始化时提前加载视图和数据集的缓存
this
.
initLocalStorage
.
forEach
(
item
=>
{
if
(
!
localStorage
.
getItem
(
item
+
'-tree'
))
{
queryAuthModel
({
modelType
:
item
},
false
).
then
(
res
=>
{
localStorage
.
setItem
(
item
+
'-tree'
,
JSON
.
stringify
(
res
.
data
))
})
}
})
},
closeEditPanelDialog
(
panelInfo
)
{
closeEditPanelDialog
(
panelInfo
)
{
this
.
editPanel
.
visible
=
false
this
.
editPanel
.
visible
=
false
if
(
panelInfo
)
{
if
(
panelInfo
)
{
...
@@ -392,7 +408,7 @@ export default {
...
@@ -392,7 +408,7 @@ export default {
}
}
this
.
activeNodeAndClick
(
panelInfo
)
this
.
activeNodeAndClick
(
panelInfo
)
}
else
{
}
else
{
this
.
tree
(
this
.
groupForm
)
this
.
tree
()
}
}
}
}
},
},
...
@@ -535,7 +551,7 @@ export default {
...
@@ -535,7 +551,7 @@ export default {
type
:
'success'
,
type
:
'success'
,
showClose
:
true
showClose
:
true
})
})
this
.
tree
(
this
.
groupForm
)
this
.
tree
()
this
.
defaultTree
()
this
.
defaultTree
()
})
})
}
else
{
}
else
{
...
@@ -562,7 +578,7 @@ export default {
...
@@ -562,7 +578,7 @@ export default {
showClose
:
true
showClose
:
true
})
})
this
.
clearCanvas
()
this
.
clearCanvas
()
this
.
tree
(
this
.
groupForm
)
this
.
tree
()
this
.
defaultTree
()
this
.
defaultTree
()
})
})
}).
catch
(()
=>
{
}).
catch
(()
=>
{
...
@@ -591,17 +607,32 @@ export default {
...
@@ -591,17 +607,32 @@ export default {
sort
:
'node_type desc,name asc'
sort
:
'node_type desc,name asc'
}
}
},
},
tree
(
group
)
{
tree
(
cache
=
false
)
{
groupTree
(
group
).
then
(
res
=>
{
const
modelInfo
=
localStorage
.
getItem
(
'panel-main-tree'
)
this
.
tData
=
res
.
data
const
userCache
=
(
modelInfo
&&
cache
)
if
(
userCache
)
{
this
.
tData
=
JSON
.
parse
(
modelInfo
)
}
groupTree
(
this
.
groupForm
,
!
userCache
).
then
(
res
=>
{
localStorage
.
setItem
(
'panel-main-tree'
,
JSON
.
stringify
(
res
.
data
))
if
(
!
userCache
)
{
this
.
tData
=
res
.
data
}
})
})
},
},
defaultTree
()
{
defaultTree
()
{
const
requestInfo
=
{
const
requestInfo
=
{
panelType
:
'system'
panelType
:
'system'
}
}
defaultTree
(
requestInfo
).
then
(
res
=>
{
const
modelInfo
=
localStorage
.
getItem
(
'panel-default-tree'
)
this
.
defaultData
=
res
.
data
if
(
modelInfo
)
{
this
.
defaultData
=
JSON
.
parse
(
modelInfo
)
}
defaultTree
(
requestInfo
,
false
).
then
(
res
=>
{
localStorage
.
setItem
(
'panel-default-tree'
,
JSON
.
stringify
(
res
.
data
))
if
(
!
modelInfo
)
{
this
.
defaultData
=
res
.
data
}
})
})
},
},
...
@@ -768,7 +799,7 @@ export default {
...
@@ -768,7 +799,7 @@ export default {
this
.
moveInfo
.
pid
=
this
.
tGroup
.
id
this
.
moveInfo
.
pid
=
this
.
tGroup
.
id
this
.
moveInfo
[
'optType'
]
=
'move'
this
.
moveInfo
[
'optType'
]
=
'move'
panelSave
(
this
.
moveInfo
).
then
(
response
=>
{
panelSave
(
this
.
moveInfo
).
then
(
response
=>
{
this
.
tree
(
this
.
groupForm
)
this
.
tree
()
this
.
closeMoveGroup
()
this
.
closeMoveGroup
()
})
})
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论