Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
7f895505
Unverified
提交
7f895505
authored
8月 16, 2021
作者:
XiaJunjie2020
提交者:
GitHub
8月 16, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #635 from dataease/pr@dev@feat_color
feat: 视图支持简单颜色修改
上级
94447f0f
3386b1dd
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
91 行增加
和
11 行删除
+91
-11
en.js
frontend/src/lang/en.js
+3
-1
tw.js
frontend/src/lang/tw.js
+3
-1
zh.js
frontend/src/lang/zh.js
+3
-1
ColorSelector.vue
...d/src/views/chart/components/shape-attr/ColorSelector.vue
+82
-8
没有找到文件。
frontend/src/lang/en.js
浏览文件 @
7f895505
...
@@ -840,7 +840,9 @@ export default {
...
@@ -840,7 +840,9 @@ export default {
bubble_symbol
:
'Shape'
,
bubble_symbol
:
'Shape'
,
gap_width
:
'Gap Width'
,
gap_width
:
'Gap Width'
,
width
:
'Width'
,
width
:
'Width'
,
height
:
'Height'
height
:
'Height'
,
system_case
:
'System'
,
custom_case
:
'Custom'
},
},
dataset
:
{
dataset
:
{
sheet_warn
:
'There are multiple sheet pages, and the first one is extracted by default'
,
sheet_warn
:
'There are multiple sheet pages, and the first one is extracted by default'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
7f895505
...
@@ -840,7 +840,9 @@ export default {
...
@@ -840,7 +840,9 @@ export default {
bubble_symbol
:
'圖形'
,
bubble_symbol
:
'圖形'
,
gap_width
:
'間隔'
,
gap_width
:
'間隔'
,
width
:
'寬度'
,
width
:
'寬度'
,
height
:
'高度'
height
:
'高度'
,
system_case
:
'系統方案'
,
custom_case
:
'自定義'
},
},
dataset
:
{
dataset
:
{
sheet_warn
:
'有多個sheet頁面,默認抽取第一個'
,
sheet_warn
:
'有多個sheet頁面,默認抽取第一個'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
7f895505
...
@@ -840,7 +840,9 @@ export default {
...
@@ -840,7 +840,9 @@ export default {
bubble_symbol
:
'图形'
,
bubble_symbol
:
'图形'
,
gap_width
:
'间隔'
,
gap_width
:
'间隔'
,
width
:
'宽度'
,
width
:
'宽度'
,
height
:
'高度'
height
:
'高度'
,
system_case
:
'系统方案'
,
custom_case
:
'自定义'
},
},
dataset
:
{
dataset
:
{
sheet_warn
:
'有多个 Sheet 页,默认抽取第一个'
,
sheet_warn
:
'有多个 Sheet 页,默认抽取第一个'
,
...
...
frontend/src/views/chart/components/shape-attr/ColorSelector.vue
浏览文件 @
7f895505
...
@@ -4,14 +4,46 @@
...
@@ -4,14 +4,46 @@
<el-form
ref=
"colorForm"
:model=
"colorForm"
label-width=
"80px"
size=
"mini"
:disabled=
"param && !hasDataPermission('manage',param.privileges)"
>
<el-form
ref=
"colorForm"
:model=
"colorForm"
label-width=
"80px"
size=
"mini"
:disabled=
"param && !hasDataPermission('manage',param.privileges)"
>
<div
v-if=
"sourceType==='view' || sourceType==='panelEchart'"
>
<div
v-if=
"sourceType==='view' || sourceType==='panelEchart'"
>
<el-form-item
v-show=
"chart.type && !chart.type.includes('table') && !chart.type.includes('text')"
:label=
"$t('chart.color_case')"
class=
"form-item"
>
<el-form-item
v-show=
"chart.type && !chart.type.includes('table') && !chart.type.includes('text')"
:label=
"$t('chart.color_case')"
class=
"form-item"
>
<el-select
v-model=
"colorForm.value"
:placeholder=
"$t('chart.pls_slc_color_case')"
size=
"mini"
@
change=
"changeColorCase"
>
<el-popover
<el-option
v-for=
"option in colorCases"
:key=
"option.value"
:label=
"option.name"
:value=
"option.value"
style=
"display: flex;align-items: center;"
>
placement=
"bottom"
<div
style=
"float: left"
>
width=
"400"
<span
v-for=
"(c,index) in option.colors"
:key=
"index"
:style=
"
{width: '20px',height: '20px',float: 'left',backgroundColor: c}" />
trigger=
"click"
:disabled=
"param && !hasDataPermission('manage',param.privileges)"
>
<div
style=
"padding: 6px 10px;"
>
<div>
<span
class=
"color-label"
>
{{
$t
(
'chart.system_case'
)
}}
</span>
<el-select
v-model=
"colorForm.value"
:placeholder=
"$t('chart.pls_slc_color_case')"
size=
"mini"
@
change=
"changeColorCase"
>
<el-option
v-for=
"option in colorCases"
:key=
"option.value"
:label=
"option.name"
:value=
"option.value"
style=
"display: flex;align-items: center;"
>
<div
style=
"float: left"
>
<span
v-for=
"(c,index) in option.colors"
:key=
"index"
:style=
"
{width: '20px',height: '20px',float: 'left',backgroundColor: c}" />
</div>
<span
style=
"margin-left: 4px;"
>
{{
option
.
name
}}
</span>
</el-option>
</el-select>
<el-button
size=
"mini"
type=
"text"
style=
"margin-left: 2px;"
@
click=
"resetCustomColor"
>
{{
$t
(
'commons.reset'
)
}}
</el-button>
</div>
</div>
<span
style=
"margin-left: 4px;"
>
{{
option
.
name
}}
</span>
<div
style=
"display: flex;align-items: center;margin-top: 10px;"
>
</el-option>
<span
class=
"color-label"
>
{{
$t
(
'chart.custom_case'
)
}}
</span>
</el-select>
<span>
<el-radio-group
v-model=
"customColor"
class=
"color-type"
>
<el-radio
v-for=
"(c,index) in colorForm.colors"
:key=
"index"
:label=
"c"
style=
"padding: 2px;"
@
change=
"switchColor(index)"
>
<span
:style=
"
{width: '20px',height: '20px',display:'inline-block',backgroundColor: c}" />
</el-radio>
</el-radio-group>
</span>
</div>
<div
style=
"display: flex;align-items: center;margin-top: 10px;"
>
<span
class=
"color-label"
/>
<span>
<el-color-picker
v-model=
"customColor"
class=
"color-picker-style"
@
change=
"switchColorCase"
/>
</span>
</div>
</div>
<div
slot=
"reference"
style=
"cursor: pointer;margin-top: 2px;"
>
<span
v-for=
"(c,index) in colorForm.colors"
:key=
"index"
:style=
"
{width: '20px',height: '20px',display:'inline-block',backgroundColor: c}" />
</div>
</el-popover>
</el-form-item>
</el-form-item>
<el-form-item
v-show=
"(chart.type && chart.type.includes('text')) || sourceType==='panelTable'"
:label=
"$t('chart.dimension_color')"
class=
"form-item"
>
<el-form-item
v-show=
"(chart.type && chart.type.includes('text')) || sourceType==='panelTable'"
:label=
"$t('chart.dimension_color')"
class=
"form-item"
>
...
@@ -149,12 +181,16 @@ export default {
...
@@ -149,12 +181,16 @@ export default {
colors
:
[
'#00a3af'
,
'#4da798'
,
'#57baaa'
,
'#62d0bd'
,
'#6ee4d0'
,
'#86e7d6'
,
'#aeede1'
,
'#bde1e6'
,
'#e5e5e5'
]
colors
:
[
'#00a3af'
,
'#4da798'
,
'#57baaa'
,
'#62d0bd'
,
'#6ee4d0'
,
'#86e7d6'
,
'#aeede1'
,
'#bde1e6'
,
'#e5e5e5'
]
}
}
],
],
colorForm
:
JSON
.
parse
(
JSON
.
stringify
(
DEFAULT_COLOR_CASE
))
colorForm
:
JSON
.
parse
(
JSON
.
stringify
(
DEFAULT_COLOR_CASE
)),
customColor
:
null
,
colorIndex
:
0
}
}
},
},
watch
:
{
watch
:
{
'chart'
:
{
'chart'
:
{
handler
:
function
()
{
handler
:
function
()
{
this
.
customColor
=
null
this
.
colorIndex
=
0
this
.
init
()
this
.
init
()
}
}
}
}
...
@@ -172,6 +208,8 @@ export default {
...
@@ -172,6 +208,8 @@ export default {
val
.
value
=
items
[
0
].
value
val
.
value
=
items
[
0
].
value
val
.
colors
=
items
[
0
].
colors
val
.
colors
=
items
[
0
].
colors
this
.
$emit
(
'onColorChange'
,
val
)
this
.
$emit
(
'onColorChange'
,
val
)
this
.
customColor
=
null
this
.
colorIndex
=
0
},
},
init
()
{
init
()
{
const
chart
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
chart
))
const
chart
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
chart
))
...
@@ -184,8 +222,26 @@ export default {
...
@@ -184,8 +222,26 @@ export default {
}
}
if
(
customAttr
.
color
)
{
if
(
customAttr
.
color
)
{
this
.
colorForm
=
customAttr
.
color
this
.
colorForm
=
customAttr
.
color
if
(
!
this
.
customColor
)
{
this
.
customColor
=
this
.
colorForm
.
colors
[
0
]
this
.
colorIndex
=
0
}
}
}
}
}
},
switchColor
(
index
)
{
this
.
colorIndex
=
index
},
switchColorCase
()
{
this
.
colorForm
.
colors
[
this
.
colorIndex
]
=
this
.
customColor
this
.
$emit
(
'onColorChange'
,
this
.
colorForm
)
},
resetCustomColor
()
{
this
.
customColor
=
this
.
colorForm
.
colors
[
0
]
this
.
colorIndex
=
0
this
.
changeColorCase
()
}
}
}
}
}
}
...
@@ -220,4 +276,22 @@ export default {
...
@@ -220,4 +276,22 @@ export default {
cursor
:
pointer
;
cursor
:
pointer
;
z-index
:
1003
;
z-index
:
1003
;
}
}
.color-label
{
display
:
inline-block
;
width
:
60px
;
}
.color-type
>>>
.el-radio__input
{
display
:
none
;
}
.el-radio
{
margin
:
0
4px
0
0
!important
;
}
.el-radio
>>>
.el-radio__label
{
padding-left
:
0
;
}
.el-radio.is-checked
{
border
:
1px
solid
#0a7be0
;
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论