232201_test_to_master #1582
|
@ -10,10 +10,11 @@
|
|||
panel="vn-ticket-search-panel"
|
||||
info="Search ticket by id or alias"
|
||||
model="model"
|
||||
filter="$ctrl.filterParams"
|
||||
fetch-params="$ctrl.fetchParams($params)">
|
||||
</vn-searchbar>
|
||||
</vn-portal>
|
||||
<vn-portal slot="menu">
|
||||
<vn-left-menu></vn-left-menu>
|
||||
</vn-portal>
|
||||
<ui-view></ui-view>
|
||||
<ui-view></ui-view>
|
||||
|
|
|
@ -2,6 +2,24 @@ import ngModule from '../module';
|
|||
import ModuleMain from 'salix/components/module-main';
|
||||
|
||||
export default class Ticket extends ModuleMain {
|
||||
constructor($element, $) {
|
||||
super($element, $);
|
||||
|
||||
if (!this.$state.q) {
|
||||
const today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
const tomorrow = Date.vnNew();
|
||||
tomorrow.setHours(23, 59, 59, 59);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
|
||||
this.filterParams = {
|
||||
from: today,
|
||||
to: tomorrow
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fetchParams($params) {
|
||||
const excludedParams = [
|
||||
'from',
|
||||
|
@ -17,6 +35,10 @@ export default class Ticket extends ModuleMain {
|
|||
const hasExcludedParams = excludedParams.some(param => {
|
||||
return $params && $params[param] != undefined;
|
||||
});
|
||||
// const seachPanelParams = Object.entries($params);
|
||||
// const hasFromParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'from');
|
||||
// const hasToParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'to');
|
||||
|
||||
const hasParams = Object.entries($params).length;
|
||||
if (!hasParams || !hasExcludedParams)
|
||||
$params.scopeDays = 1;
|
||||
|
|
Loading…
Reference in New Issue