From fd655e25ef7e0ea60eb87cce29c439433c8d9a97 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Fri, 25 Oct 2024 17:13:39 +0800 Subject: [PATCH] * [task#131071] show question card for the thinkansoff widget. --- lib/zin/wg/thinkansoff/v1.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/zin/wg/thinkansoff/v1.php b/lib/zin/wg/thinkansoff/v1.php index e0f7ecb1b2..349c749e03 100644 --- a/lib/zin/wg/thinkansoff/v1.php +++ b/lib/zin/wg/thinkansoff/v1.php @@ -6,6 +6,17 @@ requireWg('thinkModel'); class thinkAnsoff extends thinkModel { + protected function buildAreaCard(int $order): array + { + $blocks = $this->prop('blocks'); + $area = array(); + foreach($blocks as $block) + { + if($order == $block->id && !empty($block->steps)) $area[] = $this->buildResultCard($block->steps, $block->id + 1); + } + return $area; + } + protected function buildItem(int $order, string|object $block): node { global $app, $lang, $config; @@ -21,7 +32,7 @@ class thinkAnsoff extends thinkModel ( setClass('relative col justify-between py-2 px-2.5 bg-canvas model-block', "bg-$blockColor-100", "block-$order"), setStyle($blockStyle), - div(setClass('h-full flex flex-wrap gap-2.5')), + div(setClass('h-full flex flex-wrap gap-2.5'), $mode == 'view' ? $this->buildAreaCard($order) : null), div(setClass('item-step-title text-center', "text-$blockColor"), $blockName) ); } @@ -41,7 +52,7 @@ class thinkAnsoff extends thinkModel setClass('w-full flex items-stretch gap-4'), div ( - setClass('flex items-center justify-center text-gray-400 font-medium item-step-title'), + setClass('flex items-center justify-center text-gray-400 font-medium item-step-title item-vertical-title'), setStyle(array('writing-mode' => 'vertical-rl')), $lang->thinkwizard->ansoff->titles[$titleKey] ),