|
|
@@ -40,13 +40,24 @@ function titleConfig(title) {
|
|
|
function formConfig(model) {
|
|
|
let { type, header, config, layout } = model;
|
|
|
let { fontSize, fieldstyle, valuestyle, columns, data} = config;
|
|
|
+ data = data.map((d) => {
|
|
|
+ d.field = {
|
|
|
+ text: d.field.text,
|
|
|
+ style: parseStyleStr(d.field.style)
|
|
|
+ };
|
|
|
+ d.value = {
|
|
|
+ text: d.value.text,
|
|
|
+ style: parseStyleStr(d.value.style)
|
|
|
+ };
|
|
|
+ return d;
|
|
|
+ });
|
|
|
let c = {
|
|
|
type: 'form',
|
|
|
config: {
|
|
|
fontSize: fontSize || getFontSize(),
|
|
|
header: Renders[header] || header,
|
|
|
- fieldStyle: parseStr(fieldstyle),
|
|
|
- valueStyle: parseStr(valuestyle),
|
|
|
+ fieldStyle: parseStyleStr(fieldstyle),
|
|
|
+ valueStyle: parseStyleStr(valuestyle),
|
|
|
columns,
|
|
|
data
|
|
|
},
|
|
|
@@ -57,12 +68,13 @@ function formConfig(model) {
|
|
|
|
|
|
function tableConfig(model) {
|
|
|
let { type, config, layout } = model;
|
|
|
- let { fontSize, title, cls, render, columns, data, rowHeight} = config;
|
|
|
+ let { fontSize, title, cls, render, columns, data, rowHeight, interval} = config;
|
|
|
return {
|
|
|
type: 'table',
|
|
|
config: {
|
|
|
fontSize: fontSize || getFontSize(),
|
|
|
rowHeight: rowHeight,
|
|
|
+ refreshInterval: interval,
|
|
|
title: Renders[title] || title,
|
|
|
render: Renders[render],
|
|
|
columns: columns.map((v, i) => {
|
|
|
@@ -95,11 +107,12 @@ function barConfig(model) {
|
|
|
}
|
|
|
},
|
|
|
grid: {
|
|
|
- top: layout.h < 60 ? '30%' : '25%',
|
|
|
- bottom: '15%'
|
|
|
+ top: layout.h * getScreenSize().height / 100 < 310 ? '35%' : '28%',
|
|
|
+ bottom: layout.h * getScreenSize().height / 100 < 310 ? '20%' : '15%',
|
|
|
},
|
|
|
legend: {
|
|
|
- top: '15%',
|
|
|
+ top: layout.h * getScreenSize().height / 100 < 310 ? '20%' : '18%',
|
|
|
+ right: '5%',
|
|
|
padding: 0,
|
|
|
orient: 'horizontal',
|
|
|
itemGap: layout.w,
|
|
|
@@ -114,7 +127,7 @@ function barConfig(model) {
|
|
|
type: xtype,
|
|
|
data: xf,
|
|
|
name: xtitle,
|
|
|
- nameGap: 0,
|
|
|
+ nameGap: 5,
|
|
|
nameRotate: 270,
|
|
|
nameTextStyle: {
|
|
|
fontSize: getFontSize() * .7
|
|
|
@@ -160,11 +173,12 @@ function lineConfig(model) {
|
|
|
trigger: 'axis'
|
|
|
},
|
|
|
grid: {
|
|
|
- top: layout.h < 60 ? '30%' : '25%',
|
|
|
- bottom: '15%'
|
|
|
+ top: layout.h * getScreenSize().height / 100 < 310 ? '35%' : '28%',
|
|
|
+ bottom: layout.h * getScreenSize().height / 100 < 310 ? '20%' : '15%',
|
|
|
},
|
|
|
legend: {
|
|
|
- top: '15%',
|
|
|
+ top: layout.h * getScreenSize().height / 100 < 310 ? '20%' : '18%',
|
|
|
+ right: '5%',
|
|
|
padding: 0,
|
|
|
orient: 'horizontal',
|
|
|
itemGap: layout.w,
|
|
|
@@ -180,7 +194,7 @@ function lineConfig(model) {
|
|
|
data : xf,
|
|
|
name: xtitle,
|
|
|
nameRotate: 270,
|
|
|
- nameGap: 0,
|
|
|
+ nameGap: 5,
|
|
|
nameTextStyle: {
|
|
|
fontSize: fontSize || getFontSize() * .7
|
|
|
},
|
|
|
@@ -240,7 +254,7 @@ function getChartsTitle(fontSize, layout, title, subtitle) {
|
|
|
var title = {
|
|
|
show: true,
|
|
|
text: title,
|
|
|
- subtext: subtitle,
|
|
|
+ subtext: layout.h * getScreenSize().height / 100 < 300 ? '' : subtitle,
|
|
|
textAlign: 'center',
|
|
|
textStyle: {
|
|
|
verticalAlign: 'top',
|
|
|
@@ -291,7 +305,10 @@ function getLineSeries(fontSize, series) {
|
|
|
normal: {
|
|
|
show: true,
|
|
|
position: 'inside',
|
|
|
- formatter: '{c}'
|
|
|
+ formatter: '{c}',
|
|
|
+ textStyle: {
|
|
|
+ fontSize: fontSize || getFontSize() * .7
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -351,7 +368,10 @@ function getLayout(layout) {
|
|
|
return l;
|
|
|
}
|
|
|
|
|
|
-function parseStr(str) {
|
|
|
+function parseStyleStr(str) {
|
|
|
+ if(!str) {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
if(typeof str == 'object') {
|
|
|
return str;
|
|
|
}
|