* [task#128768] add link button of thinkstep.

This commit is contained in:
Zhangyu
2024-09-23 16:42:44 +08:00
committed by 孙浩
parent 45dc658223
commit d9e50f35e3
+16 -2
View File
@@ -8,6 +8,7 @@ class thinkStep extends wg
'item: object',
'action?: string="detail"',
'addType?: string',
'wizard: object',
'isRun?: bool=false', // 是否是分析活动
'quoteQuestions?: array', // 引用题目的下拉选项
'quotedQuestions?: array', // 被引用的题目
@@ -34,9 +35,8 @@ class thinkStep extends wg
global $lang, $app;
$app->loadLang('thinkstep');
list($item, $action, $addType, $isRun, $quotedQuestions) = $this->prop(array('item', 'action', 'addType', 'isRun', 'quotedQuestions'));
list($item, $action, $wizard, $addType, $isRun, $quotedQuestions) = $this->prop(array('item', 'action', 'wizard', 'addType', 'isRun', 'quotedQuestions'));
if(!$item && !$addType) return array();
$marketID = data('marketID');
$basicType = $item->type ?? '';
$typeLang = $action . 'Step';
@@ -44,6 +44,7 @@ class thinkStep extends wg
$title = $action == 'detail' ? sprintf($lang->thinkstep->info, $lang->thinkstep->$basicType) : sprintf($lang->thinkstep->formTitle[$type], $lang->thinkstep->$typeLang);
$canEdit = common::hasPriv('thinkstep', 'edit');
$canDelete = common::hasPriv('thinkstep', 'delete');
$canLink = $wizard->model === '3c' && ($type === 'checkbox' || $type === 'radio' || $type === 'multicolumn');
return div
(
@@ -60,6 +61,19 @@ class thinkStep extends wg
setStyle(array('min-width' => '48px')),
btnGroup
(
$canLink ? ($item->options->required ? btn
(
setClass('btn ghost text-gray w-5 h-5 mr-1'),
set::icon('link'),
set::url(createLink('thinkstep', 'link')),
set('data-toggle', 'modal'),
set('data-dismiss', 'modal'),
set('data-size', 'sm'),
) : icon(
setClass('w-5 h-5 text-gray opacity-50 ml-1 text-md pl-1 mr-1'),
set::title($lang->thinkstep->tips->linkBlocks),
'link'
)): null,
$canEdit ? btn
(
setClass('btn ghost text-gray w-5 h-5'),