232201_test_to_master #1582
|
@ -10,10 +10,11 @@
|
||||||
panel="vn-ticket-search-panel"
|
panel="vn-ticket-search-panel"
|
||||||
info="Search ticket by id or alias"
|
info="Search ticket by id or alias"
|
||||||
model="model"
|
model="model"
|
||||||
|
filter="$ctrl.filterParams"
|
||||||
fetch-params="$ctrl.fetchParams($params)">
|
fetch-params="$ctrl.fetchParams($params)">
|
||||||
</vn-searchbar>
|
</vn-searchbar>
|
||||||
</vn-portal>
|
</vn-portal>
|
||||||
<vn-portal slot="menu">
|
<vn-portal slot="menu">
|
||||||
<vn-left-menu></vn-left-menu>
|
<vn-left-menu></vn-left-menu>
|
||||||
</vn-portal>
|
</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';
|
import ModuleMain from 'salix/components/module-main';
|
||||||
|
|
||||||
export default class Ticket extends ModuleMain {
|
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) {
|
fetchParams($params) {
|
||||||
const excludedParams = [
|
const excludedParams = [
|
||||||
'from',
|
'from',
|
||||||
|
@ -17,6 +35,10 @@ export default class Ticket extends ModuleMain {
|
||||||
const hasExcludedParams = excludedParams.some(param => {
|
const hasExcludedParams = excludedParams.some(param => {
|
||||||
return $params && $params[param] != undefined;
|
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;
|
const hasParams = Object.entries($params).length;
|
||||||
if (!hasParams || !hasExcludedParams)
|
if (!hasParams || !hasExcludedParams)
|
||||||
$params.scopeDays = 1;
|
$params.scopeDays = 1;
|
||||||
|
|
Loading…
Reference in New Issue