Merge remote-tracking branch 'origin/master'

main
liu.shiyi 2 years ago
commit c798584e2a

@ -23,6 +23,39 @@ public class ScreenTimePickerChart extends Chart {
@Data @Data
public static class Customize { public static class Customize {
@ApiModelProperty(notes = "值")
private String value;
@ApiModelProperty(notes = "选择框背景颜色")
private String backgroundColor;
@ApiModelProperty(notes = "选择框文字颜色")
private String fontColor;
@ApiModelProperty(notes = "选择框文字大小")
private Integer fontSize;
@ApiModelProperty(notes = "下拉框背景颜色")
private String dropDownBackgroundColor;
@ApiModelProperty(notes = "下拉框字体颜色")
private String dropDownFontColor;
@ApiModelProperty(notes = "下拉项hover背景颜色")
private String dropDownHoverBackgroundColor;
@ApiModelProperty(notes = "下拉项hover字体颜色")
private String dropDownHoverFontColor;
@ApiModelProperty(notes = "下拉项激活文字颜色")
private String dropDownSelectedFontColor;
@ApiModelProperty(notes = "时间格式化类型:Date 对象default时间戳timestamp自定义custom")
private String formatType;
@ApiModelProperty(notes = "绑定值的格式")
private String valueFormat;
} }

@ -34,7 +34,6 @@ export default {
endColor: '', // endColor: '', //
position: '', // position: '', //
colorsValue: ''// g2 colorsValue: ''// g2
} }
}, },
computed: { computed: {

@ -38,23 +38,68 @@ const setting = [
groupName: 'graph' groupName: 'graph'
}, },
{ {
label: '数据标签', label: '柱子顶部颜色',
type: 'switch', // 设置组件类型 type: 'colorPicker', // 设置组件类型
field: 'label_style_opacity', // 字段 field: 'seriesCustom_barTopColor', // 字段
// optionField: 'series', // 对应options中的字段 optionField: 'seriesCustom.barTopColor', // 对应options中的字段
value: 0, value: '#2DB1EF',
active: 1, tabName: 'custom',
inactive: 0, groupName: 'graph'
},
{
label: '柱子颜色',
type: 'colorPicker', // 设置组件类型
field: 'seriesCustom_barColor', // 字段
optionField: 'seriesCustom.barColor', // 对应options中的字段
value: '#115ba6',
tabName: 'custom',
groupName: 'graph'
},
{
label: '柱子底部颜色',
type: 'colorPicker', // 设置组件类型
field: 'seriesCustom_barBottomColor', // 字段
optionField: 'seriesCustom.barBottomColor', // 对应options中的字段
value: '#187dcb',
tabName: 'custom',
groupName: 'graph'
},
{
label: '柱子背景顶部颜色',
type: 'colorPicker', // 设置组件类型
field: 'seriesCustom_shadowTopColor', // 字段
optionField: 'seriesCustom.shadowTopColor', // 对应options中的字段
value: '#142f5a',
tabName: 'custom', tabName: 'custom',
groupName: 'graph' groupName: 'graph'
}, },
{
label: '阴影柱子颜色',
type: 'colorPicker', // 设置组件类型
field: 'seriesCustom_shadowColor', // 字段
optionField: 'seriesCustom.shadowColor', // 对应options中的字段
value: '#041133',
tabName: 'custom',
groupName: 'graph'
},
// {
// label: '数据标签',
// type: 'switch', // 设置组件类型
// field: 'label_style_opacity', // 字段
// // optionField: 'series', // 对应options中的字段
// value: 0,
// active: 1,
// inactive: 0,
// tabName: 'custom',
// groupName: 'graph'
// },
// x轴 xAxis // x轴 xAxis
{ {
label: '显示', label: '显示',
type: 'switch', type: 'switch',
field: 'xAxis_show', field: 'xAxis_show',
optionField: 'xAxis.show', optionField: 'xAxis.show',
value: 1, value: 0,
active: 1, active: 1,
inactive: 0, inactive: 0,
tabName: 'custom', tabName: 'custom',
@ -65,20 +110,20 @@ const setting = [
type: 'switch', type: 'switch',
field: 'xAxis_axisLine_show', field: 'xAxis_axisLine_show',
optionField: 'xAxis.axisLine.show', optionField: 'xAxis.axisLine.show',
value: 1, value: 0,
active: 1, active: 1,
inactive: 0, inactive: 0,
tabName: 'custom', tabName: 'custom',
groupName: 'xAxis' groupName: 'xAxis'
}, },
{ {
label: '刻度显示', label: '轴线颜色',
type: 'switch', type: 'colorPicker',
field: 'xAxis_axisTick_show', field: 'xAxis_axisLine_lineStyle_color',
optionField: 'xAxis.axisTick.show', optionField: 'xAxis.axisLine.lineStyle.color',
value: 0, // 是否多选
active: 1, multiple: false,
inactive: 0, value: '#333',
tabName: 'custom', tabName: 'custom',
groupName: 'xAxis' groupName: 'xAxis'
}, },
@ -87,7 +132,7 @@ const setting = [
type: 'switch', type: 'switch',
field: 'xAxis_axisLabel_show', field: 'xAxis_axisLabel_show',
optionField: 'xAxis.axisLabel.show', optionField: 'xAxis.axisLabel.show',
value: 0, value: 1,
active: 1, active: 1,
inactive: 0, inactive: 0,
tabName: 'custom', tabName: 'custom',
@ -104,6 +149,24 @@ const setting = [
tabName: 'custom', tabName: 'custom',
groupName: 'xAxis' groupName: 'xAxis'
}, },
{
label: '标签大小',
type: 'inputNumber',
field: 'xAxis_axisLabel_textStyle_fontSize',
optionField: 'xAxis.axisLabel.textStyle.fontSize',
value: 14,
tabName: 'custom',
groupName: 'xAxis'
},
{
label: '标签距离',
type: 'inputNumber',
field: 'xAxis_axisLabel_margin',
optionField: 'xAxis.axisLabel.margin',
value: 30,
tabName: 'custom',
groupName: 'xAxis'
},
{ {
label: '标题', label: '标题',
type: 'input', type: 'input',
@ -168,7 +231,69 @@ const setting = [
groupName: 'yAxis' groupName: 'yAxis'
}, },
{ {
label: '名称', label: '轴线显示',
type: 'switch',
field: 'yAxis_axisLine_show',
optionField: 'yAxis.axisLine.show',
value: 1,
active: 1,
inactive: 0,
tabName: 'custom',
groupName: 'yAxis'
},
{
label: '轴线颜色',
type: 'colorPicker',
field: 'yAxis_axisLine_lineStyle_color',
optionField: 'yAxis.axisLine.lineStyle.color',
// 是否多选
multiple: false,
value: '#333',
tabName: 'custom',
groupName: 'yAxis'
},
{
label: '标签显示',
type: 'switch',
field: 'yAxis_axisLabel_show',
optionField: 'yAxis.axisLabel.show',
value: 1,
active: 1,
inactive: 0,
tabName: 'custom',
groupName: 'yAxis'
},
{
label: '标签颜色',
type: 'colorPicker',
field: 'yAxis_axisLabel_textStyle_color',
optionField: 'yAxis.axisLabel.textStyle.color',
// 是否多选
multiple: false,
value: '#8C8C8C',
tabName: 'custom',
groupName: 'yAxis'
},
{
label: '标签大小',
type: 'inputNumber',
field: 'yAxis_axisLabel_textStyle_fontSize',
optionField: 'yAxis.axisLabel.textStyle.fontSize',
value: 14,
tabName: 'custom',
groupName: 'yAxis'
},
{
label: '标签距离',
type: 'inputNumber',
field: 'yAxis_axisLabel_margin',
optionField: 'yAxis.axisLabel.margin',
value: 10,
tabName: 'custom',
groupName: 'yAxis'
},
{
label: '标题',
type: 'input', type: 'input',
field: 'yAxis_name', field: 'yAxis_name',
optionField: 'yAxis.name', optionField: 'yAxis.name',
@ -177,7 +302,7 @@ const setting = [
groupName: 'yAxis' groupName: 'yAxis'
}, },
{ {
label: '名称颜色', label: '标题颜色',
type: 'colorPicker', type: 'colorPicker',
field: 'yAxis_nameTextStyle_color', field: 'yAxis_nameTextStyle_color',
optionField: 'yAxis.nameTextStyle.color', optionField: 'yAxis.nameTextStyle.color',
@ -188,7 +313,7 @@ const setting = [
groupName: 'yAxis' groupName: 'yAxis'
}, },
{ {
label: '名称大小', label: '标题大小',
type: 'inputNumber', type: 'inputNumber',
field: 'yAxis_nameTextStyle_fontSize', field: 'yAxis_nameTextStyle_fontSize',
optionField: 'yAxis.nameTextStyle.fontSize', optionField: 'yAxis.nameTextStyle.fontSize',
@ -197,7 +322,7 @@ const setting = [
groupName: 'yAxis' groupName: 'yAxis'
}, },
{ {
label: '名称位置', label: '标题位置',
type: 'select', type: 'select',
field: 'yAxis_nameLocation', field: 'yAxis_nameLocation',
optionField: 'yAxis.nameLocation', optionField: 'yAxis.nameLocation',
@ -217,17 +342,6 @@ const setting = [
value: 'end' value: 'end'
}], }],
groupName: 'yAxis' groupName: 'yAxis'
},
{
label: '刻度颜色',
type: 'colorPicker',
field: 'yAxis_axisLabel_textStyle',
optionField: 'yAxis.axisLabel.textStyle.color',
// 是否多选
multiple: false,
value: '#d0d0d0',
tabName: 'custom',
groupName: 'yAxis'
} }
] ]
@ -256,7 +370,7 @@ const option = {
}, },
graphic: { graphic: {
type: 'group', type: 'group',
bottom: '8%', bottom: '5%',
left: '10%', left: '10%',
z: 100, z: 100,
children: [ children: [
@ -265,7 +379,7 @@ const option = {
left: 0, left: 0,
bottom: 0, bottom: 0,
shape: { shape: {
width: 400, width: 418 * 0.9,
height: 10 height: 10
}, },
style: { style: {
@ -278,7 +392,7 @@ const option = {
bottom: 10, bottom: 10,
shape: { shape: {
// 左上、右上、右下、左下 // 左上、右上、右下、左下
points: [[40, -50], [360, -50], [400, 0], [0, 0]] points: [[418 / 10, -320 / 6], [418 - 418 / 6, -320 / 6], [418 * 0.9, 0], [0, 0]]
}, },
style: { style: {
fill: '#303256' fill: '#303256'
@ -297,14 +411,17 @@ const option = {
fontSize: 12 fontSize: 12
}, },
nameLocation: '', nameLocation: '',
// 坐标轴刻度设置:x轴数据展示 // 坐标轴刻度设置
axisTick: { axisTick: {
show: false, show: false,
alignWithLabel: true alignWithLabel: true
}, },
// 是否显示坐标轴的轴线 // 是否显示坐标轴的轴线
axisLine: { axisLine: {
show: false show: false,
lineStyle: {
color: '#333'
}
}, },
// 坐标轴刻度标签 // 坐标轴刻度标签
axisLabel: { axisLabel: {
@ -344,12 +461,15 @@ const option = {
fontSize: 12 fontSize: 12
}, },
nameLocation: 'end', nameLocation: 'end',
show: true, // y轴文本标签显示 show: true,
type: 'value', type: 'value',
axisLabel: { axisLabel: {
show: true,
textStyle: { textStyle: {
color: 'rgb(40, 129, 170)' color: '#333',
} fontSize: 12
},
margin: 10
}, },
// 分隔线 // 分隔线
splitLine: { splitLine: {
@ -357,16 +477,24 @@ const option = {
}, },
// y轴轴线是否显示 // y轴轴线是否显示
axisLine: { axisLine: {
show: true show: true,
lineStyle: {
color: '#333'
}
} }
}, },
seriesCustom: { seriesCustom: {
barWidth: 30, barWidth: 30,
// 顶部菱形颜色
barTopColor: '#2DB1EF', barTopColor: '#2DB1EF',
// 底部菱形颜色
barBottomColor: '#187dcb', barBottomColor: '#187dcb',
barColor1: '#115ba6', // 柱子颜色
barColor2: '#1db0dd', barColor: '#1db0dd',
// 阴影柱子颜色
shadowColor: '#041133', shadowColor: '#041133',
// 阴影柱子顶部颜色
shadowTopColor: '#142f5a' shadowTopColor: '#142f5a'
}, },
series: [ series: [
@ -416,23 +544,24 @@ const option = {
type: 'bar', type: 'bar',
barWidth: 30, barWidth: 30,
z: 10, z: 10,
itemStyle: { color: '#115ba6',
normal: { // itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ // normal: {
{ // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
offset: 0, // {
color: '#115ba6' // offset: 0,
}, // color: '#115ba6'
{ // },
offset: 1, // {
color: '#1db0dd' // offset: 1,
} // color: '#1db0dd'
]), // }
opacity: 0.8, // ]),
shadowColor: 'rgba(0, 0, 0, 0.5)', // 阴影颜色 // opacity: 0.8,
shadowBlur: 0 // 阴影模糊值 // shadowColor: 'rgba(0, 0, 0, 0.5)', // 阴影颜色
} // shadowBlur: 0 // 阴影模糊值
}, // }
// },
data: yData data: yData
}, },
// 阴影柱子 // 阴影柱子

@ -213,6 +213,7 @@ export default {
return config return config
}, },
dataFormatting (config, data) { dataFormatting (config, data) {
console.log('dataFormatting')
// //
if (data.success) { if (data.success) {
data = data.data data = data.data
@ -256,6 +257,7 @@ export default {
}, },
// echarts // echarts
echartsOptionFormatting (config, data) { echartsOptionFormatting (config, data) {
console.log('echartsOptionFormatting');
const option = config.option const option = config.option
// //
const xField = config.setting.find(item => item.optionField === 'xField')?.value const xField = config.setting.find(item => item.optionField === 'xField')?.value
@ -501,9 +503,25 @@ export default {
// series // series
seriesStyle (config) { seriesStyle (config) {
const _config = CloneDeep(config) const _config = CloneDeep(config)
// const seriesCustom = _config.option.seriesCustom
// const ids = Object.keys(config.option.seriesCustom) const ids = Object.keys(config.option.seriesCustom)
const ids = ['barTopColor', 'barBottomColor', 'shadowColor', 'shadowTopColor'] // const ids = ['barTopColor', 'barBottomColor', 'shadowColor', 'shadowTopColor']
const hasSeries = _config.setting.find(item => item.optionField === 'seriesField' && item.value !== '')
//
if (!hasSeries) {
_config.option.series.forEach(item => {
//
if (ids.includes(item.id)) {
item.color = seriesCustom[item.id]
}
//
if (item.type === 'pictorialBar') {
item.symbolSize = [seriesCustom.barWidth, seriesCustom.barWidth / 2]
} else if (item.type === 'bar') {
item.barWidth = seriesCustom.barWidth
}
})
}
_config.option.series.forEach((item) => { _config.option.series.forEach((item) => {
if (ids.includes(item.id)) { if (ids.includes(item.id)) {
item.color = _config.option.seriesCustom[item.id] item.color = _config.option.seriesCustom[item.id]
@ -524,6 +542,7 @@ export default {
}, },
// config // config
changeStyle (config, isUpdateTheme) { changeStyle (config, isUpdateTheme) {
console.log('changeStyle');
config = { ...this.config, ...config } config = { ...this.config, ...config }
config = this.transformSettingToOption(config, 'custom') config = this.transformSettingToOption(config, 'custom')
// optionsettingeval,optionHandlerdataHandler // optionsettingeval,optionHandlerdataHandler
@ -537,6 +556,7 @@ export default {
console.error(e) console.error(e)
} }
} }
// settingoption.seriesCustomseries
config = this.seriesStyle(config) config = this.seriesStyle(config)
// //
if (!isUpdateTheme) { if (!isUpdateTheme) {

Loading…
Cancel
Save