diff --git a/module/screen/model.php b/module/screen/model.php index a52b95e27c..924bfd722b 100755 --- a/module/screen/model.php +++ b/module/screen/model.php @@ -1548,7 +1548,7 @@ class screenModel extends model */ public function getBurnData(): array { - $type = 'withdelay'; + $type = 'withdelay'; /* 获取所有正在进行的执行和阶段。 */ /* Get all sprint and stage which are doing. */ $executions = $this->loadModel('execution')->getList(0, 'sprint', 'doing') + $this->execution->getList(0, 'stage', 'doing'); diff --git a/module/screen/test/model/buildcomponent.php b/module/screen/test/model/buildcomponent.php index 37cbba9acd..5f6e01f589 100644 --- a/module/screen/test/model/buildcomponent.php +++ b/module/screen/test/model/buildcomponent.php @@ -48,7 +48,7 @@ if($component1) $screen->buildComponentTest($component1); r(isset($component1->option->dataset->dimensions) && is_array($component1->option->dataset->dimensions)) && p('') && e('1'); //有图表id的元素判断是否正常生成了刻度和数据。 if($component2) $screen->buildComponentTest($component2); -r(isset($component2) && is_object($component2)) && p('') && e('0'); //目前没有Select组件,所以这里应该是false。 +r(isset($component2) && $component2->option->dataset[0]['label'] == '2023') && p('') && e('0'); //判断是否正常生成了Select组件。 if($component3) $screen->buildComponentTest($component3); r($component3->styles && $component->status && $component->request) && p('') && e('1'); //非列表的组件判断是否给予了默认的属性。 diff --git a/module/screen/test/model/getbyid.php b/module/screen/test/model/getbyid.php index 7e6bdbef79..f8e9af1441 100644 --- a/module/screen/test/model/getbyid.php +++ b/module/screen/test/model/getbyid.php @@ -21,7 +21,6 @@ pid=1 $screen = new screenTest(); - $screenIDList = array(0, 1, 2, 3, 4, 5, 6, 7, 8); $yearList = array(0, 2019); $deptList = array(0, 1, 2); @@ -29,6 +28,7 @@ $accountList = array('', 'admin', 'user'); r($screen->getByIDTest($screenIDList[0], $yearList[0], $deptList[0], $accountList[0])) && p('') && e(0); //测试不存在的screenID r($screen->getByIDTest($screenIDList[1], $yearList[0], $deptList[0], $accountList[0])) && p('id') && e(1); //测试存在的screenID + $res = $screen->getByIDTest($screenIDList[2], $yearList[1], $deptList[0], $accountList[0]); $chart = null; foreach($res->chartData->componentList as $item){ @@ -74,9 +74,9 @@ r($chart1 && $chart1->option->value == 'admin' && strpos($chart1->option->onChan r($maxHeight + 50 == $res->chartData->editCanvasConfig->height) && p('') && e(1); //测试生成的图表高度是否正确 r($res->chartData->requestGlobalConfig->requestInterval == 30) && p('') && e(1); //测试生成的图表请求间隔是否正确 -$res = $screen->getByIDTest($screenIDList[6], $yearList[0], $deptList[0], $accountList[0]); +$result = $screen->getByIDTest($screenIDList[6], $yearList[0], $deptList[0], $accountList[0]); $chart2 = null; -foreach($res->chartData->componentList as $component) +foreach($result->chartData->componentList as $component) { if(isset($component->chartConfig->package) && $component->chartConfig->package == 'Tables') { diff --git a/module/screen/test/model/getlatestchart.php b/module/screen/test/model/getlatestchart.php new file mode 100644 index 0000000000..6cc818375e --- /dev/null +++ b/module/screen/test/model/getlatestchart.php @@ -0,0 +1,49 @@ +#!/usr/bin/env php +buildChart(); +cid=1 +pid=1 + +当component->key为Select时,不会修改component >> 1 +当component的sourceID不存在时,不会修改component >> 1 +当component的sourceID存在时,会修改component >> 1 + +*/ + +$screen = new screenTest(); + +$components = $screen->getAllComponent(array('key' => 'Select')); + +$component1 = current($components); +$component1_ = clone($component1); +$screen->getLatestChartTest($component1); +r($component1 == $component1_) && p('') && e(1); //当component->key为Select时,不会修改component + +foreach($components as $component) +{ + $chartID = zget($component->chartConfig, 'sourceID', ''); + + if(!$chartID) + { + $component2 = $component; + break; + } +} +$component2_ = clone($component2); +$screen->getLatestChartTest($component2); +r($component2 && $component2 == $component2_) && p('') && e(1); //当component的sourceID不存在时,不会修改component + +foreach($screen->componentList as $component) +{ + if(isset($component->key) && $component->key === 'Select') continue; + $chartID = zget($component->chartConfig, 'sourceID', ''); + if(!$chartID) continue; + $component3 = $component; +} +$component3_ = clone($component3); +$screen->getLatestChartTest($component3); +r($component3 == $component3_) && p('') && e(1); //当component的sourceID存在时,有可!能会修改component diff --git a/module/screen/test/screen.class.php b/module/screen/test/screen.class.php index 27ff222aac..6274a04e7d 100644 --- a/module/screen/test/screen.class.php +++ b/module/screen/test/screen.class.php @@ -282,4 +282,17 @@ class screenTest } } } + + /** + * 测试getLatestChart。 + * Test getLatestChart. + * + * @param object $component + * @access public + * @return void + */ + public function getLatestChartTest(object $component): void + { + $this->objectModel->getLatestChart($component); + } }