Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
fec7a677
提交
fec7a677
authored
5月 20, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 批量修改样式优化
上级
7db5e731
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
87 行增加
和
40 行删除
+87
-40
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+1
-1
index.vue
frontend/src/components/DeDrag/index.vue
+1
-1
EditBar.vue
frontend/src/components/canvas/components/Editor/EditBar.vue
+1
-1
Preview.vue
frontend/src/components/canvas/components/Editor/Preview.vue
+8
-6
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+4
-1
index.js
frontend/src/store/index.js
+9
-2
chart.js
frontend/src/views/chart/chart/chart.js
+2
-1
TitleSelector.vue
.../views/chart/components/component-style/TitleSelector.vue
+21
-11
TitleSelectorAntV.vue
...ws/chart/components/component-style/TitleSelectorAntV.vue
+21
-12
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+3
-2
ChartStyle.vue
frontend/src/views/chart/view/ChartStyle.vue
+5
-2
ChartStyleBack.vue
frontend/src/views/chart/view/ChartStyleBack.vue
+0
-0
PanelMain.vue
frontend/src/views/panel/list/PanelMain.vue
+11
-0
没有找到文件。
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
fec7a677
...
@@ -124,7 +124,7 @@ public class PanelGroupService {
...
@@ -124,7 +124,7 @@ public class PanelGroupService {
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
panelId
=
newPanel
(
request
);
panelId
=
newPanel
(
request
);
panelGroupMapper
.
insert
(
request
);
panelGroupMapper
.
insert
Selective
(
request
);
// 清理权限缓存
// 清理权限缓存
clearPermissionCache
();
clearPermissionCache
();
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
...
...
frontend/src/components/DeDrag/index.vue
浏览文件 @
fec7a677
...
@@ -1851,7 +1851,7 @@ export default {
...
@@ -1851,7 +1851,7 @@ export default {
}
}
.batchSetting
{
.batchSetting
{
opacity
:
0.
7
;
opacity
:
0.
9
;
}
}
.positionChange
{
.positionChange
{
...
...
frontend/src/components/canvas/components/Editor/EditBar.vue
浏览文件 @
fec7a677
...
@@ -91,7 +91,7 @@ export default {
...
@@ -91,7 +91,7 @@ export default {
},
},
// batch operation area
// batch operation area
batchOptAreaShow
()
{
batchOptAreaShow
()
{
return
this
.
batchOptStatus
&&
this
.
element
.
type
===
'view'
return
this
.
batchOptStatus
&&
this
.
element
.
type
===
'view'
&&
!
this
.
element
.
isPlugin
},
},
// 联动区域按钮显示
// 联动区域按钮显示
linkageAreaShow
()
{
linkageAreaShow
()
{
...
...
frontend/src/components/canvas/components/Editor/Preview.vue
浏览文件 @
fec7a677
...
@@ -256,13 +256,15 @@ export default {
...
@@ -256,13 +256,15 @@ export default {
})
})
// 监听画布div变动事件
// 监听画布div变动事件
const
tempCanvas
=
document
.
getElementById
(
'canvasInfoTemp'
)
const
tempCanvas
=
document
.
getElementById
(
'canvasInfoTemp'
)
erd
.
listenTo
(
document
.
getElementById
(
'canvasInfoTemp'
),
element
=>
{
if
(
tempCanvas
)
{
_this
.
$nextTick
(()
=>
{
erd
.
listenTo
(
document
.
getElementById
(
'canvasInfoTemp'
),
element
=>
{
// 将mainHeight 修改为px 临时解决html2canvas 截图不全的问题
_this
.
$nextTick
(()
=>
{
_this
.
mainHeight
=
tempCanvas
.
scrollHeight
+
'px!important'
// 将mainHeight 修改为px 临时解决html2canvas 截图不全的问题
this
.
$emit
(
'mainHeightChange'
,
_this
.
mainHeight
)
_this
.
mainHeight
=
tempCanvas
.
scrollHeight
+
'px!important'
this
.
$emit
(
'mainHeightChange'
,
_this
.
mainHeight
)
})
})
})
}
)
}
eventBus
.
$on
(
'openChartDetailsDialog'
,
this
.
openChartDetailsDialog
)
eventBus
.
$on
(
'openChartDetailsDialog'
,
this
.
openChartDetailsDialog
)
_this
.
$store
.
commit
(
'clearLinkageSettingInfo'
,
false
)
_this
.
$store
.
commit
(
'clearLinkageSettingInfo'
,
false
)
_this
.
canvasStyleDataInit
()
_this
.
canvasStyleDataInit
()
...
...
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
fec7a677
...
@@ -412,8 +412,11 @@ export default {
...
@@ -412,8 +412,11 @@ export default {
this
.
chart
.
customAttr
=
this
.
sourceCustomAttrStr
this
.
chart
.
customAttr
=
this
.
sourceCustomAttrStr
updateParams
[
'customAttr'
]
=
this
.
sourceCustomAttrStr
updateParams
[
'customAttr'
]
=
this
.
sourceCustomAttrStr
}
else
if
(
param
.
custom
===
'customStyle'
)
{
}
else
if
(
param
.
custom
===
'customStyle'
)
{
this
.
sourceCustomStyleStr
=
this
.
chart
.
customStyle
const
sourceCustomStyle
=
JSON
.
parse
(
this
.
sourceCustomStyleStr
)
const
sourceCustomStyle
=
JSON
.
parse
(
this
.
sourceCustomStyleStr
)
// view's title use history
if
(
param
.
property
===
'text'
)
{
param
.
value
.
title
=
sourceCustomStyle
.
text
.
title
}
sourceCustomStyle
[
param
.
property
]
=
param
.
value
sourceCustomStyle
[
param
.
property
]
=
param
.
value
this
.
sourceCustomStyleStr
=
JSON
.
stringify
(
sourceCustomStyle
)
this
.
sourceCustomStyleStr
=
JSON
.
stringify
(
sourceCustomStyle
)
this
.
chart
.
customStyle
=
this
.
sourceCustomStyleStr
this
.
chart
.
customStyle
=
this
.
sourceCustomStyleStr
...
...
frontend/src/store/index.js
浏览文件 @
fec7a677
...
@@ -125,7 +125,8 @@ const data = {
...
@@ -125,7 +125,8 @@ const data = {
changeProperties
:
{
changeProperties
:
{
customStyle
:
{},
customStyle
:
{},
customAttr
:
{}
customAttr
:
{}
}
},
allViewRender
:
[]
},
},
mutations
:
{
mutations
:
{
...
animation
.
mutations
,
...
animation
.
mutations
,
...
@@ -550,7 +551,7 @@ const data = {
...
@@ -550,7 +551,7 @@ const data = {
// get view base info
// get view base info
const
viewBaseInfo
=
state
.
componentViewsData
[
id
]
const
viewBaseInfo
=
state
.
componentViewsData
[
id
]
// get properties
// get properties
const
viewConfig
=
TYPE_CONFIGS
.
filter
(
item
=>
item
.
render
===
viewBaseInfo
.
render
&&
item
.
value
===
viewBaseInfo
.
type
)
const
viewConfig
=
state
.
allViewRender
.
filter
(
item
=>
item
.
render
===
viewBaseInfo
.
render
&&
item
.
value
===
viewBaseInfo
.
type
)
const
viewProperties
=
viewConfig
?
viewConfig
[
0
].
properties
:
[]
const
viewProperties
=
viewConfig
?
viewConfig
[
0
].
properties
:
[]
if
(
state
.
mixProperties
.
length
>
0
)
{
if
(
state
.
mixProperties
.
length
>
0
)
{
// If it exists , taking the intersection
// If it exists , taking the intersection
...
@@ -641,6 +642,12 @@ const data = {
...
@@ -641,6 +642,12 @@ const data = {
customStyle
:
{},
customStyle
:
{},
customAttr
:
{}
customAttr
:
{}
}
}
},
initViewRender
(
state
,
pluginViews
)
{
pluginViews
.
forEach
(
plugin
=>
{
plugin
.
isPlugin
=
true
})
state
.
allViewRender
=
[...
TYPE_CONFIGS
,
...
pluginViews
]
}
}
},
},
modules
:
{
modules
:
{
...
...
frontend/src/views/chart/chart/chart.js
浏览文件 @
fec7a677
...
@@ -8,7 +8,8 @@ export const DEFAULT_COLOR_CASE = {
...
@@ -8,7 +8,8 @@ export const DEFAULT_COLOR_CASE = {
tableStripe
:
true
,
tableStripe
:
true
,
dimensionColor
:
'#000000'
,
dimensionColor
:
'#000000'
,
quotaColor
:
'#000000'
,
quotaColor
:
'#000000'
,
tableBorderColor
:
'#cfdaf4'
tableBorderColor
:
'#cfdaf4'
,
seriesColors
:
[]
// 格式:{"name":"s1","color":"","isCustom":false}
}
}
export
const
DEFAULT_SIZE
=
{
export
const
DEFAULT_SIZE
=
{
barDefault
:
true
,
barDefault
:
true
,
...
...
frontend/src/views/chart/components/component-style/TitleSelector.vue
浏览文件 @
fec7a677
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<el-checkbox
v-model=
"titleForm.show"
@
change=
"changeTitleStyle"
>
{{
$t
(
'chart.show'
)
}}
</el-checkbox>
<el-checkbox
v-model=
"titleForm.show"
@
change=
"changeTitleStyle"
>
{{
$t
(
'chart.show'
)
}}
</el-checkbox>
</el-form-item>
</el-form-item>
<div
v-show=
"titleForm.show"
>
<div
v-show=
"titleForm.show"
>
<el-form-item
:label=
"$t('chart.title')"
class=
"form-item"
>
<el-form-item
v-if=
"!batchOptStatus"
:label=
"$t('chart.title')"
class=
"form-item"
>
<el-input
<el-input
v-model=
"titleForm.title"
v-model=
"titleForm.title"
size=
"mini"
size=
"mini"
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
<
script
>
<
script
>
import
{
COLOR_PANEL
,
DEFAULT_TITLE_STYLE
}
from
'../../chart/chart'
import
{
COLOR_PANEL
,
DEFAULT_TITLE_STYLE
}
from
'../../chart/chart'
import
{
checkViewTitle
}
from
'@/components/canvas/utils/utils'
import
{
checkViewTitle
}
from
'@/components/canvas/utils/utils'
import
{
mapState
}
from
'vuex'
export
default
{
export
default
{
name
:
'TitleSelector'
,
name
:
'TitleSelector'
,
...
@@ -79,6 +80,11 @@ export default {
...
@@ -79,6 +80,11 @@ export default {
}
}
}
}
},
},
computed
:
{
...
mapState
([
'batchOptStatus'
])
},
mounted
()
{
mounted
()
{
this
.
init
()
this
.
init
()
this
.
initData
()
this
.
initData
()
...
@@ -96,7 +102,9 @@ export default {
...
@@ -96,7 +102,9 @@ export default {
if
(
customStyle
.
text
)
{
if
(
customStyle
.
text
)
{
this
.
titleForm
=
customStyle
.
text
this
.
titleForm
=
customStyle
.
text
}
}
this
.
titleForm
.
title
=
this
.
chart
.
title
if
(
!
this
.
batchOptStatus
)
{
this
.
titleForm
.
title
=
this
.
chart
.
title
}
}
}
},
},
init
()
{
init
()
{
...
@@ -110,15 +118,17 @@ export default {
...
@@ -110,15 +118,17 @@ export default {
this
.
fontSize
=
arr
this
.
fontSize
=
arr
},
},
changeTitleStyle
()
{
changeTitleStyle
()
{
if
(
this
.
titleForm
.
title
.
length
<
1
)
{
if
(
!
this
.
batchOptStatus
)
{
this
.
$error
(
this
.
$t
(
'chart.title_cannot_empty'
))
if
(
this
.
titleForm
.
title
.
length
<
1
)
{
this
.
titleForm
.
title
=
this
.
chart
.
title
this
.
$error
(
this
.
$t
(
'chart.title_cannot_empty'
))
return
this
.
titleForm
.
title
=
this
.
chart
.
title
}
return
if
(
checkViewTitle
(
'update'
,
this
.
chart
.
id
,
this
.
titleForm
.
title
))
{
}
this
.
$error
(
this
.
$t
(
'chart.title_repeat'
))
if
(
checkViewTitle
(
'update'
,
this
.
chart
.
id
,
this
.
titleForm
.
title
))
{
this
.
titleForm
.
title
=
this
.
chart
.
title
this
.
$error
(
this
.
$t
(
'chart.title_repeat'
))
return
this
.
titleForm
.
title
=
this
.
chart
.
title
return
}
}
}
if
(
!
this
.
titleForm
.
show
)
{
if
(
!
this
.
titleForm
.
show
)
{
this
.
isSetting
=
false
this
.
isSetting
=
false
...
...
frontend/src/views/chart/components/component-style/TitleSelectorAntV.vue
浏览文件 @
fec7a677
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<el-checkbox
v-model=
"titleForm.show"
@
change=
"changeTitleStyle"
>
{{
$t
(
'chart.show'
)
}}
</el-checkbox>
<el-checkbox
v-model=
"titleForm.show"
@
change=
"changeTitleStyle"
>
{{
$t
(
'chart.show'
)
}}
</el-checkbox>
</el-form-item>
</el-form-item>
<div
v-show=
"titleForm.show"
>
<div
v-show=
"titleForm.show"
>
<el-form-item
:label=
"$t('chart.title')"
class=
"form-item"
>
<el-form-item
v-if=
"!this.batchOptStatus"
:label=
"$t('chart.title')"
class=
"form-item"
>
<el-input
<el-input
v-model=
"titleForm.title"
v-model=
"titleForm.title"
size=
"mini"
size=
"mini"
...
@@ -43,8 +43,8 @@
...
@@ -43,8 +43,8 @@
<
script
>
<
script
>
import
{
COLOR_PANEL
,
DEFAULT_TITLE_STYLE
}
from
'../../chart/chart'
import
{
COLOR_PANEL
,
DEFAULT_TITLE_STYLE
}
from
'../../chart/chart'
import
{
checkTitle
}
from
'@/api/chart/chart'
import
{
checkViewTitle
}
from
'@/components/canvas/utils/utils'
import
{
checkViewTitle
}
from
'@/components/canvas/utils/utils'
import
{
mapState
}
from
'vuex'
export
default
{
export
default
{
name
:
'TitleSelectorAntV'
,
name
:
'TitleSelectorAntV'
,
...
@@ -66,6 +66,11 @@ export default {
...
@@ -66,6 +66,11 @@ export default {
predefineColors
:
COLOR_PANEL
predefineColors
:
COLOR_PANEL
}
}
},
},
computed
:
{
...
mapState
([
'batchOptStatus'
])
},
watch
:
{
watch
:
{
'chart'
:
{
'chart'
:
{
handler
:
function
()
{
handler
:
function
()
{
...
@@ -90,7 +95,9 @@ export default {
...
@@ -90,7 +95,9 @@ export default {
if
(
customStyle
.
text
)
{
if
(
customStyle
.
text
)
{
this
.
titleForm
=
customStyle
.
text
this
.
titleForm
=
customStyle
.
text
}
}
this
.
titleForm
.
title
=
this
.
chart
.
title
if
(
!
this
.
batchOptStatus
)
{
this
.
titleForm
.
title
=
this
.
chart
.
title
}
}
}
},
},
init
()
{
init
()
{
...
@@ -104,15 +111,17 @@ export default {
...
@@ -104,15 +111,17 @@ export default {
this
.
fontSize
=
arr
this
.
fontSize
=
arr
},
},
changeTitleStyle
()
{
changeTitleStyle
()
{
if
(
this
.
titleForm
.
title
.
length
<
1
)
{
if
(
!
this
.
batchOptStatus
)
{
this
.
$error
(
this
.
$t
(
'chart.title_cannot_empty'
))
if
(
this
.
titleForm
.
title
.
length
<
1
)
{
this
.
titleForm
.
title
=
this
.
chart
.
title
this
.
$error
(
this
.
$t
(
'chart.title_cannot_empty'
))
return
this
.
titleForm
.
title
=
this
.
chart
.
title
}
return
if
(
checkViewTitle
(
'update'
,
this
.
chart
.
id
,
this
.
titleForm
.
title
))
{
}
this
.
$error
(
this
.
$t
(
'chart.title_repeat'
))
if
(
checkViewTitle
(
'update'
,
this
.
chart
.
id
,
this
.
titleForm
.
title
))
{
this
.
titleForm
.
title
=
this
.
chart
.
title
this
.
$error
(
this
.
$t
(
'chart.title_repeat'
))
return
this
.
titleForm
.
title
=
this
.
chart
.
title
return
}
}
}
this
.
$emit
(
'onTextChange'
,
this
.
titleForm
)
this
.
$emit
(
'onTextChange'
,
this
.
titleForm
)
},
},
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
fec7a677
...
@@ -1170,7 +1170,7 @@ export default {
...
@@ -1170,7 +1170,7 @@ export default {
chartProperties
()
{
chartProperties
()
{
const
_this
=
this
const
_this
=
this
if
(
_this
.
chart
&&
_this
.
chart
.
render
)
{
if
(
_this
.
chart
&&
_this
.
chart
.
render
)
{
const
viewConfig
=
TYPE_CONFIGS
.
filter
(
item
=>
item
.
render
===
_this
.
chart
.
render
&&
item
.
value
===
_this
.
chart
.
type
)
const
viewConfig
=
this
.
allViewRender
.
filter
(
item
=>
item
.
render
===
_this
.
chart
.
render
&&
item
.
value
===
_this
.
chart
.
type
)
if
(
viewConfig
&&
viewConfig
.
length
)
{
if
(
viewConfig
&&
viewConfig
.
length
)
{
return
viewConfig
[
0
].
properties
return
viewConfig
[
0
].
properties
}
else
{
}
else
{
...
@@ -1188,7 +1188,8 @@ export default {
...
@@ -1188,7 +1188,8 @@ export default {
},
},
...
mapState
([
...
mapState
([
'curComponent'
,
'curComponent'
,
'panelViewEditInfo'
'panelViewEditInfo'
,
'allViewRender'
])
])
/* pluginRenderOptions() {
/* pluginRenderOptions() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
...
...
frontend/src/views/chart/view/ChartStyle.vue
浏览文件 @
fec7a677
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
style=
"overflow:auto;border-right: 1px solid #e6e6e6;height: 100%;width: 100%;padding-right: 6px"
style=
"overflow:auto;border-right: 1px solid #e6e6e6;height: 100%;width: 100%;padding-right: 6px"
class=
"attr-style theme-border-class"
class=
"attr-style theme-border-class"
>
>
<el-row
v-if=
"
chart.mode!=='batchOpt'
"
class=
"padding-lr"
>
<el-row
v-if=
"
!batchOptStatus
"
class=
"padding-lr"
>
<span
class=
"title-text"
>
{{
$t
(
'chart.style_priority'
)
}}
</span>
<span
class=
"title-text"
>
{{
$t
(
'chart.style_priority'
)
}}
</span>
<el-row>
<el-row>
<el-radio-group
<el-radio-group
...
@@ -274,6 +274,7 @@ import LegendSelectorAntV from '@/views/chart/components/component-style/LegendS
...
@@ -274,6 +274,7 @@ import LegendSelectorAntV from '@/views/chart/components/component-style/LegendS
import
BackgroundColorSelector
from
'@/views/chart/components/component-style/BackgroundColorSelector'
import
BackgroundColorSelector
from
'@/views/chart/components/component-style/BackgroundColorSelector'
import
SplitSelector
from
'@/views/chart/components/component-style/SplitSelector'
import
SplitSelector
from
'@/views/chart/components/component-style/SplitSelector'
import
SplitSelectorAntV
from
'@/views/chart/components/component-style/SplitSelectorAntV'
import
SplitSelectorAntV
from
'@/views/chart/components/component-style/SplitSelectorAntV'
import
{
mapState
}
from
'vuex'
export
default
{
export
default
{
name
:
'ChartStyle'
,
name
:
'ChartStyle'
,
...
@@ -321,7 +322,9 @@ export default {
...
@@ -321,7 +322,9 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
...
mapState
([
'batchOptStatus'
])
},
},
created
()
{
created
()
{
...
...
frontend/src/views/chart/view/ChartStyleBack.vue
deleted
100644 → 0
浏览文件 @
7db5e731
差异被折叠。
点击展开。
frontend/src/views/panel/list/PanelMain.vue
浏览文件 @
fec7a677
...
@@ -30,6 +30,7 @@ import PanelList from '../list/PanelList'
...
@@ -30,6 +30,7 @@ import PanelList from '../list/PanelList'
import
PanelViewShow
from
'../list/PanelViewShow'
import
PanelViewShow
from
'../list/PanelViewShow'
import
ShareTree
from
'../GrantAuth/shareTree'
import
ShareTree
from
'../GrantAuth/shareTree'
import
Enshrine
from
'../enshrine/index'
import
Enshrine
from
'../enshrine/index'
import
{
pluginTypes
}
from
'@/api/chart/chart'
export
default
{
export
default
{
name
:
'PanelMain'
,
name
:
'PanelMain'
,
...
@@ -59,6 +60,16 @@ export default {
...
@@ -59,6 +60,16 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
// init all views (include plugins) base info
localStorage
.
removeItem
(
'plugin-views'
)
pluginTypes
().
then
(
res
=>
{
const
plugins
=
res
.
data
localStorage
.
setItem
(
'plugin-views'
,
JSON
.
stringify
(
plugins
))
this
.
$store
.
commit
(
'initViewRender'
,
plugins
)
}).
catch
(
e
=>
{
localStorage
.
setItem
(
'plugin-views'
,
null
)
this
.
$store
.
commit
(
'initViewRender'
,
plugins
)
})
this
.
clear
()
this
.
clear
()
},
},
methods
:
{
methods
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论