Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
b63d881b
提交
b63d881b
authored
4月 20, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 仪表盘可以根据画布缩放调整大小
上级
96ae5bf5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
35 行增加
和
20 行删除
+35
-20
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+7
-4
gauge.js
frontend/src/views/chart/chart/gauge/gauge.js
+9
-8
gauge_antv.js
frontend/src/views/chart/chart/gauge/gauge_antv.js
+7
-6
ChartComponent.vue
frontend/src/views/chart/components/ChartComponent.vue
+6
-1
ChartComponentG2.vue
frontend/src/views/chart/components/ChartComponentG2.vue
+6
-1
没有找到文件。
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
b63d881b
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
:track-menu=
"trackMenu"
:track-menu=
"trackMenu"
:search-count=
"searchCount"
:search-count=
"searchCount"
:terminal-type=
"scaleCoefficientType"
:terminal-type=
"scaleCoefficientType"
:scale=
"scale"
@
onChartClick=
"chartClick"
@
onChartClick=
"chartClick"
@
onJumpClick=
"jumpClick"
@
onJumpClick=
"jumpClick"
/>
/>
...
@@ -41,6 +42,7 @@
...
@@ -41,6 +42,7 @@
:chart=
"chart"
:chart=
"chart"
:track-menu=
"trackMenu"
:track-menu=
"trackMenu"
:search-count=
"searchCount"
:search-count=
"searchCount"
:scale=
"scale"
@
onChartClick=
"chartClick"
@
onChartClick=
"chartClick"
@
onJumpClick=
"jumpClick"
@
onJumpClick=
"jumpClick"
/>
/>
...
@@ -177,7 +179,8 @@ export default {
...
@@ -177,7 +179,8 @@ export default {
pre
:
null
,
pre
:
null
,
preCanvasPanel
:
null
,
preCanvasPanel
:
null
,
sourceCustomAttrStr
:
null
,
sourceCustomAttrStr
:
null
,
sourceCustomStyleStr
:
null
sourceCustomStyleStr
:
null
,
scale
:
1
}
}
},
},
...
@@ -412,11 +415,11 @@ export default {
...
@@ -412,11 +415,11 @@ export default {
},
},
// 根据仪表板的缩放比例,修改视图内部参数
// 根据仪表板的缩放比例,修改视图内部参数
mergeScale
()
{
mergeScale
()
{
const
scale
=
Math
.
min
(
this
.
previewCanvasScale
.
scalePointWidth
,
this
.
previewCanvasScale
.
scalePointHeight
)
*
this
.
scaleCoefficient
this
.
scale
=
Math
.
min
(
this
.
previewCanvasScale
.
scalePointWidth
,
this
.
previewCanvasScale
.
scalePointHeight
)
*
this
.
scaleCoefficient
const
customAttrChart
=
JSON
.
parse
(
this
.
sourceCustomAttrStr
)
const
customAttrChart
=
JSON
.
parse
(
this
.
sourceCustomAttrStr
)
const
customStyleChart
=
JSON
.
parse
(
this
.
sourceCustomStyleStr
)
const
customStyleChart
=
JSON
.
parse
(
this
.
sourceCustomStyleStr
)
recursionTransObj
(
customAttrTrans
,
customAttrChart
,
scale
,
this
.
scaleCoefficientType
)
recursionTransObj
(
customAttrTrans
,
customAttrChart
,
this
.
scale
,
this
.
scaleCoefficientType
)
recursionTransObj
(
customStyleTrans
,
customStyleChart
,
scale
,
this
.
scaleCoefficientType
)
recursionTransObj
(
customStyleTrans
,
customStyleChart
,
this
.
scale
,
this
.
scaleCoefficientType
)
// 移动端地图标签不显示
// 移动端地图标签不显示
if
(
this
.
chart
.
type
===
'map'
&&
this
.
scaleCoefficientType
===
'mobile'
)
{
if
(
this
.
chart
.
type
===
'map'
&&
this
.
scaleCoefficientType
===
'mobile'
)
{
...
...
frontend/src/views/chart/chart/gauge/gauge.js
浏览文件 @
b63d881b
import
{
componentStyle
}
from
'../common/common'
import
{
componentStyle
}
from
'../common/common'
import
{
hexColorToRGBA
}
from
'@/views/chart/chart/util'
import
{
hexColorToRGBA
}
from
'@/views/chart/chart/util'
import
{
DEFAULT_THRESHOLD
}
from
'@/views/chart/chart/chart'
import
{
DEFAULT_THRESHOLD
}
from
'@/views/chart/chart/chart'
import
{
getScaleValue
}
from
'@/components/canvas/utils/style'
export
function
baseGaugeOption
(
chart_option
,
chart
)
{
export
function
baseGaugeOption
(
chart_option
,
chart
,
scale
=
1
)
{
// 处理shape attr
// 处理shape attr
let
customAttr
=
{}
let
customAttr
=
{}
if
(
chart
.
customAttr
)
{
if
(
chart
.
customAttr
)
{
...
@@ -87,24 +88,24 @@ export function baseGaugeOption(chart_option, chart) {
...
@@ -87,24 +88,24 @@ export function baseGaugeOption(chart_option, chart) {
show
:
false
show
:
false
}
}
chart_option
.
series
[
0
].
axisTick
=
{
chart_option
.
series
[
0
].
axisTick
=
{
splitNumber
:
5
,
// TODO 刻度间隔数
splitNumber
:
getScaleValue
(
5
,
scale
)
,
// TODO 刻度间隔数
length
:
10
,
// TODO 子刻度线长度
length
:
getScaleValue
(
10
,
scale
)
,
// TODO 子刻度线长度
lineStyle
:
{
lineStyle
:
{
color
:
'auto'
,
color
:
'auto'
,
width
:
2
// TODO 子刻度线宽度
width
:
getScaleValue
(
2
,
scale
)
// TODO 子刻度线宽度
}
}
}
}
chart_option
.
series
[
0
].
splitLine
=
{
chart_option
.
series
[
0
].
splitLine
=
{
length
:
18
,
// TODO 刻度线长度
length
:
getScaleValue
(
18
,
scale
)
,
// TODO 刻度线长度
lineStyle
:
{
lineStyle
:
{
color
:
'auto'
,
color
:
'auto'
,
width
:
2
// TODO 刻度线宽度
width
:
getScaleValue
(
2
,
scale
)
// TODO 刻度线宽度
}
}
}
}
chart_option
.
series
[
0
].
axisLabel
=
{
chart_option
.
series
[
0
].
axisLabel
=
{
color
:
'auto'
,
color
:
'auto'
,
distance
:
20
,
// TODO 刻度值文字里刻度线距离
distance
:
getScaleValue
(
20
,
scale
)
,
// TODO 刻度值文字里刻度线距离
fontSize
:
20
// TODO 刻度值字体大小
fontSize
:
getScaleValue
(
20
,
scale
)
// TODO 刻度值字体大小
}
}
}
}
}
}
...
...
frontend/src/views/chart/chart/gauge/gauge_antv.js
浏览文件 @
b63d881b
import
{
getPadding
,
getTheme
}
from
'@/views/chart/chart/common/common_antv'
import
{
getPadding
,
getTheme
}
from
'@/views/chart/chart/common/common_antv'
import
{
Gauge
}
from
'@antv/g2plot'
import
{
Gauge
}
from
'@antv/g2plot'
import
{
DEFAULT_SIZE
,
DEFAULT_THRESHOLD
}
from
'@/views/chart/chart/chart'
import
{
DEFAULT_SIZE
,
DEFAULT_THRESHOLD
}
from
'@/views/chart/chart/chart'
import
{
getScaleValue
}
from
'@/components/canvas/utils/style'
export
function
baseGaugeOptionAntV
(
plot
,
container
,
chart
,
action
)
{
export
function
baseGaugeOptionAntV
(
plot
,
container
,
chart
,
action
,
scale
=
1
)
{
let
max
,
labelContent
,
startAngel
,
endAngel
let
max
,
labelContent
,
startAngel
,
endAngel
// theme
// theme
const
theme
=
getTheme
(
chart
)
const
theme
=
getTheme
(
chart
)
...
@@ -76,20 +77,20 @@ export function baseGaugeOptionAntV(plot, container, chart, action) {
...
@@ -76,20 +77,20 @@ export function baseGaugeOptionAntV(plot, container, chart, action) {
axis
:
{
axis
:
{
label
:
{
label
:
{
style
:
{
style
:
{
fontSize
:
14
// TODO 刻度值字体大小
fontSize
:
getScaleValue
(
14
,
scale
)
// TODO 刻度值字体大小
}
}
},
},
tickLine
:
{
tickLine
:
{
length
:
-
12
,
// TODO 刻度线长度
length
:
getScaleValue
(
12
,
scale
)
*
-
1
,
// TODO 刻度线长度
style
:
{
style
:
{
lineWidth
:
1
// TODO 刻度线宽度
lineWidth
:
getScaleValue
(
1
,
scale
)
// TODO 刻度线宽度
}
}
},
},
subTickLine
:
{
subTickLine
:
{
count
:
4
,
// TODO 子刻度数
count
:
4
,
// TODO 子刻度数
length
:
-
6
,
// TODO 子刻度线长度
length
:
getScaleValue
(
6
,
scale
)
*
-
1
,
// TODO 子刻度线长度
style
:
{
style
:
{
lineWidth
:
1
// TODO 子刻度线宽度
lineWidth
:
getScaleValue
(
1
,
scale
)
// TODO 子刻度线宽度
}
}
}
}
}
}
...
...
frontend/src/views/chart/components/ChartComponent.vue
浏览文件 @
b63d881b
...
@@ -115,6 +115,11 @@ export default {
...
@@ -115,6 +115,11 @@ export default {
terminalType
:
{
terminalType
:
{
type
:
String
,
type
:
String
,
default
:
'pc'
default
:
'pc'
},
scale
:
{
type
:
Number
,
required
:
false
,
default
:
1
}
}
},
},
data
()
{
data
()
{
...
@@ -210,7 +215,7 @@ export default {
...
@@ -210,7 +215,7 @@ export default {
}
else
if
(
chart
.
type
===
'radar'
)
{
}
else
if
(
chart
.
type
===
'radar'
)
{
chart_option
=
baseRadarOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_RADAR
)),
chart
)
chart_option
=
baseRadarOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_RADAR
)),
chart
)
}
else
if
(
chart
.
type
===
'gauge'
)
{
}
else
if
(
chart
.
type
===
'gauge'
)
{
chart_option
=
baseGaugeOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_GAUGE
)),
chart
)
chart_option
=
baseGaugeOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_GAUGE
)),
chart
,
this
.
scale
)
}
else
if
(
chart
.
type
===
'scatter'
)
{
}
else
if
(
chart
.
type
===
'scatter'
)
{
chart_option
=
baseScatterOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_SCATTER
)),
chart
,
this
.
terminalType
)
chart_option
=
baseScatterOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_SCATTER
)),
chart
,
this
.
terminalType
)
}
else
if
(
chart
.
type
===
'treemap'
)
{
}
else
if
(
chart
.
type
===
'treemap'
)
{
...
...
frontend/src/views/chart/components/ChartComponentG2.vue
浏览文件 @
b63d881b
...
@@ -50,6 +50,11 @@ export default {
...
@@ -50,6 +50,11 @@ export default {
type
:
Number
,
type
:
Number
,
required
:
false
,
required
:
false
,
default
:
0
default
:
0
},
scale
:
{
type
:
Number
,
required
:
false
,
default
:
1
}
}
},
},
data
()
{
data
()
{
...
@@ -153,7 +158,7 @@ export default {
...
@@ -153,7 +158,7 @@ export default {
}
else
if
(
chart
.
type
===
'radar'
)
{
}
else
if
(
chart
.
type
===
'radar'
)
{
this
.
myChart
=
baseRadarOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
this
.
myChart
=
baseRadarOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
}
else
if
(
chart
.
type
===
'gauge'
)
{
}
else
if
(
chart
.
type
===
'gauge'
)
{
this
.
myChart
=
baseGaugeOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
this
.
myChart
=
baseGaugeOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
,
this
.
scale
)
}
else
if
(
chart
.
type
===
'pie'
)
{
}
else
if
(
chart
.
type
===
'pie'
)
{
this
.
myChart
=
basePieOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
this
.
myChart
=
basePieOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
}
else
if
(
chart
.
type
===
'pie-rose'
)
{
}
else
if
(
chart
.
type
===
'pie-rose'
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论