Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
e59d5b80
提交
e59d5b80
authored
12月 20, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 移动端仪表板展示适配
上级
9a4469d7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
50 行增加
和
29 行删除
+50
-29
ComponentWrapper.vue
.../components/canvas/components/Editor/ComponentWrapper.vue
+1
-5
Preview.vue
frontend/src/components/canvas/components/Editor/Preview.vue
+1
-1
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+19
-9
style.js
frontend/src/components/canvas/utils/style.js
+15
-6
scatter.js
frontend/src/views/chart/chart/scatter/scatter.js
+4
-2
ChartComponent.vue
frontend/src/views/chart/components/ChartComponent.vue
+5
-1
index.vue
frontend/src/views/panel/edit/index.vue
+5
-5
没有找到文件。
frontend/src/components/canvas/components/Editor/ComponentWrapper.vue
浏览文件 @
e59d5b80
...
@@ -169,11 +169,7 @@ export default {
...
@@ -169,11 +169,7 @@ export default {
this
.
$store
.
commit
(
'setCurComponent'
,
{
component
:
this
.
config
,
index
:
this
.
index
})
this
.
$store
.
commit
(
'setCurComponent'
,
{
component
:
this
.
config
,
index
:
this
.
index
})
},
},
showViewDetails
()
{
showViewDetails
()
{
if
(
this
.
terminal
===
'pc'
)
{
this
.
$refs
.
wrapperChild
.
openChartDetailsDialog
()
this
.
$refs
.
wrapperChild
.
openChartDetailsDialog
()
}
else
{
this
.
previewVisible
=
true
}
},
},
closePreview
()
{
closePreview
()
{
this
.
previewVisible
=
false
this
.
previewVisible
=
false
...
...
frontend/src/components/canvas/components/Editor/Preview.vue
浏览文件 @
e59d5b80
...
@@ -266,7 +266,7 @@ export default {
...
@@ -266,7 +266,7 @@ export default {
if
(
this
.
terminal
===
'pc'
)
{
if
(
this
.
terminal
===
'pc'
)
{
this
.
chartDetailsVisible
=
true
this
.
chartDetailsVisible
=
true
}
else
{
}
else
{
this
.
mobileChartDetailsVisible
this
.
mobileChartDetailsVisible
=
true
}
}
},
},
exportExcel
()
{
exportExcel
()
{
...
...
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
e59d5b80
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
:chart=
"chart"
:chart=
"chart"
:track-menu=
"trackMenu"
:track-menu=
"trackMenu"
:search-count=
"searchCount"
:search-count=
"searchCount"
:terminal-type=
"scaleCoefficientType"
@
onChartClick=
"chartClick"
@
onChartClick=
"chartClick"
@
onJumpClick=
"jumpClick"
@
onJumpClick=
"jumpClick"
/>
/>
...
@@ -141,10 +142,17 @@ export default {
...
@@ -141,10 +142,17 @@ export default {
},
},
computed
:
{
computed
:
{
scaleCoefficient
()
{
scaleCoefficient
()
{
if
(
this
.
terminal
===
'pc'
)
{
if
(
this
.
terminal
===
'pc'
&&
!
this
.
mobileLayoutStatus
)
{
return
1.1
return
1.1
}
else
{
}
else
{
return
4
return
4.5
}
},
scaleCoefficientType
()
{
if
(
this
.
terminal
===
'pc'
&&
!
this
.
mobileLayoutStatus
)
{
return
'pc'
}
else
{
return
'mobile'
}
}
},
},
editBarViewShowFlag
()
{
editBarViewShowFlag
()
{
...
@@ -226,7 +234,8 @@ export default {
...
@@ -226,7 +234,8 @@ export default {
'nowPanelTrackInfo'
,
'nowPanelTrackInfo'
,
'nowPanelJumpInfo'
,
'nowPanelJumpInfo'
,
'publicLinkStatus'
,
'publicLinkStatus'
,
'previewCanvasScale'
'previewCanvasScale'
,
'mobileLayoutStatus'
])
])
},
},
...
@@ -309,17 +318,18 @@ export default {
...
@@ -309,17 +318,18 @@ export default {
const
scale
=
Math
.
min
(
this
.
previewCanvasScale
.
scalePointWidth
,
this
.
previewCanvasScale
.
scalePointHeight
)
*
this
.
scaleCoefficient
const
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
)
recursionTransObj
(
customAttrTrans
,
customAttrChart
,
scale
,
this
.
scaleCoefficientType
)
recursionTransObj
(
customStyleTrans
,
customStyleChart
,
scale
)
recursionTransObj
(
customStyleTrans
,
customStyleChart
,
scale
,
this
.
scaleCoefficientType
)
// 移动端地图标签不显示
if
(
this
.
chart
.
type
===
'map'
&&
this
.
scaleCoefficientType
===
'mobile'
)
{
customAttrChart
.
label
.
show
=
false
}
this
.
chart
=
{
this
.
chart
=
{
...
this
.
chart
,
...
this
.
chart
,
customAttr
:
JSON
.
stringify
(
customAttrChart
),
customAttr
:
JSON
.
stringify
(
customAttrChart
),
customStyle
:
JSON
.
stringify
(
customStyleChart
)
customStyle
:
JSON
.
stringify
(
customStyleChart
)
}
}
// console.log('customAttrChartSource:' + JSON.stringify(JSON.parse(this.sourceCustomAttrStr)))
// console.log('customAttrChart:' + JSON.stringify(customAttrChart))
// console.log('customStyleChartSource:' + JSON.stringify(JSON.parse(this.sourceCustomStyleStr)))
// console.log('customStyleChart:' + JSON.stringify(customStyleChart))
this
.
mergeStyle
()
this
.
mergeStyle
()
},
},
mergeStyle
()
{
mergeStyle
()
{
...
...
frontend/src/components/canvas/utils/style.js
浏览文件 @
e59d5b80
...
@@ -150,27 +150,36 @@ export const customStyleTrans = {
...
@@ -150,27 +150,36 @@ export const customStyleTrans = {
}
}
}
}
// 移动端特殊属性
export
const
mobileSpecialProps
=
{
'lineWidth'
:
3
,
// 线宽固定值
'lineSymbolSize'
:
5
// 折点固定值
}
export
function
getScaleValue
(
propValue
,
scale
)
{
export
function
getScaleValue
(
propValue
,
scale
)
{
const
propValueTemp
=
Math
.
round
(
propValue
*
scale
)
const
propValueTemp
=
Math
.
round
(
propValue
*
scale
)
return
propValueTemp
>
1
?
propValueTemp
:
1
return
propValueTemp
>
1
?
propValueTemp
:
1
}
}
export
function
recursionTransObj
(
template
,
infoObj
,
scale
)
{
export
function
recursionTransObj
(
template
,
infoObj
,
scale
,
terminal
)
{
// console.log('recursionObj++')
for
(
const
templateKey
in
template
)
{
for
(
const
templateKey
in
template
)
{
// 如果是数组 进行赋值计算
// 如果是数组 进行赋值计算
if
(
template
[
templateKey
]
instanceof
Array
)
{
if
(
template
[
templateKey
]
instanceof
Array
)
{
template
[
templateKey
].
forEach
(
templateProp
=>
{
template
[
templateKey
].
forEach
(
templateProp
=>
{
if
(
infoObj
[
templateKey
]
&&
infoObj
[
templateKey
][
templateProp
])
{
if
(
infoObj
[
templateKey
]
&&
infoObj
[
templateKey
][
templateProp
])
{
const
afterValue
=
getScaleValue
(
infoObj
[
templateKey
][
templateProp
],
scale
)
// 移动端特殊属性值设置
console
.
log
(
templateKey
+
'.'
+
templateProp
+
'='
+
infoObj
[
templateKey
][
templateProp
]
+
';scale:'
+
scale
+
',after:'
+
afterValue
)
if
(
terminal
===
'mobile'
&&
mobileSpecialProps
[
templateProp
]
!==
undefined
)
{
infoObj
[
templateKey
][
templateProp
]
=
afterValue
// console.log('mobile:' + templateProp + mobileSpecialProps[templateProp])
infoObj
[
templateKey
][
templateProp
]
=
mobileSpecialProps
[
templateProp
]
}
else
{
infoObj
[
templateKey
][
templateProp
]
=
getScaleValue
(
infoObj
[
templateKey
][
templateProp
],
scale
)
}
}
}
})
})
}
else
{
}
else
{
// 如果是对象 继续进行递归
// 如果是对象 继续进行递归
if
(
infoObj
[
templateKey
])
{
if
(
infoObj
[
templateKey
])
{
recursionTransObj
(
template
[
templateKey
],
infoObj
[
templateKey
],
scale
)
recursionTransObj
(
template
[
templateKey
],
infoObj
[
templateKey
],
scale
,
terminal
)
}
}
}
}
}
}
...
...
frontend/src/views/chart/chart/scatter/scatter.js
浏览文件 @
e59d5b80
...
@@ -2,8 +2,10 @@ import { hexColorToRGBA } from '@/views/chart/chart/util'
...
@@ -2,8 +2,10 @@ import { hexColorToRGBA } from '@/views/chart/chart/util'
import
{
componentStyle
}
from
'../common/common'
import
{
componentStyle
}
from
'../common/common'
let
bubbleArray
=
[]
let
bubbleArray
=
[]
let
terminalType
=
'pc'
export
function
baseScatterOption
(
chart_option
,
chart
)
{
export
function
baseScatterOption
(
chart_option
,
chart
,
terminal
=
'pc'
)
{
terminalType
=
terminal
// 处理shape attr
// 处理shape attr
let
customAttr
=
{}
let
customAttr
=
{}
if
(
chart
.
customAttr
)
{
if
(
chart
.
customAttr
)
{
...
@@ -59,7 +61,7 @@ export function baseScatterOption(chart_option, chart) {
...
@@ -59,7 +61,7 @@ export function baseScatterOption(chart_option, chart) {
}
}
const
funcSize
=
function
(
data
)
{
const
funcSize
=
function
(
data
)
{
const
k
=
8
0
const
k
=
terminalType
===
'pc'
?
80
:
3
0
const
max
=
Math
.
max
(...
bubbleArray
)
const
max
=
Math
.
max
(...
bubbleArray
)
return
(
data
[
2
]
/
max
)
*
k
return
(
data
[
2
]
/
max
)
*
k
}
}
frontend/src/views/chart/components/ChartComponent.vue
浏览文件 @
e59d5b80
...
@@ -60,6 +60,10 @@ export default {
...
@@ -60,6 +60,10 @@ export default {
type
:
Number
,
type
:
Number
,
required
:
false
,
required
:
false
,
default
:
0
default
:
0
},
terminalType
:
{
type
:
String
,
default
:
'pc'
}
}
},
},
data
()
{
data
()
{
...
@@ -154,7 +158,7 @@ export default {
...
@@ -154,7 +158,7 @@ export default {
}
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
)
}
else
if
(
chart
.
type
===
'scatter'
)
{
}
else
if
(
chart
.
type
===
'scatter'
)
{
chart_option
=
baseScatterOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_SCATTER
)),
chart
)
chart_option
=
baseScatterOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_SCATTER
)),
chart
,
this
.
terminalType
)
}
else
if
(
chart
.
type
===
'treemap'
)
{
}
else
if
(
chart
.
type
===
'treemap'
)
{
chart_option
=
baseTreemapOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_TREEMAP
)),
chart
)
chart_option
=
baseTreemapOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_TREEMAP
)),
chart
)
}
else
if
(
chart
.
type
===
'chart-mix'
)
{
}
else
if
(
chart
.
type
===
'chart-mix'
)
{
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
e59d5b80
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
<el-row
v-if=
"mobileLayoutStatus"
class=
"mobile_canvas_main"
>
<el-row
v-if=
"mobileLayoutStatus"
class=
"mobile_canvas_main"
>
<el-col
:span=
"8"
class=
"this_mobile_canvas_cell"
>
<el-col
:span=
"8"
class=
"this_mobile_canvas_cell"
>
<div
<div
v-proportion=
"2.
5
"
v-proportion=
"2.
1
"
:style=
"customCanvasMobileStyle"
:style=
"customCanvasMobileStyle"
class=
"this_mobile_canvas"
class=
"this_mobile_canvas"
@
drop=
"handleDrop"
@
drop=
"handleDrop"
...
@@ -955,10 +955,10 @@ export default {
...
@@ -955,10 +955,10 @@ export default {
.this_mobile_canvas
{
.this_mobile_canvas
{
border-radius
:
30px
;
border-radius
:
30px
;
min-width
:
28
0px
;
min-width
:
30
0px
;
max-width
:
3
0
0px
;
max-width
:
3
5
0px
;
min-height
:
7
00px
;
min-height
:
6
00px
;
max-height
:
7
5
0px
;
max-height
:
7
0
0px
;
overflow
:
hidden
;
overflow
:
hidden
;
background-color
:
#000000
;
background-color
:
#000000
;
background-size
:
100%
100%
!
important
;
background-size
:
100%
100%
!
important
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论