PMCORE-2529
PMCORE-2541: Improve update filters in advanced search UI fix Cr notes fix Cr notes 2 solve conflicts fix Cr notes 3
This commit is contained in:
committed by
Rodrigo Quelca
parent
6209114a9b
commit
8a755f874d
19
package-lock.json
generated
19
package-lock.json
generated
@@ -9024,11 +9024,6 @@
|
|||||||
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
|
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"resize-observer-polyfill": {
|
|
||||||
"version": "1.5.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
|
|
||||||
"integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
|
|
||||||
},
|
|
||||||
"resolve": {
|
"resolve": {
|
||||||
"version": "1.19.0",
|
"version": "1.19.0",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
|
||||||
@@ -10724,15 +10719,6 @@
|
|||||||
"swiper": "^4.0.7"
|
"swiper": "^4.0.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vue-bootstrap-typeahead": {
|
|
||||||
"version": "0.2.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/vue-bootstrap-typeahead/-/vue-bootstrap-typeahead-0.2.6.tgz",
|
|
||||||
"integrity": "sha512-BcUAnvfN+PS0StL6E3endd37P7HUt9otk+8m7tsa2gkt2I2KY8O2Dma49oR8ie8iletvJAlAqpN+klF6ktPULQ==",
|
|
||||||
"requires": {
|
|
||||||
"resize-observer-polyfill": "^1.5.0",
|
|
||||||
"vue": "^2.5.17"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vue-chartjs": {
|
"vue-chartjs": {
|
||||||
"version": "3.5.1",
|
"version": "3.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/vue-chartjs/-/vue-chartjs-3.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/vue-chartjs/-/vue-chartjs-3.5.1.tgz",
|
||||||
@@ -10845,6 +10831,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vue-multiselect": {
|
||||||
|
"version": "2.1.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/vue-multiselect/-/vue-multiselect-2.1.6.tgz",
|
||||||
|
"integrity": "sha512-s7jmZPlm9FeueJg1RwJtnE9KNPtME/7C8uRWSfp9/yEN4M8XcS/d+bddoyVwVnvFyRh9msFo0HWeW0vTL8Qv+w=="
|
||||||
|
},
|
||||||
"vue-muuri": {
|
"vue-muuri": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/vue-muuri/-/vue-muuri-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vue-muuri/-/vue-muuri-0.1.2.tgz",
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"uiv": "^0.28.0",
|
"uiv": "^0.28.0",
|
||||||
"vue": "^2.6.12",
|
"vue": "^2.6.12",
|
||||||
"vue-awesome-swiper": "^3.1.3",
|
"vue-awesome-swiper": "^3.1.3",
|
||||||
"vue-bootstrap-typeahead": "^0.2.6",
|
|
||||||
"vue-chartjs": "^3.3.2",
|
"vue-chartjs": "^3.3.2",
|
||||||
"vue-clipboards": "^1.2.4",
|
"vue-clipboards": "^1.2.4",
|
||||||
"vue-color": "^2.7.0",
|
"vue-color": "^2.7.0",
|
||||||
@@ -48,6 +47,7 @@
|
|||||||
"vue-fullscreen": "^2.1.3",
|
"vue-fullscreen": "^2.1.3",
|
||||||
"vue-i18n": "^8.22.2",
|
"vue-i18n": "^8.22.2",
|
||||||
"vue-js-toggle-button": "^1.3.1",
|
"vue-js-toggle-button": "^1.3.1",
|
||||||
|
"vue-multiselect": "^2.1.6",
|
||||||
"vue-muuri": "^0.1.2",
|
"vue-muuri": "^0.1.2",
|
||||||
"vue-router": "^3.4.9",
|
"vue-router": "^3.4.9",
|
||||||
"vue-search-select": "^2.7.0",
|
"vue-search-select": "^2.7.0",
|
||||||
|
|||||||
@@ -63,8 +63,10 @@ const services = {
|
|||||||
UNASSIGNED_LIST: "/home/unassigned",
|
UNASSIGNED_LIST: "/home/unassigned",
|
||||||
MY_FILTERS: "/cases/advanced-search/filters",
|
MY_FILTERS: "/cases/advanced-search/filters",
|
||||||
POST_MY_FILTERS: "/cases/advanced-search/filter",
|
POST_MY_FILTERS: "/cases/advanced-search/filter",
|
||||||
|
PUT_MY_FILTERS: "/cases/advanced-search/filter/",
|
||||||
DELETE_MY_FILTERS: "/cases/advanced-search/filter/",
|
DELETE_MY_FILTERS: "/cases/advanced-search/filter/",
|
||||||
SEARCH: "/home/search",
|
SEARCH: "/home/search",
|
||||||
|
PROCESSES: "/home/processes"
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -162,6 +164,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
delete(options) {
|
delete(options) {
|
||||||
let service = options.service || "",
|
let service = options.service || "",
|
||||||
id = options.id || {},
|
id = options.id || {},
|
||||||
@@ -181,5 +184,29 @@ export default {
|
|||||||
"Authorization": `Bearer ` + credentials.accessToken
|
"Authorization": `Bearer ` + credentials.accessToken
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
put(options) {
|
||||||
|
let service = options.service || "",
|
||||||
|
params = options.params || {},
|
||||||
|
data = options.data || {},
|
||||||
|
id = options.id || {},
|
||||||
|
keys = options.keys || {},
|
||||||
|
url,
|
||||||
|
credentials = window.config.SYS_CREDENTIALS,
|
||||||
|
workspace = window.config.SYS_WORKSPACE,
|
||||||
|
server = window.config.SYS_SERVER;
|
||||||
|
url = this.getUrl(_.extend(keys, credentials, { server }, { workspace }), service);
|
||||||
|
|
||||||
|
return axios({
|
||||||
|
method: "put",
|
||||||
|
url: url + id,
|
||||||
|
params,
|
||||||
|
data,
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": `Bearer ` + credentials.accessToken
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,9 +20,15 @@ export let filters = {
|
|||||||
delete(data) {
|
delete(data) {
|
||||||
return Api.delete({
|
return Api.delete({
|
||||||
service: "DELETE_MY_FILTERS",
|
service: "DELETE_MY_FILTERS",
|
||||||
|
|
||||||
id: data.id,
|
id: data.id,
|
||||||
|
keys: {},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
put(data) {
|
||||||
|
return Api.put({
|
||||||
|
service: "PUT_MY_FILTERS",
|
||||||
|
id: data.id,
|
||||||
|
data,
|
||||||
keys: {},
|
keys: {},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -43,14 +49,13 @@ export let filters = {
|
|||||||
* Service to get the process list
|
* Service to get the process list
|
||||||
*/
|
*/
|
||||||
processList(query) {
|
processList(query) {
|
||||||
return axios.post(
|
return Api.get({
|
||||||
window.config.SYS_SERVER +
|
service: "PROCESSES",
|
||||||
window.config.SYS_URI +
|
params: {
|
||||||
`cases/casesList_Ajax?actionAjax=processListExtJs&action=search`,
|
text: query,
|
||||||
{
|
},
|
||||||
query,
|
keys: {},
|
||||||
}
|
});
|
||||||
);
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Service to get the users list
|
* Service to get the users list
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
import api from "./../../api/index";
|
import api from "./../../api/index";
|
||||||
export default {
|
export default {
|
||||||
name: "CustomSidebar",
|
name: "CustomSidebar",
|
||||||
|
props: ["menu"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menu: [],
|
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
isOnMobile: false,
|
isOnMobile: false,
|
||||||
hideToggle: true,
|
hideToggle: true,
|
||||||
@@ -43,14 +43,6 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.onResize();
|
this.onResize();
|
||||||
window.addEventListener("resize", this.onResize);
|
window.addEventListener("resize", this.onResize);
|
||||||
api.menu
|
|
||||||
.get()
|
|
||||||
.then((response) => {
|
|
||||||
this.menu = this.mappingMenu(response.data);
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
console.error(e);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
@@ -82,34 +74,6 @@ export default {
|
|||||||
this.isOnMobile = false;
|
this.isOnMobile = false;
|
||||||
this.collapsed = false;
|
this.collapsed = false;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Do a mapping of vue view for menus
|
|
||||||
* @returns array
|
|
||||||
*/
|
|
||||||
mappingMenu(data) {
|
|
||||||
var i,
|
|
||||||
j,
|
|
||||||
newData = data,
|
|
||||||
auxId,
|
|
||||||
viewVue = {
|
|
||||||
'CASES_MY_CASES': 'MyCases',
|
|
||||||
'CASES_SEARCH': 'advanced-search',
|
|
||||||
'CASES_INBOX': 'todo',
|
|
||||||
'CASES_DRAFT': 'draft',
|
|
||||||
'CASES_PAUSED': 'paused',
|
|
||||||
'CASES_SELFSERVICE': 'unassigned',
|
|
||||||
'CONSOLIDATED_CASES': 'batch-routing',
|
|
||||||
'CASES_TO_REASSIGN': 'task-reassignments',
|
|
||||||
'CASES_FOLDERS': 'my-documents'
|
|
||||||
};
|
|
||||||
for (i = 0; i < data.length; i += 1) {
|
|
||||||
auxId = data[i].id || '';
|
|
||||||
if (auxId !== '' && viewVue[auxId]) {
|
|
||||||
newData[i].id = viewVue[auxId];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newData;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,15 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<b-container fluid class="bv-example-row" id="my-container">
|
<b-container fluid class="bv-example-row" id="my-container">
|
||||||
<b-alert
|
|
||||||
:show="dismissCountDown"
|
|
||||||
dismissible
|
|
||||||
:variant="variant"
|
|
||||||
@dismissed="dismissCountDown = 0"
|
|
||||||
@dismiss-count-down="countDownChanged"
|
|
||||||
>
|
|
||||||
{{ message }}
|
|
||||||
</b-alert>
|
|
||||||
<b-row>
|
<b-row>
|
||||||
<b-col md="10"><h5>{{$t('ID_OPEN_SEARCH')}}</h5></b-col>
|
<b-col md="10"><h5>{{$t('ID_OPEN_SEARCH')}}</h5></b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
@@ -117,6 +109,11 @@
|
|||||||
:variant="tagVariant"
|
:variant="tagVariant"
|
||||||
class="mr-1"
|
class="mr-1"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<div :id="tag">
|
||||||
|
<i class="fas fa-tags"></i>
|
||||||
|
{{ searchTagsModels[tag].tagText }}
|
||||||
|
</div>
|
||||||
<component
|
<component
|
||||||
v-bind:is="tag"
|
v-bind:is="tag"
|
||||||
v-bind:info="searchTagsModels[tag]"
|
v-bind:info="searchTagsModels[tag]"
|
||||||
@@ -176,103 +173,67 @@ import DueDate from "./popovers/DueDate.vue";
|
|||||||
import LastModifiedDate from "./popovers/LastModifiedDate.vue";
|
import LastModifiedDate from "./popovers/LastModifiedDate.vue";
|
||||||
import CaseTitle from "./popovers/CaseTitle.vue";
|
import CaseTitle from "./popovers/CaseTitle.vue";
|
||||||
import ProcessName from "./popovers/ProcessName.vue";
|
import ProcessName from "./popovers/ProcessName.vue";
|
||||||
import ParticipatedLevel from "./popovers/ParticipatedLevel.vue";
|
|
||||||
import CasePriority from "./popovers/CasePriority.vue";
|
|
||||||
import TaskName from "./popovers/TaskName.vue";
|
|
||||||
import CaseStatus from "./popovers/CaseStatus.vue";
|
|
||||||
import CurrentUser from "./popovers/CurrentUser.vue";
|
|
||||||
import api from "./../../api/index";
|
import api from "./../../api/index";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "GenericFilter",
|
name: "GenericFilter",
|
||||||
props: ["id", "name"],
|
props: ["id", "name", "filters"],
|
||||||
components: {
|
components: {
|
||||||
SearchPopover,
|
SearchPopover,
|
||||||
CaseNumber,
|
CaseNumber,
|
||||||
DueDate,
|
DueDate,
|
||||||
LastModifiedDate,
|
LastModifiedDate,
|
||||||
CaseTitle,
|
CaseTitle,
|
||||||
ProcessName,
|
ProcessName
|
||||||
ParticipatedLevel,
|
|
||||||
TaskName,
|
|
||||||
CaseStatus,
|
|
||||||
CasePriority,
|
|
||||||
CurrentUser
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
addSearchTitle: this.$i18n.t('ID_ADD_SEARCH_FILTER_CRITERIA'),
|
addSearchTitle: this.$i18n.t('ID_ADD_SEARCH_FILTER_CRITERIA'),
|
||||||
dismissSecs: 5,
|
|
||||||
dismissCountDown: 0,
|
|
||||||
message: "",
|
|
||||||
variant: "info",
|
|
||||||
searchTags: [],
|
searchTags: [],
|
||||||
searchTagsModels: {
|
searchTagsModels: {
|
||||||
CaseNumber: {
|
CaseNumber: {
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_CASE')}${this.$i18n.t('ID_IUD')}`,
|
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_CASE')}${this.$i18n.t('ID_IUD')}`,
|
||||||
optionLabel: this.$i18n.t('ID_IUD'),
|
optionLabel: this.$i18n.t('ID_IUD'),
|
||||||
detail: this.$i18n.t('ID_PLEASE_SET_A_RANGE_TO_CASES_TO_SEARCH')
|
detail: this.$i18n.t('ID_PLEASE_SET_A_RANGE_TO_CASES_TO_SEARCH'),
|
||||||
|
tagText: "",
|
||||||
|
filterBy: ["filterCases"],
|
||||||
|
values: {}
|
||||||
},
|
},
|
||||||
DueDate: {
|
DueDate: {
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_DUE_DATE')}`,
|
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_DUE_DATE')}`,
|
||||||
optionLabel: this.$i18n.t('ID_DUE_DATE'),
|
optionLabel: this.$i18n.t('ID_DUE_DATE'),
|
||||||
detail: this.$i18n.t('ID_PLEASE_SET_A_RANGE_OF_CASES_DUE_DATE_TO_SEARCH')
|
detail: this.$i18n.t('ID_PLEASE_SET_A_RANGE_OF_CASES_DUE_DATE_TO_SEARCH'),
|
||||||
|
tagText: "",
|
||||||
|
filterBy: ["dueDateFrom", "dueDateTo"],
|
||||||
|
values: {}
|
||||||
},
|
},
|
||||||
LastModifiedDate: {
|
LastModifiedDate: {
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_LAST_MODIFIED_DATE')}`,
|
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_LAST_MODIFIED_DATE')}`,
|
||||||
optionLabel: this.$i18n.t('ID_LAST_MODIFIED_DATE'),
|
optionLabel: this.$i18n.t('ID_LAST_MODIFIED_DATE'),
|
||||||
detail: this.$i18n.t('ID_PLEASE_SET_A_RANGE_OF_LAST_MODIFIED_CASES_DATE_TO_SEARCH')
|
detail: this.$i18n.t('ID_PLEASE_SET_A_RANGE_OF_LAST_MODIFIED_CASES_DATE_TO_SEARCH'),
|
||||||
|
tagText: "",
|
||||||
|
filterBy: ["delegationDateFrom", "delegationDateTo"],
|
||||||
|
values: {}
|
||||||
},
|
},
|
||||||
CaseTitle: {
|
CaseTitle: {
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_CASE_TITLE')}`,
|
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_CASE_TITLE')}`,
|
||||||
optionLabel: this.$i18n.t('ID_CASE_TITLE'),
|
optionLabel: this.$i18n.t('ID_CASE_TITLE'),
|
||||||
detail: ""
|
detail: "",
|
||||||
|
tagText: "",
|
||||||
|
filterBy: ["caseTitle"],
|
||||||
|
values: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
ProcessName: {
|
ProcessName: {
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_PROCESS_NAME')}`,
|
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_PROCESS_NAME')}`,
|
||||||
optionLabel: this.$i18n.t('ID_PROCESS_NAME'),
|
optionLabel: this.$i18n.t('ID_PROCESS_NAME'),
|
||||||
detail: "",
|
detail: "",
|
||||||
placeholder: this.$i18n.t('ID_PROCESS_NAME')
|
placeholder: this.$i18n.t('ID_PROCESS_NAME'),
|
||||||
},
|
tagText: "",
|
||||||
CasePriority: {
|
filterBy: ["process", "processOption"],
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_PRIORITY')}`,
|
processOption: {"PRO_TITLE": ""}
|
||||||
optionLabel: this.$i18n.t('ID_PRIORITY'),
|
}
|
||||||
detail: this.$i18n.t('ID_PLEASE_SELECT_THE_PRIORITY_FOR_THE_SEARCH'),
|
|
||||||
options: [
|
|
||||||
{ text: this.$i18n.t('ID_VERY_LOW'), value: "VL" },
|
|
||||||
{ text: this.$i18n.t('ID_LOW'), value: "L" },
|
|
||||||
{ text: this.$i18n.t('ID_NORMAL'), value: "N" },
|
|
||||||
{ text: this.$i18n.t('ID_HIGH'), value: "H" },
|
|
||||||
{ text: this.$i18n.t('ID_VERY_HIGH'), value: "VH" }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
TaskName: {
|
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_TASK')}`,
|
|
||||||
optionLabel: this.$i18n.t('ID_TASK'),
|
|
||||||
detail: "",
|
|
||||||
placeholder: this.$i18n.t('ID_TASK_NAME')
|
|
||||||
},
|
|
||||||
CaseStatus: {
|
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_STATUS')}`,
|
|
||||||
optionLabel: this.$i18n.t('ID_STATUS'),
|
|
||||||
detail: this.$i18n.t('ID_PLEASE_SELECT_THE_STATUS_FOR_THE_SEARCH'),
|
|
||||||
options: [
|
|
||||||
{ text: this.$i18n.t('ID_CASES_STATUS_DRAFT'), value: "DRAFT" },
|
|
||||||
{ text: this.$i18n.t('ID_CASES_STATUS_TO_DO'), value: "TO_DO" },
|
|
||||||
{ text: this.$i18n.t('ID_CASES_STATUS_COMPLETED'), value: "COMPLETED" },
|
|
||||||
{ text: this.$i18n.t('ID_CASES_STATUS_CANCELLED'), value: "CANCELLED" },
|
|
||||||
{ text: this.$i18n.t('ID_CASES_STATUS_PAUSED'), value: "PAUSED" },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
CurrentUser: {
|
|
||||||
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_CURRENT_USER')}`,
|
|
||||||
optionLabel: this.$i18n.t('ID_CURRENT_USER'),
|
|
||||||
detail: "",
|
|
||||||
placeholder: this.$i18n.t('ID_USER_NAME'),
|
|
||||||
default: {
|
|
||||||
name: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
text: "",
|
text: "",
|
||||||
selected: [],
|
selected: [],
|
||||||
@@ -283,6 +244,14 @@ export default {
|
|||||||
nameState: null,
|
nameState: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
filters: function (filters) {
|
||||||
|
this.searchTags = [];
|
||||||
|
this.searchTags = [];
|
||||||
|
this.setFilters(filters);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
filterOptions: function() {
|
filterOptions: function() {
|
||||||
let options = [];
|
let options = [];
|
||||||
@@ -296,75 +265,96 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
|
||||||
* Updates the alert dismiss value to update
|
|
||||||
* dismissCountDown and decrease
|
|
||||||
* @param {mumber}
|
|
||||||
*/
|
|
||||||
countDownChanged(dismissCountDown) {
|
|
||||||
this.dismissCountDown = dismissCountDown;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Show the alert message
|
|
||||||
* @param {string} message - message to be displayen in the body
|
|
||||||
* @param {string} type - alert type
|
|
||||||
*/
|
|
||||||
showAlert(message, type) {
|
|
||||||
this.message = message;
|
|
||||||
this.variant = type || "info";
|
|
||||||
this.dismissCountDown = this.dismissSecs;
|
|
||||||
},
|
|
||||||
onClose() {
|
onClose() {
|
||||||
},
|
},
|
||||||
|
setFilters(filters) {
|
||||||
|
let that = this;
|
||||||
|
_.forIn(filters, function(value, key) {
|
||||||
|
let temp = that.createTagText(key, value);
|
||||||
|
that.searchTags.push(key);
|
||||||
|
that.selected.push(key);
|
||||||
|
});
|
||||||
|
},
|
||||||
onOk() {
|
onOk() {
|
||||||
|
let initialFilters = {};
|
||||||
this.$root.$emit('bv::hide::popover');
|
this.$root.$emit('bv::hide::popover');
|
||||||
this.searchTags = [...this.searchTags, ...this.selected];
|
for (var i = 0; i < this.selected.length; i++) {
|
||||||
|
let item = this.selected[i];
|
||||||
|
initialFilters[item] = {};
|
||||||
|
if(this.searchTagsModels[item].filterBy) {
|
||||||
|
for (var j = 0; j < this.searchTagsModels[item].filterBy.length; j++) {
|
||||||
|
initialFilters[item][this.searchTagsModels[item].filterBy [j]] = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
this.$emit("onUpdateFilters", initialFilters)
|
||||||
|
},
|
||||||
|
createTagText(type, params) {
|
||||||
|
let label = "";
|
||||||
|
switch (type) {
|
||||||
|
case "CaseNumber":
|
||||||
|
label = `${this.$i18n.t("ID_IUD")}: ${params.filterCases}`
|
||||||
|
this.searchTagsModels[type].values["filterCases"] = params.filterCases;
|
||||||
|
break;
|
||||||
|
case "DueDate":
|
||||||
|
label = `${this.$i18n.t('ID_FROM')}: ${params.dueDateFrom} ${this.$i18n.t('ID_TO')}: ${params.dueDateTo}`;
|
||||||
|
this.searchTagsModels[type].values["dueDateFrom"] = params.dueDateFrom;
|
||||||
|
this.searchTagsModels[type].values["dueDateTo"] = params.dueDateTo;
|
||||||
|
break;
|
||||||
|
case "LastModifiedDate":
|
||||||
|
label = `${this.$i18n.t('ID_FROM')}: ${params.delegationDateFrom} ${this.$i18n.t('ID_TO')}: ${params.delegationDateTo}`;
|
||||||
|
this.searchTagsModels[type].values["delegationDateFrom"] = params.delegationDateFrom;
|
||||||
|
this.searchTagsModels[type].values["delegationDateTo"] = params.delegationDateTo;
|
||||||
|
break;
|
||||||
|
case "CaseTitle":
|
||||||
|
label = `${this.$i18n.t("ID_CASE_TITLE")}: ${params.caseTitle}`;
|
||||||
|
this.searchTagsModels[type].values["caseTitle"] = params.caseTitle;
|
||||||
|
break;
|
||||||
|
case "ProcessName":
|
||||||
|
label = `${this.$i18n.t("ID_PROCESS")}: ${params.processOption.PRO_TITLE || ''}`;
|
||||||
|
this.searchTagsModels[type].processOption = params.processOption || null;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.searchTagsModels[type].tagText = label;
|
||||||
|
|
||||||
},
|
},
|
||||||
cleanAllTags() {
|
cleanAllTags() {
|
||||||
this.searchTags = [];
|
this.searchTags = [];
|
||||||
this.jsonFilter = {
|
this.selected = [];
|
||||||
search: "",
|
this.$emit("onUpdateFilters", {});
|
||||||
};
|
|
||||||
},
|
},
|
||||||
customRemove(removeTag, tag) {
|
customRemove(removeTag, tag) {
|
||||||
|
let temp = { ...this.filters};
|
||||||
|
delete temp[tag];
|
||||||
removeTag(tag);
|
removeTag(tag);
|
||||||
this.jsonFilter = {
|
this.$emit("onUpdateFilters", temp);
|
||||||
search: "",
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
onSearch() {
|
onSearch() {
|
||||||
this.$emit("onSearch", this.jsonFilter);
|
this.$emit("onSearch", this.filters);
|
||||||
},
|
},
|
||||||
updateSearchTag(params) {
|
updateSearchTag(params) {
|
||||||
this.jsonFilter = { ...this.jsonFilter, ...params };
|
this.$emit("onUpdateFilters", { ...this.filters, ...params });
|
||||||
},
|
},
|
||||||
onJumpCase() {
|
onJumpCase() {
|
||||||
this.$emit("onJumpCase", this.caseNumber);
|
this.$emit("onJumpCase", this.caseNumber);
|
||||||
},
|
},
|
||||||
onClick() {
|
onClick() {
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
this.updateData(this.name);
|
this.updateData(this.id);
|
||||||
} else {
|
} else {
|
||||||
this.$refs['saveFilter'].show();
|
this.$refs['saveFilter'].show();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete Search handler
|
* Delete Search handler
|
||||||
*/
|
*/
|
||||||
onDeleteSearch() {
|
onDeleteSearch() {
|
||||||
api.filters
|
this.$emit("onRemoveFilter", this.id);
|
||||||
.delete({
|
|
||||||
id: this.id,
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
|
|
||||||
this.$emit("onRemoveFilter", this.id);
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
this.showAlert(e.message, "danger");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
checkFormValidity() {
|
checkFormValidity() {
|
||||||
const valid = this.$refs.form.checkValidity();
|
const valid = this.$refs.form.checkValidity();
|
||||||
@@ -392,22 +382,26 @@ export default {
|
|||||||
this.saveData(this.localName);
|
this.saveData(this.localName);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Save Data Handler
|
||||||
|
*/
|
||||||
saveData(name) {
|
saveData(name) {
|
||||||
api.filters
|
this.$emit("onSubmit", {
|
||||||
.post({
|
|
||||||
name: name,
|
name: name,
|
||||||
filters: JSON.stringify({ uno: "first" }),
|
filters: this.filters
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.$emit("onSubmit", response.data);
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
this.showAlert(e.message, "danger");
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateData() {
|
/**
|
||||||
this.onDeleteSearch();
|
* Update Data Handler
|
||||||
this.saveData(this.name);
|
* @param {string} id - filter id
|
||||||
|
*/
|
||||||
|
updateData(id) {
|
||||||
|
this.$emit("onSubmit", {
|
||||||
|
type: "update",
|
||||||
|
id: id,
|
||||||
|
name: this.name,
|
||||||
|
filters: this.filters
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,12 +7,6 @@
|
|||||||
@savePopover="onOk"
|
@savePopover="onOk"
|
||||||
:title="info.title"
|
:title="info.title"
|
||||||
>
|
>
|
||||||
<template v-slot:target-item>
|
|
||||||
<div @click="onClickTag(tag)" :id="tag">
|
|
||||||
<i class="fas fa-tags"></i>
|
|
||||||
{{ tagText }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p>{{ info.detail }}</p>
|
<p>{{ info.detail }}</p>
|
||||||
<form ref="form" @submit.stop.prevent="handleSubmit">
|
<form ref="form" @submit.stop.prevent="handleSubmit">
|
||||||
@@ -23,7 +17,7 @@
|
|||||||
>
|
>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="name-input"
|
id="name-input"
|
||||||
v-model="value"
|
v-model="info.values.filterCases"
|
||||||
:placeholder="$t('ID_CASE_NUMBER_FILTER_EG')"
|
:placeholder="$t('ID_CASE_NUMBER_FILTER_EG')"
|
||||||
:state="valueState"
|
:state="valueState"
|
||||||
required
|
required
|
||||||
@@ -45,24 +39,18 @@ export default {
|
|||||||
props: ["tag", "info"],
|
props: ["tag", "info"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: "",
|
|
||||||
valueState: null,
|
valueState: null,
|
||||||
showPopover: false,
|
showPopover: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
tagText: function() {
|
|
||||||
return `${this.$i18n.t("ID_IUD")}: ${this.value} `;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
onClose() {
|
onClose() {
|
||||||
this.showPopover = true;
|
this.showPopover = true;
|
||||||
},
|
},
|
||||||
checkFormValidity() {
|
checkFormValidity() {
|
||||||
const regex = /^((\d+?)|(\d+?)(?:\-(\d+?))?)(?:\, ((\d+?)|(\d+?)(?:\-(\d+?))?))*$/;
|
const regex = /^((\d+?)|(\d+?)(?:\-(\d+?))?)(?:\, ((\d+?)|(\d+?)(?:\-(\d+?))?))*$/;
|
||||||
regex.test(this.value);
|
regex.test(this.info.values.filterCases);
|
||||||
this.valueState = regex.test(this.value);
|
this.valueState = regex.test(this.info.values.filterCases);
|
||||||
return this.valueState;
|
return this.valueState;
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
@@ -74,7 +62,9 @@ export default {
|
|||||||
// Hide the modal manually
|
// Hide the modal manually
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$emit("updateSearchTag", {
|
this.$emit("updateSearchTag", {
|
||||||
filterCases: self.value.replace(/ /g, ""),
|
CaseNumber: {
|
||||||
|
filterCases: self.info.values.filterCases.replace(/ /g, ""),
|
||||||
|
}
|
||||||
});
|
});
|
||||||
self.$root.$emit("bv::hide::popover");
|
self.$root.$emit("bv::hide::popover");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,16 +2,10 @@
|
|||||||
<div id="">
|
<div id="">
|
||||||
<SearchPopover
|
<SearchPopover
|
||||||
:target="tag"
|
:target="tag"
|
||||||
@closePopover="onClose"
|
|
||||||
@savePopover="onOk"
|
@savePopover="onOk"
|
||||||
:title="info.title"
|
:title="info.title"
|
||||||
>
|
>
|
||||||
<template v-slot:target-item>
|
|
||||||
<div @click="onClickTag(tag)" :id="tag">
|
|
||||||
<b-icon icon="tags-fill" font-scale="1"></b-icon>
|
|
||||||
{{ tagText }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p>{{ info.detail }}</p>
|
<p>{{ info.detail }}</p>
|
||||||
<form ref="form" @submit.stop.prevent="handleSubmit">
|
<form ref="form" @submit.stop.prevent="handleSubmit">
|
||||||
@@ -22,7 +16,7 @@
|
|||||||
>
|
>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="name-input"
|
id="name-input"
|
||||||
v-model="title"
|
v-model="info.values.caseTitle"
|
||||||
:placeholder="$t('ID_CASE_TITLE_NAME')"
|
:placeholder="$t('ID_CASE_TITLE_NAME')"
|
||||||
:state="valueState"
|
:state="valueState"
|
||||||
required
|
required
|
||||||
@@ -48,11 +42,6 @@ export default {
|
|||||||
valueState: null,
|
valueState: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
tagText: function() {
|
|
||||||
return `${this.$i18n.t("ID_CASE_TITLE")}: ${this.title}`;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* Check the form validations and requiered fields
|
* Check the form validations and requiered fields
|
||||||
@@ -73,7 +62,9 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$emit("updateSearchTag", {
|
this.$emit("updateSearchTag", {
|
||||||
caseTitle: self.title,
|
CaseTitle: {
|
||||||
|
caseTitle: self.info.values.caseTitle,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
self.$root.$emit("bv::hide::popover");
|
self.$root.$emit("bv::hide::popover");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,12 +5,6 @@
|
|||||||
@savePopover="onOk"
|
@savePopover="onOk"
|
||||||
:title="info.title"
|
:title="info.title"
|
||||||
>
|
>
|
||||||
<template v-slot:target-item>
|
|
||||||
<div @click="onClickTag(tag)" :id="tag">
|
|
||||||
<b-icon icon="tags-fill" font-scale="1"></b-icon>
|
|
||||||
{{ tagText }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p>{{ info.detail }}</p>
|
<p>{{ info.detail }}</p>
|
||||||
<form ref="form" @submit.stop.prevent="handleSubmit">
|
<form ref="form" @submit.stop.prevent="handleSubmit">
|
||||||
@@ -19,7 +13,7 @@
|
|||||||
<b-form-group >
|
<b-form-group >
|
||||||
<b-form-datepicker
|
<b-form-datepicker
|
||||||
id="from"
|
id="from"
|
||||||
v-model="from"
|
v-model="info.values.dueDateFrom"
|
||||||
:placeholder="$t('ID_FROM_DUE_DATE')"
|
:placeholder="$t('ID_FROM_DUE_DATE')"
|
||||||
></b-form-datepicker>
|
></b-form-datepicker>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
@@ -28,7 +22,7 @@
|
|||||||
<b-form-group>
|
<b-form-group>
|
||||||
<b-form-datepicker
|
<b-form-datepicker
|
||||||
id="to"
|
id="to"
|
||||||
v-model="to"
|
v-model="info.values.dueDateTo"
|
||||||
:placeholder="$t('ID_TO_DUE_DATE')"
|
:placeholder="$t('ID_TO_DUE_DATE')"
|
||||||
></b-form-datepicker>
|
></b-form-datepicker>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
@@ -48,26 +42,18 @@ export default {
|
|||||||
SearchPopover,
|
SearchPopover,
|
||||||
},
|
},
|
||||||
props: ["tag", "info"],
|
props: ["tag", "info"],
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
from: "",
|
|
||||||
to: ""
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
tagText: function() {
|
|
||||||
return `${this.$i18n.t('ID_FROM')}: ${this.from} ${this.$i18n.t('ID_TO')}: ${this.to}`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* Submit form handler
|
* Submit form handler
|
||||||
*/
|
*/
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
this.$emit("updateSearchTag", {
|
this.$emit("updateSearchTag", {
|
||||||
dueDateFrom: this.from,
|
DueDate: {
|
||||||
dueDateTo: this.to,
|
dueDateFrom: this.info.values.dueDateFrom,
|
||||||
|
dueDateTo: this.info.values.dueDateTo
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
this.$root.$emit("bv::hide::popover");
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* On ok event handler
|
* On ok event handler
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="">
|
<div id="">
|
||||||
<SearchPopover :target="tag" @savePopover="onOk" :title="info.title">
|
<SearchPopover :target="tag" @savePopover="onOk" :title="info.title">
|
||||||
<template v-slot:target-item>
|
|
||||||
<div @click="onClickTag(tag)" :id="tag">
|
|
||||||
<b-icon icon="tags-fill" font-scale="1"></b-icon>
|
|
||||||
{{ tagText }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p>{{ info.detail }}</p>
|
<p>{{ info.detail }}</p>
|
||||||
<form ref="form" @submit.stop.prevent="handleSubmit">
|
<form ref="form" @submit.stop.prevent="handleSubmit">
|
||||||
@@ -15,7 +9,7 @@
|
|||||||
<b-form-group>
|
<b-form-group>
|
||||||
<b-form-datepicker
|
<b-form-datepicker
|
||||||
id="from"
|
id="from"
|
||||||
v-model="from"
|
v-model="info.values.delegationDateFrom"
|
||||||
:placeholder="$t('ID_FROM_LAST_MODIFIED_DATE')"
|
:placeholder="$t('ID_FROM_LAST_MODIFIED_DATE')"
|
||||||
></b-form-datepicker>
|
></b-form-datepicker>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
@@ -24,7 +18,7 @@
|
|||||||
<b-form-group>
|
<b-form-group>
|
||||||
<b-form-datepicker
|
<b-form-datepicker
|
||||||
id="to"
|
id="to"
|
||||||
v-model="to"
|
v-model="info.values.delegationDateTo"
|
||||||
:placeholder="$t('ID_TO_LAST_MODIFIED_DATE')"
|
:placeholder="$t('ID_TO_LAST_MODIFIED_DATE')"
|
||||||
></b-form-datepicker>
|
></b-form-datepicker>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
@@ -44,26 +38,18 @@ export default {
|
|||||||
SearchPopover,
|
SearchPopover,
|
||||||
},
|
},
|
||||||
props: ["tag", "info"],
|
props: ["tag", "info"],
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
from: "",
|
|
||||||
to: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
tagText: function() {
|
|
||||||
return `${this.$i18n.t('ID_FROM')}: ${this.from} ${this.$i18n.t('ID_TO')}: ${this.to}`;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* Submit form handler
|
* Submit form handler
|
||||||
*/
|
*/
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
this.$emit("updateSearchTag", {
|
this.$emit("updateSearchTag", {
|
||||||
delegationDateFrom: this.from,
|
LastModifiedDate: {
|
||||||
delegationDateTo: this.to
|
delegationDateFrom: this.info.values.delegationDateFrom,
|
||||||
|
delegationDateTo: this.info.values.delegationDateTo
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
this.$root.$emit("bv::hide::popover");
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* On ok event handler
|
* On ok event handler
|
||||||
|
|||||||
@@ -1,32 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="">
|
<div id="">
|
||||||
<SearchPopover :target="tag" @savePopover="onOk" :title="info.title">
|
<SearchPopover :target="tag" @savePopover="onOk" :title="info.title">
|
||||||
<template v-slot:target-item>
|
|
||||||
<div @click="onClickTag(tag)" :id="tag">
|
|
||||||
<b-icon icon="tags-fill" font-scale="1"></b-icon>
|
|
||||||
{{ tagText }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p>{{ info.detail }}</p>
|
<p>{{ info.detail }}</p>
|
||||||
<form ref="form" @submit.stop.prevent="handleSubmit">
|
<form ref="form" @submit.stop.prevent="handleSubmit">
|
||||||
<b-form-group
|
<b-form-group
|
||||||
:state="valueState"
|
|
||||||
label-for="name"
|
label-for="name"
|
||||||
:invalid-feedback="$t('ID_PROCESS_IS_REQUIRED')"
|
:invalid-feedback="$t('ID_PROCESS_IS_REQUIRED')"
|
||||||
>
|
>
|
||||||
<vue-bootstrap-typeahead
|
<multiselect
|
||||||
class="mb-4"
|
v-model="info.processOption"
|
||||||
id="name"
|
:options="processes"
|
||||||
v-model="query"
|
placeholder="Select one"
|
||||||
:minMatchingChars="minMatchingChars"
|
label="PRO_TITLE"
|
||||||
:data="process"
|
track-by="PRO_ID"
|
||||||
:serializer="(item) => item.PRO_TITLE"
|
:show-no-results="false"
|
||||||
@hit="selectedUser = $event"
|
@search-change="asyncFind"
|
||||||
:placeholder="info.placeholder"
|
:loading="isLoading"
|
||||||
required
|
id="ajax"
|
||||||
:state="valueState"
|
:limit="10"
|
||||||
/>
|
:clear-on-select="true"
|
||||||
|
>
|
||||||
|
</multiselect>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,41 +31,39 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import SearchPopover from "./SearchPopover.vue";
|
import SearchPopover from "./SearchPopover.vue";
|
||||||
import VueBootstrapTypeahead from "vue-bootstrap-typeahead";
|
import Multiselect from 'vue-multiselect'
|
||||||
import api from "./../../../api/index";
|
import api from "./../../../api/index";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SearchPopover,
|
SearchPopover,
|
||||||
VueBootstrapTypeahead,
|
Multiselect,
|
||||||
},
|
},
|
||||||
props: ["tag", "info"],
|
props: ["tag", "info"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
minMatchingChars: 1,
|
processes: [],
|
||||||
query: "",
|
isLoading: false
|
||||||
process: [],
|
|
||||||
valueState: null,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
methods: {
|
||||||
tagText: function() {
|
/**
|
||||||
return `${this.$i18n.t("ID_PROCESS")}: ${this.query}`;
|
* Find asynchronously in the server
|
||||||
},
|
* @param {string} query - string from the text field
|
||||||
},
|
*/
|
||||||
watch: {
|
asyncFind (query) {
|
||||||
query(newQuery) {
|
this.isLoading = true
|
||||||
api.filters
|
api.filters
|
||||||
.processList(this.query)
|
.processList(query)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.process = response.data;
|
this.processes = response.data;
|
||||||
|
this.countries = response
|
||||||
|
this.isLoading = false
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
/**
|
||||||
* Form validations review
|
* Form validations review
|
||||||
*/
|
*/
|
||||||
@@ -89,25 +82,16 @@ export default {
|
|||||||
* Form submit handler
|
* Form submit handler
|
||||||
*/
|
*/
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
// Exit when the form isn't valid
|
|
||||||
if (!this.checkFormValidity()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
let process = _.find(this.process, { PRO_TITLE: this.query });
|
|
||||||
this.$emit("updateSearchTag", {
|
this.$emit("updateSearchTag", {
|
||||||
process: process.PRO_ID,
|
ProcessName: {
|
||||||
|
processOption: this.info.processOption,
|
||||||
|
process: this.info.processOption.PRO_ID
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.$root.$emit("bv::hide::popover");
|
this.$root.$emit("bv::hide::popover");
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Cick tag event handler
|
|
||||||
*/
|
|
||||||
onClickTag() {
|
|
||||||
this.$root.$emit("bv::hide::popover");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="v-mycases3" ref="v-mycases2" class="v-container-mycases">
|
<div id="v-mycases3" ref="v-mycases2" class="v-container-mycases">
|
||||||
|
<b-alert
|
||||||
|
:show="dismissCountDown"
|
||||||
|
dismissible
|
||||||
|
:variant="variant"
|
||||||
|
@dismissed="dismissCountDown = 0"
|
||||||
|
@dismiss-count-down="countDownChanged"
|
||||||
|
>
|
||||||
|
{{ message }}
|
||||||
|
</b-alert>
|
||||||
<button-fleft :data="newCase"></button-fleft>
|
<button-fleft :data="newCase"></button-fleft>
|
||||||
<GenericFilter
|
<GenericFilter
|
||||||
:id="id"
|
:id="id"
|
||||||
:name="name"
|
:name="name"
|
||||||
|
:filters="filters"
|
||||||
@onJumpCase="onJumpCase"
|
@onJumpCase="onJumpCase"
|
||||||
@onSubmit="onSubmitFilter"
|
@onSubmit="onSubmitFilter"
|
||||||
@onRemoveFilter="onRemoveFilter"
|
@onRemoveFilter="onRemoveFilter"
|
||||||
@onSearch="onSearch"
|
@onSearch="onSearch"
|
||||||
|
@onUpdateFilters="onUpdateFilters"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<modal-new-request ref="newRequest"></modal-new-request>
|
<modal-new-request ref="newRequest"></modal-new-request>
|
||||||
@@ -84,13 +95,17 @@ export default {
|
|||||||
ModalNewRequest,
|
ModalNewRequest,
|
||||||
TaskCell
|
TaskCell
|
||||||
},
|
},
|
||||||
props: ["id", "name"],
|
props: ["id", "name", "filters"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
dismissSecs: 5,
|
||||||
|
dismissCountDown: 0,
|
||||||
|
message: "",
|
||||||
|
variant: "info",
|
||||||
metrics: [],
|
metrics: [],
|
||||||
filter: "CASES_INBOX",
|
filter: "CASES_INBOX",
|
||||||
allView: [],
|
allView: [],
|
||||||
jsonFilters: null,
|
filtersModel: {},
|
||||||
filterHeader: "STARTED_BY_ME",
|
filterHeader: "STARTED_BY_ME",
|
||||||
headers: [],
|
headers: [],
|
||||||
newCase: {
|
newCase: {
|
||||||
@@ -143,6 +158,11 @@ export default {
|
|||||||
pmDateFormat: "Y-m-d H:i:s",
|
pmDateFormat: "Y-m-d H:i:s",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
id: function() {
|
||||||
|
this.$refs.test.refresh();
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* Get cases data by header
|
* Get cases data by header
|
||||||
@@ -151,8 +171,12 @@ export default {
|
|||||||
let that = this,
|
let that = this,
|
||||||
dt;
|
dt;
|
||||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||||
|
let filters = {};
|
||||||
|
_.forIn(this.filters, function(value, key) {
|
||||||
|
filters = {...filters, ...value};
|
||||||
|
});
|
||||||
api.cases
|
api.cases
|
||||||
.search(that.jsonFilters)
|
.search(filters)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
dt = that.formatDataResponse(response.data.data);
|
dt = that.formatDataResponse(response.data.data);
|
||||||
resolutionFunc({
|
resolutionFunc({
|
||||||
@@ -368,27 +392,84 @@ export default {
|
|||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Updates the alert dismiss value to update
|
||||||
|
* dismissCountDown and decrease
|
||||||
|
* @param {mumber}
|
||||||
|
*/
|
||||||
|
countDownChanged(dismissCountDown) {
|
||||||
|
this.dismissCountDown = dismissCountDown;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Show the alert message
|
||||||
|
* @param {string} message - message to be displayen in the body
|
||||||
|
* @param {string} type - alert type
|
||||||
|
*/
|
||||||
|
showAlert(message, type) {
|
||||||
|
this.message = message;
|
||||||
|
this.variant = type || "info";
|
||||||
|
this.dismissCountDown = this.dismissSecs;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Handler submit filter
|
* Handler submit filter
|
||||||
* @param {object} data - data returned from the server
|
* @param {object} data - data returned from the server
|
||||||
*/
|
*/
|
||||||
onSubmitFilter(data) {
|
onSubmitFilter(params) {
|
||||||
this.$emit("onSubmitFilter", data);
|
if (params.type === "update") {
|
||||||
|
api.filters
|
||||||
|
.put({
|
||||||
|
id: params.id,
|
||||||
|
name: params.name,
|
||||||
|
filters: JSON.stringify(params.filters),
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$emit("onSubmitFilter", params);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
this.showAlert(e.message, "danger");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
api.filters
|
||||||
|
.post({
|
||||||
|
name: params.name,
|
||||||
|
filters: JSON.stringify(params.filters),
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$emit("onSubmitFilter", response.data);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
this.showAlert(e.message, "danger");
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Handler on remove filter
|
* Handler on remove filter
|
||||||
* @param {number} id - data returned fron the server
|
* @param {number} id - data returned fron the server
|
||||||
*/
|
*/
|
||||||
onRemoveFilter(id) {
|
onRemoveFilter(id) {
|
||||||
this.$emit("onRemoveFilter", id);
|
api.filters
|
||||||
|
.delete({
|
||||||
|
id: this.id,
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$emit("onUpdateFilters", {});
|
||||||
|
this.$emit("onRemoveFilter", id);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
this.showAlert(e.message, "danger");
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Handler on search filter
|
* Handler on search filter
|
||||||
* @param {number} id - data returned fron the server
|
* @param {number} id - data returned fron the server
|
||||||
*/
|
*/
|
||||||
onSearch(params) {
|
onSearch(params) {
|
||||||
this.jsonFilters = params;
|
this.$nextTick(() => {
|
||||||
this.$refs.test.refresh();
|
this.$refs.test.refresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onUpdateFilters(params) {
|
||||||
|
this.$emit("onUpdateFilters", params);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<component
|
<component
|
||||||
v-bind:is="page"
|
v-bind:is="page"
|
||||||
ref="component"
|
ref="component"
|
||||||
|
:filters="filters"
|
||||||
:id="pageId"
|
:id="pageId"
|
||||||
:name="pageName"
|
:name="pageName"
|
||||||
@onSubmitFilter="onSubmitFilter"
|
@onSubmitFilter="onSubmitFilter"
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
@onUpdatePage="onUpdatePage"
|
@onUpdatePage="onUpdatePage"
|
||||||
@onUpdateDataCase="onUpdateDataCase"
|
@onUpdateDataCase="onUpdateDataCase"
|
||||||
@onLastPage="onLastPage"
|
@onLastPage="onLastPage"
|
||||||
|
@onUpdateFilters="onUpdateFilters"
|
||||||
></component>
|
></component>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +69,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
lastPage: "MyCases",
|
lastPage: "MyCases",
|
||||||
page: "MyCases",
|
page: "MyCases",
|
||||||
menu: null,
|
menu: [],
|
||||||
dataCase: {},
|
dataCase: {},
|
||||||
hideToggle: true,
|
hideToggle: true,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
@@ -76,6 +78,7 @@ export default {
|
|||||||
sidebarWidth: "310px",
|
sidebarWidth: "310px",
|
||||||
pageId: null,
|
pageId: null,
|
||||||
pageName: null,
|
pageName: null,
|
||||||
|
filters: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -91,14 +94,49 @@ export default {
|
|||||||
api.menu
|
api.menu
|
||||||
.get()
|
.get()
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.menu = response;
|
this.menu = this.mappingMenu(response.data);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Do a mapping of vue view for menus
|
||||||
|
* @returns array
|
||||||
|
*/
|
||||||
|
mappingMenu(data) {
|
||||||
|
var i,
|
||||||
|
j,
|
||||||
|
newData = data,
|
||||||
|
auxId,
|
||||||
|
viewVue = {
|
||||||
|
CASES_MY_CASES: "MyCases",
|
||||||
|
CASES_SEARCH: "advanced-search",
|
||||||
|
CASES_INBOX: "todo",
|
||||||
|
CASES_DRAFT: "draft",
|
||||||
|
CASES_PAUSED: "paused",
|
||||||
|
CASES_SELFSERVICE: "unassigned",
|
||||||
|
CONSOLIDATED_CASES: "batch-routing",
|
||||||
|
CASES_TO_REASSIGN: "task-reassignments",
|
||||||
|
CASES_FOLDERS: "my-documents",
|
||||||
|
};
|
||||||
|
for (i = 0; i < data.length; i += 1) {
|
||||||
|
auxId = data[i].id || "";
|
||||||
|
if (auxId !== "" && viewVue[auxId]) {
|
||||||
|
newData[i].id = viewVue[auxId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newData;
|
||||||
|
},
|
||||||
OnClickSidebarItem(item) {
|
OnClickSidebarItem(item) {
|
||||||
this.page = item.item.id || "MyCases";
|
if (item.item.page && item.item.page === "/advanced-search") {
|
||||||
|
this.page = "advanced-search";
|
||||||
|
this.filters = item.item.filters;
|
||||||
|
this.pageId = item.item.id;
|
||||||
|
this.pageName = item.item.title;
|
||||||
|
} else {
|
||||||
|
this.page = item.item.id || "MyCases";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Update page component
|
* Update page component
|
||||||
@@ -141,24 +179,38 @@ export default {
|
|||||||
addMenuSearchChild(data) {
|
addMenuSearchChild(data) {
|
||||||
let newMenu = this.menu;
|
let newMenu = this.menu;
|
||||||
let advSearch = _.find(newMenu, function(o) {
|
let advSearch = _.find(newMenu, function(o) {
|
||||||
return o.href === "/advanced-search";
|
return o.id === "advanced-search";
|
||||||
});
|
});
|
||||||
if (!advSearch.hasOwnProperty("child")) {
|
if (advSearch) {
|
||||||
advSearch["child"] = [];
|
const index = advSearch.child.findIndex(function(o) {
|
||||||
|
return o.id === data.id;
|
||||||
|
});
|
||||||
|
if (index !== -1) {
|
||||||
|
advSearch.child[index].filters = data.filters;
|
||||||
|
} else {
|
||||||
|
if (!advSearch.hasOwnProperty("child")) {
|
||||||
|
advSearch["child"] = [];
|
||||||
|
}
|
||||||
|
advSearch.child.push({
|
||||||
|
filters: data.filters,
|
||||||
|
href: "/advanced-search/" + data.id,
|
||||||
|
title: data.name,
|
||||||
|
icon: "fas fa-circle",
|
||||||
|
id: data.id,
|
||||||
|
page: "/advanced-search",
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
advSearch.child.push({
|
|
||||||
href: "/advanced-search/" + data.id,
|
|
||||||
title: data.name,
|
|
||||||
icon: "fas fa-circle",
|
|
||||||
id: data.id,
|
|
||||||
page: "advanced-search",
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
onRemoveFilter(id) {
|
onRemoveFilter(id) {
|
||||||
this.removeMenuSearchChild(id);
|
this.removeMenuSearchChild(id);
|
||||||
|
this.resetSettings();
|
||||||
|
},
|
||||||
|
resetSettings() {
|
||||||
this.page = "advanced-search";
|
this.page = "advanced-search";
|
||||||
this.pageId = null;
|
this.pageId = null;
|
||||||
this.pageName = null;
|
this.pageName = null;
|
||||||
|
this.filters = {};
|
||||||
},
|
},
|
||||||
onUpdatePage(page) {
|
onUpdatePage(page) {
|
||||||
this.lastPage = this.page;
|
this.lastPage = this.page;
|
||||||
@@ -167,20 +219,25 @@ export default {
|
|||||||
onUpdateDataCase(data) {
|
onUpdateDataCase(data) {
|
||||||
this.dataCase = data;
|
this.dataCase = data;
|
||||||
},
|
},
|
||||||
onLastPage(){
|
onLastPage() {
|
||||||
this.page = this.lastPage;
|
this.page = this.lastPage;
|
||||||
this.lastPage = "MyCases"
|
this.lastPage = "MyCases";
|
||||||
},
|
},
|
||||||
removeMenuSearchChild(id) {
|
removeMenuSearchChild(id) {
|
||||||
let newMenu = this.menu;
|
let newMenu = this.menu;
|
||||||
let advSearch = _.find(newMenu, function(o) {
|
let advSearch = _.find(newMenu, function(o) {
|
||||||
return o.href === "/advanced-search";
|
return o.id === "advanced-search";
|
||||||
});
|
});
|
||||||
const index = advSearch.child.findIndex(function(o) {
|
if (advSearch) {
|
||||||
return o.id === id;
|
const index = advSearch.child.findIndex(function(o) {
|
||||||
});
|
return o.id === id;
|
||||||
if (index !== -1) advSearch.child.splice(index, 1);
|
});
|
||||||
|
if (index !== -1) advSearch.child.splice(index, 1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
onUpdateFilters(filters) {
|
||||||
|
this.filters = filters;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user