From 1386e66c01b9f21110aacd9bea9c81165107e247 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Thu, 30 May 2024 16:48:09 +0800 Subject: [PATCH] * zin: fix the issues of thinkresult widget. --- lib/zin/wg/thinkresult/v1.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/zin/wg/thinkresult/v1.php b/lib/zin/wg/thinkresult/v1.php index bd6a5b3ef0..e198436d1b 100644 --- a/lib/zin/wg/thinkresult/v1.php +++ b/lib/zin/wg/thinkresult/v1.php @@ -6,28 +6,30 @@ class thinkResult extends wg { protected static array $defineProps = array( 'wizard: object', // 模型数据 - 'mode?: string="view"', // 模型展示模式 preview|view + 'mode?: string="view"', // 模型展示模式。 preview 后台设计预览 | view 前台结果展示 'blocks: array', // 模型节点 - 'blockCount: int' // 模型区块数量 ); protected function buildModel(): wg|node { list($wizard, $mode, $blocks) = $this->prop(array('wizard', 'mode', 'blocks')); - if($wizard->model == 'swot') return thinkSwot(set::wizard($wizard), set::mode($mode), set::blocks($blocks)); + if($wizard->model == 'swot') return thinkSwot(set::mode($mode), set::blocks($blocks)); return div('模型区域'); } protected function build(): wg|node { + global $app, $lang; + $app->loadLang('thinkwizard'); + $wizard = $this->prop('wizard'); return div ( setClass('think-result-content col items-center px-7 py-6'), - div(setClass('w-full h-10 text-center text-md py-2.5 ellipsis overflow-hidden whitespace-nowrap'), $wizard->introduction), + div(setClass('w-full h-10 text-center text-md py-2.5 ellipsis overflow-hidden whitespace-nowrap'), $wizard->introduction ? $wizard->introduction : $lang->thinkwizard->introduction), div(setClass('w-full my-4'), setStyle('min-height', '200px'), $this->buildModel()), - div(setClass('w-full text-center text-md py-2.5'), html(htmlspecialchars_decode($wizard->suggestion))) + div(setClass('w-full text-center text-md py-2.5'), html($wizard->suggestion ? htmlspecialchars_decode($wizard->suggestion) : $lang->thinkwizard->suggestion)) ); } }