Revert "* Add fetch api for screen preview chart data."
This reverts commit df96e69034.
This commit is contained in:
@@ -84,7 +84,7 @@ class screen extends control
|
||||
return;
|
||||
}
|
||||
|
||||
$screen = $this->screen->getByID($screenID, $year, $month, $dept, $account, false);
|
||||
$screen = $this->screen->getByID($screenID, $year, $month, $dept, $account);
|
||||
|
||||
$this->view->title = $screen->name;
|
||||
$this->view->screen = $screen;
|
||||
@@ -106,12 +106,6 @@ class screen extends control
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxGetScreenScheme($screenID, $year = 0, $month = 0, $dept = 0, $account = '')
|
||||
{
|
||||
$screen = $this->screen->getByID($screenID, $year, $month, $dept, $account);
|
||||
echo(json_encode($screen));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get chart.
|
||||
*
|
||||
|
||||
@@ -26,7 +26,7 @@ self["MonacoEnvironment"] = (function(paths) {
|
||||
});
|
||||
|
||||
location.hash = '#/chart/preview/' + screen.id;
|
||||
window.chartData = screen.chartData;
|
||||
window.location.replace(window.location.href.toString().replace(window.location.hash, '')+'#/chart/preview/' + screen.id)
|
||||
window.fetchChartApi = createLink('screen', 'ajaxGetChart');
|
||||
window.fetchMetricDataApi = createLink('screen', 'ajaxGetMetricData');
|
||||
window.fetchScreenSchemeApi = createLink('screen', 'ajaxGetScreenScheme', 'screenID=' + screen.id + '&year=' + year + '&month=' + month + '&dept=' + dept + '&account=' + account);
|
||||
|
||||
@@ -68,11 +68,11 @@ class screenModel extends model
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByID($screenID, $year = '', $month = '', $dept = '', $account = '', $withChartData = true)
|
||||
public function getByID($screenID, $year = '', $month = '', $dept = '', $account = '')
|
||||
{
|
||||
$screen = $this->dao->select('*')->from(TABLE_SCREEN)->where('id')->eq($screenID)->fetch();
|
||||
if(!isset($screen->scheme) or empty($screen->scheme)) $screen->scheme = file_get_contents(__DIR__ . '/json/screen.json');
|
||||
if($withChartData) $screen->chartData = $this->genChartData($screen, $year, $month, $dept, $account);
|
||||
$screen->chartData = $this->genChartData($screen, $year, $month, $dept, $account);
|
||||
|
||||
return $screen;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<script type="module" crossorigin src="<?php echo $webRoot;?>static/js/index.js"></script>
|
||||
<?php js::set('screen', $screen);?>
|
||||
<?php js::set('year', $year);?>
|
||||
<?php js::set('month', $month);?>
|
||||
<?php js::set('dept', $dept);?>
|
||||
<?php js::set('account', $account);?>
|
||||
<div id="appProvider" style="display: none;"></div>
|
||||
|
||||
Reference in New Issue
Block a user