refactor: 代码合并

main
wu.jian2 1 year ago
commit cad2cbffaf

@ -80,6 +80,15 @@ public class ScreenIndexCardChart extends Chart {
@ApiModelProperty(notes = "单位字体颜色") @ApiModelProperty(notes = "单位字体颜色")
private String unitColor; private String unitColor;
@ApiModelProperty(notes = "渐变方向")
private String gradientDirection;
@ApiModelProperty(notes = "渐变颜色0")
private String gradientColor0;
@ApiModelProperty(notes = "渐变颜色1")
private String gradientColor1;
} }
} }

@ -71,7 +71,14 @@ public class ScreenIndicatorCardChart extends Chart {
@ApiModelProperty(notes = "单位字体颜色") @ApiModelProperty(notes = "单位字体颜色")
private String unitColor; private String unitColor;
@ApiModelProperty(notes = "渐变方向")
private String gradientDirection;
@ApiModelProperty(notes = "渐变颜色0")
private String gradientColor0;
@ApiModelProperty(notes = "渐变颜色1")
private String gradientColor1;
} }
} }

@ -40,13 +40,16 @@ export default {
// //
getDataByExpression (config) { getDataByExpression (config) {
// //
if (this.config.expressionCodes && this.config.expressionCodes.length) { const len = this.config.expressionCodes ? this.config.expressionCodes.length : 0
// eslint-disable-next-line no-new-func const len1 = this.currentComputedDatas ? Object.keys(this.currentComputedDatas).length : 0
const len2 = this.currentDataset ? Object.keys(this.currentDataset).length : 0
if (len && len === len1 + len2) {
// eslint-disable-next-line no-new-func
const result = new Function('dataset', 'computedDatas', this.config.expression) const result = new Function('dataset', 'computedDatas', this.config.expression)
config.customize.title = result(this.dataset, this.computedDatas) config.customize.title = result(this.dataset, this.computedDatas)
// //
this.updateComputedDatas({ code: config.code, name: config.name, data: config.customize.title }) this.updateComputedDatas({ code: config.code, name: config.name, data: config.customize.title })
// this.changeChartConfig(config) // this.changeChartConfig(config)
} }
}, },
dataFormatting (config, data) { dataFormatting (config, data) {

@ -40,7 +40,10 @@ export default {
// //
getDataByExpression (config) { getDataByExpression (config) {
// //
if (this.config.expressionCodes && this.config.expressionCodes.length) { const len = this.config.expressionCodes ? this.config.expressionCodes.length : 0
const len1 = this.currentComputedDatas ? Object.keys(this.currentComputedDatas).length : 0
const len2 = this.currentDataset ? Object.keys(this.currentDataset).length : 0
if (len && len === len1 + len2) {
// eslint-disable-next-line no-new-func // eslint-disable-next-line no-new-func
const result = new Function('dataset', 'computedDatas', this.config.expression) const result = new Function('dataset', 'computedDatas', this.config.expression)
config.customize.title = result(this.dataset, this.computedDatas) config.customize.title = result(this.dataset, this.computedDatas)
@ -53,7 +56,7 @@ export default {
// //
if (config.dataSource.businessKey) { if (config.dataSource.businessKey) {
config.customize.title = data && data.data && data.data.length ? data.data[0][config.dataSource.metricField] : '暂无数据' config.customize.title = data && data.data && data.data.length ? data.data[0][config.dataSource.metricField] : '暂无数据'
config.option.data = data && data.data && data.data.length ? data.data :[] config.option.data = data && data.data && data.data.length ? data.data : []
} }
return config return config
} }

@ -300,6 +300,7 @@ data.forEach(item => {
<el-table-column <el-table-column
prop="width" prop="width"
label="列宽" label="列宽"
width='90'
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">

@ -38,6 +38,7 @@
:style="{ :style="{
zIndex: chart.z || 0, zIndex: chart.z || 0,
}" }"
:transform="''"
:grid="[1,1]" :grid="[1,1]"
:handles="handlesList" :handles="handlesList"
class-name-handle="bs-handle-class" class-name-handle="bs-handle-class"
@ -84,8 +85,8 @@ import RenderCard from './RenderCard.vue'
import Configuration from './Configuration.vue' import Configuration from './Configuration.vue'
// import _ from 'lodash' // import _ from 'lodash'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import vdr from 'gc-vue-draggable-resizable' // import vdr from 'gc-vue-draggable-resizable'
// import vdr from '@gcpaas/vue-draggable-resizable-gorkys' import vdr from '@gcpaas/vue-draggable-resizable-gorkys'
import 'gc-vue-draggable-resizable/dist/VueDraggableResizable.css' import 'gc-vue-draggable-resizable/dist/VueDraggableResizable.css'
import { randomString } from '../js/utils' import { randomString } from '../js/utils'
import { compile } from 'tiny-sass-compiler/dist/tiny-sass-compiler.esm-browser.prod.js' import { compile } from 'tiny-sass-compiler/dist/tiny-sass-compiler.esm-browser.prod.js'

Loading…
Cancel
Save