* [story#60464,1h] add check all.

This commit is contained in:
qixinzhi
2024-09-04 16:10:43 +08:00
committed by 代婷婷
parent cb52fdd8ea
commit 1f53d98896
6 changed files with 40 additions and 12 deletions
+18
View File
@@ -647,6 +647,24 @@ class pivotState
return $funcs;
}
/**
* Process check all.
*
* @access public
* @return void
*/
public function processCheckAll()
{
$from = $this->sqlBuilder['from'];
$joins = $this->sqlBuilder['joins'];
if($from['select'] == '*') $this->sqlBuilder['from']['select'] = array_keys($this->getTableDescList($from['alias']));
foreach($joins as $index => $join)
{
if($join['select'] == '*') $this->sqlBuilder['joins'][$index]['select'] = array_keys($this->getTableDescList($join['alias']));
}
}
/**
* Generate func alias.
*
+14 -12
View File
@@ -33,10 +33,12 @@ class fieldSelectPanel extends wg
protected function build()
{
list($table, $alias, $col) = $this->prop(array('table', 'alias', 'col'));
global $lang;
list($table, $alias, $fields, $values, $col) = $this->prop(array('table', 'alias', 'fields', 'values', 'col'));
$panelClass = $col == 1 ? "w-full" : 'w-1/' . min($col, 6) . '-gap-4';
$checkClass = 'checkbox-col-' . max(floor(6 / $col), 1);
$isCheckedAll = count($fields) == count($values);
$panelClass = $col == 1 ? "w-full" : 'w-1/' . min($col, 6) . '-gap-4';
$checkClass = 'checkbox-col-' . max(floor(6 / $col), 1);
return panel
(
@@ -45,21 +47,21 @@ class fieldSelectPanel extends wg
set::title("$table({$alias})"),
set::headingClass('bg-gray-100 relative'),
set::bodyClass('h-70 overflow-y-auto'),
/*to::heading
to::heading
(
div
(
setClass('absolute right-4'),
checkbox
setClass('absolute right-4 flex gap-x-2'),
btn
(
setClass('select-field-checkbox'),
set::name("{$alias}all"),
set::text($lang->bi->allFields),
set::value('*'),
set('data-alias', $alias)
setClass('p-0 check-all'),
set('data-alias', $alias),
set('data-checked', $isCheckedAll),
set::type('ghost'),
$isCheckedAll ? $lang->bi->cancelAll : $lang->bi->checkAll
)
)
),*/
),
checkList
(
setClass("flex justify-start gap-x-0 checkbox-col $checkClass"),
+2
View File
@@ -38,6 +38,8 @@ $lang->bi->addFunc = 'Add function';
$lang->bi->emptyFuncs = 'Empty function。';
$lang->bi->addWhere = 'Add group';
$lang->bi->emptyWheres = 'Empty where。';
$lang->bi->checkAll = 'Check All';
$lang->bi->cancelAll = 'Cancel All';
$lang->bi->whereGroupTitle = 'The %s group';
$lang->bi->addWhereGroup = 'Add group';
+2
View File
@@ -38,6 +38,8 @@ $lang->bi->addFunc = 'Add function';
$lang->bi->emptyFuncs = 'Empty function。';
$lang->bi->addWhere = 'Add group';
$lang->bi->emptyWheres = 'Empty where。';
$lang->bi->checkAll = 'Check All';
$lang->bi->cancelAll = 'Cancel All';
$lang->bi->whereGroupTitle = 'The %s group';
$lang->bi->addWhereGroup = 'Add group';
+2
View File
@@ -38,6 +38,8 @@ $lang->bi->addFunc = 'Add function';
$lang->bi->emptyFuncs = 'Empty function。';
$lang->bi->addWhere = 'Add group';
$lang->bi->emptyWheres = 'Empty where。';
$lang->bi->checkAll = 'Check All';
$lang->bi->cancelAll = 'Cancel All';
$lang->bi->whereGroupTitle = 'The %s group';
$lang->bi->addWhereGroup = 'Add group';
+2
View File
@@ -42,6 +42,8 @@ $lang->bi->addFunc = '新增函数字段';
$lang->bi->emptyFuncs = '暂未新增函数字段。';
$lang->bi->addWhere = '添加组';
$lang->bi->emptyWheres = '暂未添加确定性查询条件。';
$lang->bi->checkAll = '全选';
$lang->bi->cancelAll = '取消全选';
$lang->bi->whereGroupTitle = '第%s组确定性查询条件';
$lang->bi->addWhereGroup = '添加组';