PMCORE-3306: remove sendBy filter in draft list
remove debugger fix code style fix init filters fix advanced search
This commit is contained in:
@@ -20,53 +20,61 @@ export let cases = {
|
|||||||
},
|
},
|
||||||
inbox(data) {
|
inbox(data) {
|
||||||
let service = "INBOX_LIST",
|
let service = "INBOX_LIST",
|
||||||
keys = {};
|
keys = {},
|
||||||
|
params = data;
|
||||||
if (data && data.id) {
|
if (data && data.id) {
|
||||||
service = "INBOX_CUSTOM_LIST";
|
service = "INBOX_CUSTOM_LIST";
|
||||||
keys["id"] = data.id;
|
keys["id"] = data.id;
|
||||||
|
params = data.filters;
|
||||||
}
|
}
|
||||||
return Api.get({
|
return Api.get({
|
||||||
service,
|
service,
|
||||||
params: data,
|
params,
|
||||||
keys
|
keys
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
draft(data) {
|
draft(data) {
|
||||||
let service = "DRAFT_LIST",
|
let service = "DRAFT_LIST",
|
||||||
keys = {};
|
keys = {},
|
||||||
|
params = data;
|
||||||
if (data && data.id) {
|
if (data && data.id) {
|
||||||
service = "DRAFT_CUSTOM_LIST";
|
service = "DRAFT_CUSTOM_LIST";
|
||||||
keys["id"] = data.id;
|
keys["id"] = data.id;
|
||||||
|
params = data.filters;
|
||||||
}
|
}
|
||||||
return Api.get({
|
return Api.get({
|
||||||
service,
|
service,
|
||||||
params: data,
|
params,
|
||||||
keys
|
keys
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
paused(data) {
|
paused(data) {
|
||||||
let service = "PAUSED_LIST",
|
let service = "PAUSED_LIST",
|
||||||
keys = {};
|
keys = {},
|
||||||
|
params = data;
|
||||||
if (data && data.id) {
|
if (data && data.id) {
|
||||||
service = "PAUSED_CUSTOM_LIST";
|
service = "PAUSED_CUSTOM_LIST";
|
||||||
keys["id"] = data.id;
|
keys["id"] = data.id;
|
||||||
|
params = data.filters;
|
||||||
}
|
}
|
||||||
return Api.get({
|
return Api.get({
|
||||||
service,
|
service,
|
||||||
params: data,
|
params,
|
||||||
keys
|
keys
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
unassigned(data) {
|
unassigned(data) {
|
||||||
let service = "UNASSIGNED_LIST",
|
let service = "UNASSIGNED_LIST",
|
||||||
keys = {};
|
keys = {},
|
||||||
|
params = data;
|
||||||
if (data && data.id) {
|
if (data && data.id) {
|
||||||
service = "UNASSIGNED_CUSTOM_LIST";
|
service = "UNASSIGNED_CUSTOM_LIST";
|
||||||
keys["id"] = data.id;
|
keys["id"] = data.id;
|
||||||
|
params = data.filters;
|
||||||
}
|
}
|
||||||
return Api.get({
|
return Api.get({
|
||||||
service,
|
service,
|
||||||
params: data,
|
params,
|
||||||
keys
|
keys
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<b-form-group>
|
<b-form-group>
|
||||||
<b-form-radio-group
|
<b-form-radio-group
|
||||||
v-model="selected"
|
v-model="selected"
|
||||||
:options="filterItems"
|
:options="criteriaItems"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
text-field="optionLabel"
|
text-field="optionLabel"
|
||||||
name="flavour-2a"
|
name="flavour-2a"
|
||||||
@@ -90,7 +90,7 @@ import api from "./../../api/index";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Cases",
|
name: "Cases",
|
||||||
props: ["filters", "title", "icon"],
|
props: ["filters", "title", "icon" , "hiddenItems"],
|
||||||
components: {
|
components: {
|
||||||
SearchPopover,
|
SearchPopover,
|
||||||
CaseNumber,
|
CaseNumber,
|
||||||
@@ -245,17 +245,26 @@ export default {
|
|||||||
byProcessName: ""
|
byProcessName: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
computed: {
|
||||||
// Force to load filters when mounted the component
|
// a computed getter
|
||||||
let fils= this.filters;
|
criteriaItems: function () {
|
||||||
if(_.isArray(this.filters)){
|
let found,
|
||||||
_.forEach(fils,(o)=>{
|
criteria = [];
|
||||||
o.autoShow = false;
|
if (this.hiddenItems && this.hiddenItems.length) {
|
||||||
});
|
this.filterItems.forEach(item => {
|
||||||
this.setFilters(fils);
|
found = this.hiddenItems.find( elem => elem !== item.id);
|
||||||
this.dataLoaded = true;
|
if (found) {
|
||||||
|
criteria.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return criteria;
|
||||||
|
} else {
|
||||||
|
return this.filterItems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
filters: {
|
filters: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
@@ -263,7 +272,7 @@ export default {
|
|||||||
this.searchTags = [];
|
this.searchTags = [];
|
||||||
this.selected = [];
|
this.selected = [];
|
||||||
//Prevent show popover at the first time
|
//Prevent show popover at the first time
|
||||||
if (newVal.length && this.dataLoaded) {
|
if (newVal.length) {
|
||||||
this.setFilters(newVal, oldVal);
|
this.setFilters(newVal, oldVal);
|
||||||
this.searchClickHandler();
|
this.searchClickHandler();
|
||||||
}
|
}
|
||||||
@@ -313,7 +322,8 @@ export default {
|
|||||||
fieldId: id,
|
fieldId: id,
|
||||||
value: '',
|
value: '',
|
||||||
label: "",
|
label: "",
|
||||||
options: []
|
options: [],
|
||||||
|
autoShow: true
|
||||||
};
|
};
|
||||||
initialFilters.push(item);
|
initialFilters.push(item);
|
||||||
}
|
}
|
||||||
@@ -332,12 +342,9 @@ export default {
|
|||||||
});
|
});
|
||||||
if (component) {
|
if (component) {
|
||||||
self.searchTags.push(component.id);
|
self.searchTags.push(component.id);
|
||||||
self.selected.push(component.id);
|
self.selected = component.id;
|
||||||
self.itemModel[component.id] = component;
|
self.itemModel[component.id] = component;
|
||||||
self.itemModel[component.id].autoShow = typeof item.autoShow !== "undefined" ? item.autoShow : true;
|
self.itemModel[component.id].autoShow = typeof item.autoShow !== "undefined" ? item.autoShow : true;
|
||||||
if (oldVal && !oldVal.length) {
|
|
||||||
self.updateSearchTag(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(item.fieldId === "processName") {
|
if(item.fieldId === "processName") {
|
||||||
self.searchTags.push(self.processName.id);
|
self.searchTags.push(self.processName.id);
|
||||||
|
|||||||
@@ -504,16 +504,7 @@ export default {
|
|||||||
id: this.data.customListId
|
id: this.data.customListId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
filters: function(val) {
|
|
||||||
this.$emit("updateSettings", {
|
|
||||||
data: val,
|
|
||||||
key: "filters",
|
|
||||||
parent: this.data.pageParent,
|
|
||||||
type: "custom",
|
|
||||||
id: this.data.customListId
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
@@ -778,8 +769,37 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onRemoveFilter(data) {},
|
onRemoveFilter(data) {},
|
||||||
|
/**
|
||||||
|
* Prepare the data to be updated
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
|
prepareAndUpdate(data) {
|
||||||
|
let canUpdate = false,
|
||||||
|
newFilters = [];
|
||||||
|
data.params.forEach(item => {
|
||||||
|
const container = {...item};
|
||||||
|
container.autoShow = false;
|
||||||
|
if (item.value !== "") {
|
||||||
|
newFilters.push(container);
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (data.params.length == 0) {
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
if (canUpdate) {
|
||||||
|
this.$emit("updateSettings", {
|
||||||
|
data: newFilters,
|
||||||
|
key: "filters",
|
||||||
|
parent: this.data.pageParent,
|
||||||
|
type: "custom",
|
||||||
|
id: this.data.customListId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
onUpdateFilters(data) {
|
onUpdateFilters(data) {
|
||||||
this.filters = data.params;
|
this.filters = data.params;
|
||||||
|
this.prepareAndUpdate(data);
|
||||||
if (data.refresh) {
|
if (data.refresh) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.typeView === "GRID") {
|
if (this.typeView === "GRID") {
|
||||||
@@ -801,7 +821,7 @@ export default {
|
|||||||
this.isFistTime = true;
|
this.isFistTime = true;
|
||||||
this.typeView = "GRID";
|
this.typeView = "GRID";
|
||||||
// force to update component id
|
// force to update component id
|
||||||
if (newData){
|
if (newData) {
|
||||||
if(newData.customListId) {
|
if(newData.customListId) {
|
||||||
this.data.customListId = newData.customListId;
|
this.data.customListId = newData.customListId;
|
||||||
}
|
}
|
||||||
@@ -810,6 +830,7 @@ export default {
|
|||||||
icon: newData.pageIcon,
|
icon: newData.pageIcon,
|
||||||
color: newData.color
|
color: newData.color
|
||||||
}
|
}
|
||||||
|
this.filters = newData.settings && newData.settings.filters ? newData.settings.filters : {};
|
||||||
}
|
}
|
||||||
if (this.typeView === "GRID" && this.$refs["vueTable"]) {
|
if (this.typeView === "GRID" && this.$refs["vueTable"]) {
|
||||||
this.$refs["vueTable"].getData();
|
this.$refs["vueTable"].getData();
|
||||||
|
|||||||
@@ -112,15 +112,14 @@ export default {
|
|||||||
getCasesViewMore(data) {
|
getCasesViewMore(data) {
|
||||||
let that = this,
|
let that = this,
|
||||||
dt,
|
dt,
|
||||||
paged,
|
|
||||||
typeList = that.data.pageParent == "inbox"? "todo": that.data.pageParent,
|
typeList = that.data.pageParent == "inbox"? "todo": that.data.pageParent,
|
||||||
limit = data.limit,
|
limit = data.limit,
|
||||||
start = data.page === 1 ? 0 : limit * (data.page - 1),
|
start = data.page === 1 ? 0 : limit * (data.page - 1),
|
||||||
filters = {};
|
filters = {};
|
||||||
paged = start + "," + limit;
|
|
||||||
|
|
||||||
filters = {
|
filters = {
|
||||||
paged: paged,
|
limit: limit,
|
||||||
|
offset: start
|
||||||
};
|
};
|
||||||
_.forIn(this.filters, function (item, key) {
|
_.forIn(this.filters, function (item, key) {
|
||||||
if (filters && item.value) {
|
if (filters && item.value) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
:filters="filters"
|
:filters="filters"
|
||||||
:title="$t('ID_DRAFT')"
|
:title="$t('ID_DRAFT')"
|
||||||
:icon="icon"
|
:icon="icon"
|
||||||
|
:hiddenItems="hiddenItems"
|
||||||
@onRemoveFilter="onRemoveFilter"
|
@onRemoveFilter="onRemoveFilter"
|
||||||
@onUpdateFilters="onUpdateFilters"
|
@onUpdateFilters="onUpdateFilters"
|
||||||
/>
|
/>
|
||||||
@@ -303,7 +304,8 @@ export default {
|
|||||||
buttons: {}
|
buttons: {}
|
||||||
},
|
},
|
||||||
showEllipsis: false,
|
showEllipsis: false,
|
||||||
dataSubtitle: null
|
dataSubtitle: null,
|
||||||
|
hiddenItems: ['bySendBy']
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -332,16 +334,7 @@ export default {
|
|||||||
type: "normal",
|
type: "normal",
|
||||||
id: this.id
|
id: this.id
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
filters: function (val) {
|
|
||||||
this.$emit("updateSettings", {
|
|
||||||
data: val,
|
|
||||||
key: "filters",
|
|
||||||
parent: this.page,
|
|
||||||
type: "normal",
|
|
||||||
id: this.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
@@ -540,8 +533,41 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onRemoveFilter(data) {},
|
onRemoveFilter(data) {},
|
||||||
|
/**
|
||||||
|
* Prepare the data to be updated
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
|
prepareAndUpdate(data) {
|
||||||
|
let canUpdate = false,
|
||||||
|
newFilters = [];
|
||||||
|
data.params.forEach(item => {
|
||||||
|
const container = {...item};
|
||||||
|
container.autoShow = false;
|
||||||
|
if (item.value !== "") {
|
||||||
|
newFilters.push(container);
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (data.params.length == 0) {
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
if (canUpdate) {
|
||||||
|
this.$emit("updateSettings", {
|
||||||
|
data: newFilters,
|
||||||
|
key: "filters",
|
||||||
|
parent: this.page,
|
||||||
|
type: "normal",
|
||||||
|
id: this.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update event handler
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
onUpdateFilters(data) {
|
onUpdateFilters(data) {
|
||||||
this.filters = data.params;
|
this.filters = data.params;
|
||||||
|
this.prepareAndUpdate(data);
|
||||||
if (data.refresh) {
|
if (data.refresh) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.typeView === "GRID") {
|
if (this.typeView === "GRID") {
|
||||||
|
|||||||
@@ -396,19 +396,21 @@ export default {
|
|||||||
this.settings = this.config.setting[this.page];
|
this.settings = this.config.setting[this.page];
|
||||||
if (!this.menuMap[item.item.id]) {
|
if (!this.menuMap[item.item.id]) {
|
||||||
this.page = "custom-case-list";
|
this.page = "custom-case-list";
|
||||||
|
if (this.config.setting[item.item.page] && this.config.setting[item.item.page]["customCaseList"]) {
|
||||||
|
this.settings = this.config.setting[item.item.page]["customCaseList"][item.item.id];
|
||||||
|
} else {
|
||||||
|
this.settings = {};
|
||||||
|
}
|
||||||
this.pageData = {
|
this.pageData = {
|
||||||
pageUri: item.item.pageUri,
|
pageUri: item.item.pageUri,
|
||||||
pageParent: item.item.page,
|
pageParent: item.item.page,
|
||||||
pageName: item.item.title,
|
pageName: item.item.title,
|
||||||
pageIcon: item.item.icon,
|
pageIcon: item.item.icon,
|
||||||
customListId: item.item.id,
|
customListId: item.item.id,
|
||||||
color: item.item.colorScreen
|
color: item.item.colorScreen,
|
||||||
}
|
settings: this.settings
|
||||||
if (this.config.setting[item.item.page] && this.config.setting[item.item.page]["customCaseList"]) {
|
|
||||||
this.settings = this.config.setting[item.item.page]["customCaseList"][item.item.id];
|
|
||||||
} else {
|
|
||||||
this.settings = {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (this.page === this.lastPage
|
if (this.page === this.lastPage
|
||||||
&& this.$refs["component"]
|
&& this.$refs["component"]
|
||||||
|
|||||||
@@ -376,16 +376,7 @@ export default {
|
|||||||
type: "normal",
|
type: "normal",
|
||||||
id: this.id
|
id: this.id
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
filters: function (val) {
|
|
||||||
this.$emit("updateSettings", {
|
|
||||||
data: val,
|
|
||||||
key: "filters",
|
|
||||||
parent: this.page,
|
|
||||||
type: "normal",
|
|
||||||
id: this.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
@@ -621,8 +612,41 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onRemoveFilter(data) {},
|
onRemoveFilter(data) {},
|
||||||
|
/**
|
||||||
|
* Prepare the data to be updated
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
|
prepareAndUpdate(data) {
|
||||||
|
let canUpdate = false,
|
||||||
|
newFilters = [];
|
||||||
|
data.params.forEach(item => {
|
||||||
|
const container = {...item};
|
||||||
|
container.autoShow = false;
|
||||||
|
if (item.value !== "") {
|
||||||
|
newFilters.push(container);
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (data.params.length == 0) {
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
if (canUpdate) {
|
||||||
|
this.$emit("updateSettings", {
|
||||||
|
data: newFilters,
|
||||||
|
key: "filters",
|
||||||
|
parent: this.page,
|
||||||
|
type: "normal",
|
||||||
|
id: this.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update event handler
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
onUpdateFilters(data) {
|
onUpdateFilters(data) {
|
||||||
this.filters = data.params;
|
this.filters = data.params;
|
||||||
|
this.prepareAndUpdate(data);
|
||||||
if (data.refresh) {
|
if (data.refresh) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.typeView === "GRID") {
|
if (this.typeView === "GRID") {
|
||||||
|
|||||||
@@ -251,16 +251,7 @@ export default {
|
|||||||
type: "normal",
|
type: "normal",
|
||||||
id: this.id
|
id: this.id
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
filters: function (val) {
|
|
||||||
this.$emit("updateSettings", {
|
|
||||||
data: val,
|
|
||||||
key: "filters",
|
|
||||||
parent: this.page,
|
|
||||||
type: "normal",
|
|
||||||
id: this.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
@@ -666,8 +657,37 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onRemoveFilter(data) {},
|
onRemoveFilter(data) {},
|
||||||
|
/**
|
||||||
|
* Prepare the data to be updated
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
|
prepareAndUpdate(data) {
|
||||||
|
let canUpdate = false,
|
||||||
|
newFilters = [];
|
||||||
|
data.params.forEach(item => {
|
||||||
|
const container = {...item};
|
||||||
|
container.autoShow = false;
|
||||||
|
if (item.value !== "") {
|
||||||
|
newFilters.push(container);
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (data.params.length == 0) {
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
if (canUpdate) {
|
||||||
|
this.$emit("updateSettings", {
|
||||||
|
data: newFilters,
|
||||||
|
key: "filters",
|
||||||
|
parent: this.page,
|
||||||
|
type: "normal",
|
||||||
|
id: this.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
onUpdateFilters(data) {
|
onUpdateFilters(data) {
|
||||||
this.filters = data.params;
|
this.filters = data.params;
|
||||||
|
this.prepareAndUpdate(data);
|
||||||
if (data.refresh) {
|
if (data.refresh) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs["vueTable"].getData();
|
this.$refs["vueTable"].getData();
|
||||||
|
|||||||
@@ -375,16 +375,7 @@ export default {
|
|||||||
type: "normal",
|
type: "normal",
|
||||||
id: this.id
|
id: this.id
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
filters: function (val) {
|
|
||||||
this.$emit("updateSettings", {
|
|
||||||
data: val,
|
|
||||||
key: "filters",
|
|
||||||
parent: this.page,
|
|
||||||
type: "normal",
|
|
||||||
id: this.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
@@ -619,8 +610,41 @@ export default {
|
|||||||
this.$refs["modal-unpause-case"].show();
|
this.$refs["modal-unpause-case"].show();
|
||||||
},
|
},
|
||||||
onRemoveFilter(data) {},
|
onRemoveFilter(data) {},
|
||||||
|
/**
|
||||||
|
* Prepare the data to be updated
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
|
prepareAndUpdate(data) {
|
||||||
|
let canUpdate = false,
|
||||||
|
newFilters = [];
|
||||||
|
data.params.forEach(item => {
|
||||||
|
const container = {...item};
|
||||||
|
container.autoShow = false;
|
||||||
|
if (item.value !== "") {
|
||||||
|
newFilters.push(container);
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (data.params.length == 0) {
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
if (canUpdate) {
|
||||||
|
this.$emit("updateSettings", {
|
||||||
|
data: newFilters,
|
||||||
|
key: "filters",
|
||||||
|
parent: this.page,
|
||||||
|
type: "normal",
|
||||||
|
id: this.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update event handler
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
onUpdateFilters(data) {
|
onUpdateFilters(data) {
|
||||||
this.filters = data.params;
|
this.filters = data.params;
|
||||||
|
this.prepareAndUpdate(data);
|
||||||
if (data.refresh) {
|
if (data.refresh) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.typeView === "GRID") {
|
if (this.typeView === "GRID") {
|
||||||
|
|||||||
@@ -367,16 +367,7 @@ export default {
|
|||||||
type: "normal",
|
type: "normal",
|
||||||
id: this.id
|
id: this.id
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
filters: function (val) {
|
|
||||||
this.$emit("updateSettings", {
|
|
||||||
data: val,
|
|
||||||
key: "filters",
|
|
||||||
parent: this.page,
|
|
||||||
type: "normal",
|
|
||||||
id: this.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
@@ -589,10 +580,41 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onRemoveFilter(data) {},
|
onRemoveFilter(data) {},
|
||||||
|
/**
|
||||||
|
* Prepare the data to be updated
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
|
prepareAndUpdate(data) {
|
||||||
|
let canUpdate = false,
|
||||||
|
newFilters = [];
|
||||||
|
data.params.forEach(item => {
|
||||||
|
const container = {...item};
|
||||||
|
container.autoShow = false;
|
||||||
|
if (item.value !== "") {
|
||||||
|
newFilters.push(container);
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (data.params.length == 0) {
|
||||||
|
canUpdate = true;
|
||||||
|
}
|
||||||
|
if (canUpdate) {
|
||||||
|
this.$emit("updateSettings", {
|
||||||
|
data: newFilters,
|
||||||
|
key: "filters",
|
||||||
|
parent: this.page,
|
||||||
|
type: "normal",
|
||||||
|
id: this.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update event handler
|
||||||
|
* @param {object} data
|
||||||
|
*/
|
||||||
onUpdateFilters(data) {
|
onUpdateFilters(data) {
|
||||||
if (data.params) {
|
this.filters = data.params;
|
||||||
this.filters = data.params;
|
this.prepareAndUpdate(data);
|
||||||
}
|
|
||||||
if (data.refresh) {
|
if (data.refresh) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.typeView === "GRID") {
|
if (this.typeView === "GRID") {
|
||||||
|
|||||||
Reference in New Issue
Block a user