Merged in bugfix/PMCORE-3342 (pull request #8204)

PMCORE-3342

Approved-by: Henry Jonathan Quispe Quispe
This commit is contained in:
Rodrigo Quelca
2021-10-08 14:55:37 +00:00
committed by Julio Cesar Laura Avendaño
6 changed files with 189 additions and 270 deletions

View File

@@ -15,12 +15,6 @@
:column="column"
:headings="options.headings"
></slot>
<slot
name="send_by"
:item="item"
column="send_by"
:headings="options.headings"
></slot>
</b-col>
<b-col sm="3">
<slot
@@ -55,7 +49,6 @@ export default {
};
},
mounted() {
this.filterOptions();
},
methods: {
classBtn(cls) {

View File

@@ -1,35 +1,29 @@
<template>
<div class="pm-vue-list-view" :height="height">
<div class="pm-vue-list-view-container">
<div
class="pm-vue-list-view-body"
:style="{height: height + 'px'}"
>
<vue-list v-for="item in data" :key="item.id" :item="item" :options="options">
<div class="pm-vue-list-view-body" :style="{ height: height + 'px' }">
<vue-list
v-for="item in data"
:key="item.id"
:item="item"
:options="options"
>
<b-row>
<b-col sm="5">
<slot
v-for="column in options.columns"
:name="column"
:item="item"
:column="column"
:headings="options.headings"
ref="containerList"
></slot>
</b-col>
<b-col sm="5">
<slot
name="send_by"
:item="item"
column="send_by"
:headings="options.headings"
></slot>
<b-col sm="10">
<b-row>
<b-col sm="5" v-for="column in options.columns" :key="column">
<slot
:name="column"
:item="item"
:column="column"
:headings="options.headings"
>
</slot>
</b-col>
</b-row>
</b-col>
<b-col sm="2">
<slot
name="actions"
:item="item"
></slot>
<slot name="actions" :item="item"></slot>
</b-col>
</b-row>
</vue-list>
@@ -54,23 +48,14 @@ export default {
props: ["options"],
data() {
return {
loadMore: this.$t("ID_LOAD_MORE")
loadMore: this.$t("ID_LOAD_MORE"),
chunkColumns: [],
};
},
mounted() {
this.filterOptions();
},
mounted() {},
methods: {
classBtn(cls) {
return "btn btn-slim btn-force-radius v-btn-header " + cls;
},
/**
* Filter the column send_by
*/
filterOptions() {
this.options.columns = this.options.columns.filter(function(item) {
return item !== "send_by";
});
}
},
};

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="data.length" class="grouped-cell">
<div v-for="(item, index) in data" v-bind:key="item.TITLE" class="d-flex mb-3">
<div v-for="(item, index) in data" v-bind:key="item.TITLE" class="d-flex">
<div class="avatar" :id="id + index">
<b-avatar
variant="info"

View File

@@ -3,7 +3,7 @@
<div
v-for="(item, index) in data"
v-bind:key = index
class="d-flex mb-3">
class="d-flex">
<div
v-bind:style="{ color: activeColor(item.CODE_COLOR) }"
:id="statusId + index"

File diff suppressed because it is too large Load Diff

View File

@@ -91,48 +91,77 @@ export default {
*/
getCases(data) {
let that = this,
dt,
typeList = that.data.pageParent == "inbox" ? "todo" : that.data.pageParent,
start = 0,
paged,
limit = data.limit,
filters = {},
id = this.data.customListId;
filters = {
paged: paged,
limit: limit,
offset: start,
};
if (_.isEmpty(that.filters) && this.data.settings) {
_.forIn(this.data.settings.filters, function (item, key) {
if (filters && item.value) {
filters[item.filterVar] = item.value;
}
});
} else {
_.forIn(this.filters, function (item, key) {
if (filters && item.value) {
filters[item.filterVar] = item.value;
}
});
}
return new Promise((resolutionFunc, rejectionFunc) => {
api.custom[that.data.pageParent]
({
id,
filters,
})
.then((response) => {
dt = that.formatDataResponse(response.data.data);
resolutionFunc({
data: dt,
count: response.data.total,
dt,
paged,
limit = data.limit,
start = data.page === 1 ? 0 : limit * (data.page - 1),
filters = {},
sort = "",
id = this.data.customListId;
filters = {
paged: paged,
limit: limit,
offset: start,
};
if (_.isEmpty(that.filters) && this.data.settings) {
_.forIn(this.data.settings.filters, function(item, key) {
if (filters && item.value) {
filters[item.filterVar] = item.value;
}
});
} else {
_.forIn(this.filters, function(item, key) {
if (filters && item.value) {
filters[item.filterVar] = item.value;
}
});
}
sort = that.prepareSortString(data);
if (sort) {
filters["sort"] = sort;
}
return new Promise((resolutionFunc, rejectionFunc) => {
api.custom[that.data.pageParent]
({
id,
filters,
})
.then((response) => {
let tmp,
columns = [],
product,
newItems = [];
that.filterItems = [];
response.data.columns.forEach((item) => {
if (item.enableFilter) {
if (that.availableItems[that.itemMap[item.field]]) {
newItems.push(that.availableItems[that.itemMap[item.field]]);
} else {
product = this.filterItemFactory(item)
if (product) {
newItems.push(product);
}
}
}
columns.push(item.field);
});
that.filterItems = newItems;
dt = that.formatDataResponse(response.data.data);
that.cardColumns = columns;
if (that.isFistTime) {
that.filters = that.data.settings && that.data.settings.filters ? that.data.settings.filters : {};
that.columns = that.data.settings && that.data.settings.columns ? that.data.settings.columns : that.getTableColumns(columns);
that.settingOptions = that.formatColumnSettings(columns);
}
resolutionFunc({
data: dt,
count: response.data.total,
});
})
.catch((e) => {
rejectionFunc(e);
});
});
})
.catch((e) => {
rejectionFunc(e);
});
});
},
/**
* Get cases for Vue Card View