Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
34810522
提交
34810522
authored
4月 26, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 快速切换视图时,加载的数据集可能不属于当前视图的问题
上级
9939b439
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
49 行增加
和
34 行删除
+49
-34
utils.js
frontend/src/views/chart/components/drag-item/utils.js
+5
-0
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+44
-34
没有找到文件。
frontend/src/views/chart/components/drag-item/utils.js
浏览文件 @
34810522
export
function
getItemType
(
dimensionData
,
quotaData
,
item
)
{
// Check whether the current view is in template status
// ( dimensionData and quotaData have no data). If yes, return 'success' directly
if
(
dimensionData
.
length
===
0
&&
quotaData
.
length
===
0
)
{
return
'success'
}
// 将item的字段在数据集维度、指标字段中查询一遍,如果遇到id不存在、字段类型不一致、维度指标不一致,则提示
const
status
=
item
.
groupType
let
checked
=
false
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
34810522
...
...
@@ -1472,7 +1472,8 @@ export default {
})
this
.
pluginRenderOptions
=
[...
this
.
renderOptions
,
...
pluginOptions
]
},
emptyTableData
()
{
emptyTableData
(
id
)
{
console
.
log
(
'emptyTableData:'
+
id
)
this
.
table
=
{}
this
.
dimension
=
[]
this
.
quota
=
[]
...
...
@@ -1500,8 +1501,11 @@ export default {
initTableData
(
id
,
optType
)
{
if
(
id
!=
null
)
{
post
(
'/dataset/table/getWithPermission/'
+
id
,
null
).
then
(
response
=>
{
this
.
table
=
response
.
data
this
.
initTableField
(
id
,
optType
)
// If click too fast on the panel, the data here may be inconsistent, so make a verification
if
(
this
.
view
.
tableId
===
id
)
{
this
.
table
=
response
.
data
this
.
initTableField
(
id
,
optType
)
}
}).
catch
(
err
=>
{
this
.
table
=
null
this
.
resetDatasetField
()
...
...
@@ -1514,17 +1518,20 @@ export default {
initTableField
(
id
,
optType
)
{
if
(
this
.
table
)
{
post
(
'/dataset/table/getFieldsFromDE'
,
this
.
table
).
then
(
response
=>
{
this
.
dimension
=
response
.
data
.
dimension
this
.
quota
=
response
.
data
.
quota
this
.
dimensionData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dimension
))
this
.
quotaData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
quota
))
this
.
fieldFilter
(
this
.
searchField
)
if
(
optType
===
'change'
)
{
this
.
resetChangeTable
()
this
.
$nextTick
(()
=>
{
bus
.
$emit
(
'reset-change-table'
,
'change'
)
this
.
calcData
()
})
// If click too fast on the panel, the data here may be inconsistent, so make a verification
if
(
this
.
view
.
tableId
===
id
)
{
this
.
dimension
=
response
.
data
.
dimension
this
.
quota
=
response
.
data
.
quota
this
.
dimensionData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dimension
))
this
.
quotaData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
quota
))
this
.
fieldFilter
(
this
.
searchField
)
if
(
optType
===
'change'
)
{
this
.
resetChangeTable
()
this
.
$nextTick
(()
=>
{
bus
.
$emit
(
'reset-change-table'
,
'change'
)
this
.
calcData
()
})
}
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
...
...
@@ -1911,27 +1918,30 @@ export default {
getChart
(
id
,
queryFrom
=
'panel_edit'
)
{
if
(
id
)
{
getChartDetails
(
id
,
this
.
panelInfo
.
id
,
{
queryFrom
:
queryFrom
}).
then
(
response
=>
{
if
(
response
.
data
.
dataFrom
===
'template'
)
{
this
.
emptyTableData
()
}
else
{
this
.
initTableData
(
response
.
data
.
tableId
)
// If click too fast on the panel, the data here may be inconsistent, so make a verification
if
(
response
.
data
.
id
===
this
.
param
.
id
)
{
if
(
response
.
data
.
dataFrom
===
'template'
)
{
this
.
emptyTableData
(
response
.
data
.
id
)
}
else
{
this
.
initTableData
(
response
.
data
.
tableId
)
}
this
.
view
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
))
this
.
view
.
xaxis
=
this
.
view
.
xaxis
?
JSON
.
parse
(
this
.
view
.
xaxis
)
:
[]
this
.
view
.
xaxisExt
=
this
.
view
.
xaxisExt
?
JSON
.
parse
(
this
.
view
.
xaxisExt
)
:
[]
this
.
view
.
yaxis
=
this
.
view
.
yaxis
?
JSON
.
parse
(
this
.
view
.
yaxis
)
:
[]
this
.
view
.
yaxisExt
=
this
.
view
.
yaxisExt
?
JSON
.
parse
(
this
.
view
.
yaxisExt
)
:
[]
this
.
view
.
extStack
=
this
.
view
.
extStack
?
JSON
.
parse
(
this
.
view
.
extStack
)
:
[]
this
.
view
.
drillFields
=
this
.
view
.
drillFields
?
JSON
.
parse
(
this
.
view
.
drillFields
)
:
[]
this
.
view
.
extBubble
=
this
.
view
.
extBubble
?
JSON
.
parse
(
this
.
view
.
extBubble
)
:
[]
this
.
view
.
customAttr
=
this
.
view
.
customAttr
?
JSON
.
parse
(
this
.
view
.
customAttr
)
:
{}
this
.
view
.
customStyle
=
this
.
view
.
customStyle
?
JSON
.
parse
(
this
.
view
.
customStyle
)
:
{}
this
.
view
.
customFilter
=
this
.
view
.
customFilter
?
JSON
.
parse
(
this
.
view
.
customFilter
)
:
{}
this
.
view
.
senior
=
this
.
view
.
senior
?
JSON
.
parse
(
this
.
view
.
senior
)
:
{}
// 将视图传入echart组件
this
.
chart
=
response
.
data
this
.
data
=
response
.
data
.
data
}
this
.
view
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
))
this
.
view
.
xaxis
=
this
.
view
.
xaxis
?
JSON
.
parse
(
this
.
view
.
xaxis
)
:
[]
this
.
view
.
xaxisExt
=
this
.
view
.
xaxisExt
?
JSON
.
parse
(
this
.
view
.
xaxisExt
)
:
[]
this
.
view
.
yaxis
=
this
.
view
.
yaxis
?
JSON
.
parse
(
this
.
view
.
yaxis
)
:
[]
this
.
view
.
yaxisExt
=
this
.
view
.
yaxisExt
?
JSON
.
parse
(
this
.
view
.
yaxisExt
)
:
[]
this
.
view
.
extStack
=
this
.
view
.
extStack
?
JSON
.
parse
(
this
.
view
.
extStack
)
:
[]
this
.
view
.
drillFields
=
this
.
view
.
drillFields
?
JSON
.
parse
(
this
.
view
.
drillFields
)
:
[]
this
.
view
.
extBubble
=
this
.
view
.
extBubble
?
JSON
.
parse
(
this
.
view
.
extBubble
)
:
[]
this
.
view
.
customAttr
=
this
.
view
.
customAttr
?
JSON
.
parse
(
this
.
view
.
customAttr
)
:
{}
this
.
view
.
customStyle
=
this
.
view
.
customStyle
?
JSON
.
parse
(
this
.
view
.
customStyle
)
:
{}
this
.
view
.
customFilter
=
this
.
view
.
customFilter
?
JSON
.
parse
(
this
.
view
.
customFilter
)
:
{}
this
.
view
.
senior
=
this
.
view
.
senior
?
JSON
.
parse
(
this
.
view
.
senior
)
:
{}
// 将视图传入echart组件
this
.
chart
=
response
.
data
this
.
data
=
response
.
data
.
data
}).
catch
(
err
=>
{
this
.
httpRequest
.
status
=
err
.
response
.
data
.
success
this
.
httpRequest
.
msg
=
err
.
response
.
data
.
message
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论