From b0426fab9b0f12a2ef20e5e14277fa98ee111f17 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Fri, 13 Sep 2024 14:54:43 +0800 Subject: [PATCH] * [bug#55350,done,1h,0h] Fix save query to menu bug. --- lib/zin/wg/featurebar/v1.php | 4 +++- module/execution/ui/story.html.php | 3 +++ module/product/ui/browse.html.php | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/zin/wg/featurebar/v1.php b/lib/zin/wg/featurebar/v1.php index 70aef1cd9a..e2722b0d80 100644 --- a/lib/zin/wg/featurebar/v1.php +++ b/lib/zin/wg/featurebar/v1.php @@ -16,6 +16,7 @@ class featureBar extends wg 'load?: string="table"', 'loadID?: string', 'app?: string=""', + 'param?: int=0', 'labelCount?: int=-1' ); @@ -48,6 +49,7 @@ class featureBar extends wg $loadID = $this->prop('loadID'); $load = $this->prop('load'); $tab = $this->prop('app'); + $param = $this->prop('param'); $commonLink = $this->prop('link'); $itemLink = $this->prop('itemLink'); @@ -85,7 +87,7 @@ class featureBar extends wg $subItem = array(); $subItem['text'] = $text; - $subItem['active'] = $key == $current; + $subItem['active'] = $item->name == 'QUERY' ? $key == $param : $key == $current; $subItem['url'] = ($callback instanceof \Closure) ? $callback($key, $text) : str_replace('{key}', (string)$key, $link); $subItem['attrs'] = ['data-id' => $key, 'data-load' => $load, 'data-target' => $loadID, 'data-app' => $tab, 'data-success' => "() => zui.updateSearchForm('$searchModule')"]; diff --git a/module/execution/ui/story.html.php b/module/execution/ui/story.html.php index 690cc8202f..e61e68e257 100644 --- a/module/execution/ui/story.html.php +++ b/module/execution/ui/story.html.php @@ -26,6 +26,7 @@ jsVar('hourPointNotEmpty', sprintf($lang->error->notempty, $lang->story->conver jsVar('hourPointNotError', sprintf($lang->story->float, $lang->story->convertRelations)); /* Show feature bar. */ +$queryMenuLink = createLink($app->rawModule, $app->rawMethod, "&executionID=$execution->id&storyType=$storyType&orderBy=$orderBy&type=bySearch¶m={queryID}"); featureBar ( to::leading @@ -49,8 +50,10 @@ featureBar ) ) ), + set::param($param), set::current($this->session->storyBrowseType), set::link(createLink($app->rawModule, $app->rawMethod, "&executionID=$execution->id&storyType=$storyType&orderBy=$orderBy&type={key}")), + set::queryMenuLinkCallback(array(fn($key) => str_replace('{queryID}', (string)$key, $queryMenuLink))), li(searchToggle(set::module('executionStory'), set::open($type == 'bysearch'))) ); diff --git a/module/product/ui/browse.html.php b/module/product/ui/browse.html.php index 3ccb779e63..ce90c38a99 100644 --- a/module/product/ui/browse.html.php +++ b/module/product/ui/browse.html.php @@ -362,7 +362,7 @@ jsVar('modulePairs', $modulePairs); jsVar('storyType', $storyType); jsVar('checkedSummary', $checkedSummary); -$queryMenuLink = createLink($app->rawModule, $app->rawMethod, $projectIDParam . "productID=$productID&branch=$branch&browseType=bySearch¶m={queryID}"); +$queryMenuLink = createLink($app->rawModule, $app->rawMethod, $projectIDParam . "productID=$productID&branch=$branch&browseType=bySearch¶m={queryID}&storyType=$storyType&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}&projectID=$projectID"); featureBar ( $hideGrade ? null : to::leading @@ -386,6 +386,7 @@ featureBar ) ) ), + set::param($param), set::current($storyBrowseType), set::link(createLink($app->rawModule, $app->rawMethod, $projectIDParam . "productID=$productID&branch=$branch&browseType={key}¶m=$param&storyType=$storyType&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}&projectID=$projectID")), set::queryMenuLinkCallback(array(fn($key) => str_replace('{queryID}', (string)$key, $queryMenuLink))),