* [bug#56534] modify the renderRowData function of thinkmulticolumn.
This commit is contained in:
@@ -15,14 +15,13 @@ window.changeRows = function()
|
||||
|
||||
window.renderRowData = function()
|
||||
{
|
||||
$('.think-form-batch .form-batch-row-actions .btn[data-type="add"]').prop({
|
||||
disabled: ($('.think-form-batch tbody tr').length >= canAddRowsOfMulticol || disabled),
|
||||
title: $('.think-form-batch tbody tr').length >= canAddRowsOfMulticol ? addRowsTips.replace('%s', canAddRowsOfMulticol) : addLang,
|
||||
$(modeClass + ' .think-form-batch .form-batch-row-actions .btn[data-type="add"]').prop({
|
||||
disabled: ($(modeClass + ' .think-form-batch tbody tr').length >= canAddRowsOfMulticol || disabled),
|
||||
title: $(modeClass + ' .think-form-batch tbody tr').length >= canAddRowsOfMulticol ? addRowsTips.replace('%s', canAddRowsOfMulticol) : addLang,
|
||||
});
|
||||
$('.think-form-batch .form-batch-row-actions .btn[data-type="delete"]').prop({
|
||||
$(modeClass + ' .think-form-batch .form-batch-row-actions .btn[data-type="delete"]').prop({
|
||||
disabled: disabled,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
$(document).on('click', '.form-batch-row-actions .btn', function()
|
||||
|
||||
@@ -18,6 +18,7 @@ class thinkMulticolumn extends thinkQuestion
|
||||
'quoteQuestions?: array', // 引用问题
|
||||
'citation?: int=1', // 引用方式
|
||||
'selectColumn?: string', // 选择列
|
||||
'modeClass?: string', // 弹窗样式名称
|
||||
);
|
||||
|
||||
public static function getPageJS(): string
|
||||
@@ -74,7 +75,7 @@ class thinkMulticolumn extends thinkQuestion
|
||||
{
|
||||
global $lang;
|
||||
$detailWg = parent::buildDetail();
|
||||
list($step, $fields, $canAddRows, $mode, $isRun, $quotedQuestions, $isResult) = $this->prop(array('step', 'fields', 'canAddRows', 'mode', 'isRun', 'quotedQuestions', 'isResult'));
|
||||
list($step, $fields, $canAddRows, $mode, $isRun, $quotedQuestions, $isResult, $modeClass) = $this->prop(array('step', 'fields', 'canAddRows', 'mode', 'isRun', 'quotedQuestions', 'isResult', 'modeClass'));
|
||||
if($mode != 'detail') return array();
|
||||
|
||||
$result = array();
|
||||
@@ -89,6 +90,7 @@ class thinkMulticolumn extends thinkQuestion
|
||||
jsVar('addRowsTips', $lang->thinkrun->tips->addRow);
|
||||
jsVar('addLang', $lang->thinkrun->add);
|
||||
jsVar('disabled', $isRun && !empty($quotedQuestions) && !empty($result));
|
||||
jsVar('modeClass', !empty($modeClass) ? '.' . $modeClass : '');
|
||||
|
||||
$fields = array_values((array)$fields);
|
||||
$batchItems = array();
|
||||
|
||||
@@ -12,11 +12,12 @@ class thinkStep extends wg
|
||||
'isRun?: bool=false', // 是否是分析活动
|
||||
'quoteQuestions?: array', // 引用题目的下拉选项
|
||||
'quotedQuestions?: array', // 被引用的题目
|
||||
'modeClass?: string=""', // 弹窗样式名称
|
||||
);
|
||||
|
||||
protected function buildBody(): wg|array
|
||||
{
|
||||
list($item, $action, $addType, $isRun, $quoteQuestions, $quotedQuestions) = $this->prop(array('item', 'action', 'addType', 'isRun', 'quoteQuestions', 'quotedQuestions'));
|
||||
list($item, $action, $addType, $isRun, $quoteQuestions, $quotedQuestions, $modeClass) = $this->prop(array('item', 'action', 'addType', 'isRun', 'quoteQuestions', 'quotedQuestions', 'modeClass'));
|
||||
|
||||
$step = $addType ? null : $item;
|
||||
$questionType = $addType ? $addType : ($item->options->questionType ?? '');
|
||||
@@ -26,7 +27,7 @@ class thinkStep extends wg
|
||||
if($questionType === 'radio') return thinkRadio(set::step($step), set::questionType('radio'), set::mode($action), set::isRun($isRun), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'checkbox') return thinkCheckbox(set::step($step), set::questionType('checkbox'), set::mode($action), set::isRun($isRun), set::quoteQuestions($quoteQuestions), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'tableInput') return thinkTableInput(set::step($step), set::questionType('tableInput'), set::mode($action), set::isRun($isRun));
|
||||
if($questionType === 'multicolumn') return thinkMulticolumn(set::step($step), set::questionType('multicolumn'), set::mode($action), set::isRun($isRun), set::quoteQuestions($quoteQuestions), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'multicolumn') return thinkMulticolumn(set::step($step), set::questionType('multicolumn'), set::mode($action), set::isRun($isRun), set::quoteQuestions($quoteQuestions), set::quotedQuestions($quotedQuestions), set::modeClass($modeClass));
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user