id ?? '0'))), span( setClass('text'), $stepLang ))); }, array_keys($stepNav), array_values($stepNav)) ); } /* 步骤导航逻辑 */ $step = preg_replace('/^prompt/', '', $app->methodName ?? 'assignrole'); $stepSequence = array('assignrole', 'selectdatasource', 'setpurpose', 'settargetform', 'finalize'); $currentStepIndex = array_search($step, $stepSequence); $lastActiveStepIndex = array_search($lastActiveStep ?? 'assignrole', $stepSequence); $stepStatus = array(); foreach ($stepSequence as $index => $stepName) { if ($index < $currentStepIndex) { $stepStatus[$stepName] = 'active'; } elseif ($index > $currentStepIndex && $index <= $lastActiveStepIndex + 1) { $stepStatus[$stepName] = 'clickable'; } else { $stepStatus[$stepName] = 'disabled'; } if ($index == $currentStepIndex) { $stepStatus[$stepName] = 'current'; } } /** * Prompt Design 页面共享头部 */ div(setClass('prompt-header'), btn(setClass('btn-back'), set::type('ghost'), set::url(createLink('ai', 'prompts')), set::icon('angle-left'), set::text($lang->goback)), buildNavSteps($stepSequence, $stepStatus, $prompt, $lang->ai->designStepNav));