* [refac] optimize code for codescan error.

This commit is contained in:
tianshujie
2025-08-05 09:05:18 +08:00
parent e1d3920e54
commit 9b83f0f6ea
+26 -18
View File
@@ -11,7 +11,6 @@ declare(strict_types=1);
namespace zin;
$noticeTip = $noSupport ? sprintf($lang->doc->noSupportList, $lang->doc->zentaoList[$type] . $lang->doc->list) : '';
$listText = $type == 'gantt' ? $lang->docTemplate->zentaoList['gantt'] : $lang->doc->list;
if($type == 'gantt' && !empty($ganttData))
{
@@ -54,9 +53,33 @@ $emptyTip = $lang->doc->previewTip;
if(!$isTemplate && $fromTemplate) $emptyTip = $isSetted ? $lang->docTemplate->emptyTip : $lang->docTemplate->previewTip;
if($fromReport) $emptyTip = $lang->docTemplate->emptyDataTip;
$listText = $type == 'gantt' ? $lang->docTemplate->zentaoList['gantt'] : $lang->doc->list;
$emptyText = $isTemplate ? sprintf($lang->docTemplate->configTip, $listText) : $emptyTip;
$pagerSetting = usePager();
unset($pagerSetting['linkCreator']);
$dataTable = null;
if(!$isTemplate && $type != 'gantt' && !$noSupport)
{
$dataTable = dtable
(
set::cols(array_values($cols)),
set::data(array_values($data)),
set::userMap($users),
set::emptyTip($emptyTip),
set::checkable(false),
set::colResize(true),
set::customCols(false),
set::onRenderCell(jsRaw('window.renderCell')),
set::localPager(),
set::footPager($pagerSetting),
set::footer(array('flex', 'pager')),
$type == 'productRelease' ? set::plugins(array('cellspan')) : null,
$type == 'productRelease' ? set::getCellSpan(jsRaw('window.getCellSpan')) : null
);
}
div
(
set('data-id', $blockID),
@@ -90,25 +113,10 @@ div
div
(
setClass('config-tip text-center px-3 py-2'),
$isTemplate ? sprintf($lang->docTemplate->configTip, $listText) : $emptyTip
$emptyText
)
):null,
!$isTemplate && $type != 'gantt' && !$noSupport ? dtable
(
set::cols(array_values($cols)),
set::data(array_values($data)),
set::userMap($users),
set::emptyTip($emptyTip),
set::checkable(false),
set::colResize(true),
set::customCols(false),
set::onRenderCell(jsRaw('window.renderCell')),
set::localPager(),
set::footPager($pagerSetting),
set::footer(array('flex', 'pager')),
$type == 'productRelease' ? set::plugins(array('cellspan')) : null,
$type == 'productRelease' ? set::getCellSpan(jsRaw('window.getCellSpan')) : null
) : null,
$dataTable,
$noSupport ? div
(
setClass('canvas border rounded py-3 px-3'),