dashboardFactory.js添加图表状态基本功能

This commit is contained in:
datagear 2020-02-28 00:04:58 +08:00
parent 7baacc652e
commit 8baebcdf7a
1 changed files with 99 additions and 0 deletions

View File

@ -65,6 +65,21 @@
dashboard.listener = listener;
};
/**图表状态等待render*/
dashboardFactory.CHART_STATUS_WAIT_RENDER = "WAIT_RENDER";
/**图表状态完成render*/
dashboardFactory.CHART_STATUS_FINISH_RENDER = "FINISH_RENDER";
/**图表状态等待update*/
dashboardFactory.CHART_STATUS_WAIT_UPDATE = "WAIT_UPDATE";
/**图表状态完成update*/
dashboardFactory.CHART_STATUS_FINISH_UPDATE = "FINISH_UPDATE";
/**图表状态:终止*/
dashboardFactory.CHART_STATUS_TERMINATE = "TERMINATE";
/**
* 渲染看板
*/
@ -298,6 +313,90 @@
return -1;
};
/**
* 图表状态是否为/设置为等待render
*
* @param chart 图表对象
* @param set 为undefined时执行读取操作否则执行设置操作
*/
dashboardBase.chartStatusWaitRender = function(chart, set)
{
if(set == undefined)
return (chart._CHART_STATUS == dashboardFactory.CHART_STATUS_WAIT_RENDER);
else
chart._CHART_STATUS = dashboardFactory.CHART_STATUS_WAIT_RENDER;
};
/**
* 图表状态是否为/设置为完成render
*
* @param chart 图表对象
* @param set 为undefined时执行读取操作否则执行设置操作
*/
dashboardBase.chartStatusFinishRender = function(chart, set)
{
if(set == undefined)
return (chart._CHART_STATUS == dashboardFactory.CHART_STATUS_FINISH_RENDER);
else
chart._CHART_STATUS = dashboardFactory.CHART_STATUS_FINISH_RENDER;
};
/**
* 图表状态是否为/设置为等待update
*
* @param chart 图表对象
* @param set 为undefined时执行读取操作否则执行设置操作
*/
dashboardBase.chartStatusWaitUpdate = function(chart, set)
{
if(set == undefined)
return (chart._CHART_STATUS == dashboardFactory.CHART_STATUS_WAIT_UPDATE);
else
chart._CHART_STATUS = dashboardFactory.CHART_STATUS_WAIT_UPDATE;
};
/**
* 图表状态是否为/设置为完成update
*
* @param chart 图表对象
* @param set 为undefined时执行读取操作否则执行设置操作
*/
dashboardBase.chartStatusFinishUpdate = function(chart, set)
{
if(set == undefined)
return (chart._CHART_STATUS == dashboardFactory.CHART_STATUS_FINISH_UPDATE);
else
chart._CHART_STATUS = dashboardFactory.CHART_STATUS_FINISH_UPDATE;
};
/**
* 图表状态是否为/设置为终止
*
* @param chart 图表对象
* @param set 为undefined时执行读取操作否则执行设置操作
*/
dashboardBase.chartStatusTerminate = function(chart, set)
{
if(set == undefined)
return (chart._CHART_STATUS == dashboardFactory.CHART_STATUS_TERMINATE);
else
chart._CHART_STATUS = dashboardFactory.CHART_STATUS_TERMINATE;
};
/**
* 获取/设置图表状态
*
* @param chart 图表对象
* @param status 要设置的状态可选不设置则执行获取操作
*/
dashboardBase.chartStatus = function(chart, status)
{
if(status == undefined)
return (chart._CHART_STATUS || dashboardFactory.CHART_STATUS_WAIT_RENDER);
else
chart._CHART_STATUS = (status || dashboardFactory.CHART_STATUS_WAIT_RENDER);
};
/**
* 获取当前需要更新的图表数组没有则返回空数组
*/