-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
- {{ props["headings"][props.column] }} :
- {{ props["item"]["CASE_NUMBER"] }}
-
-
- {{ props["headings"][props.column] }} :
-
- {{ props["item"]["THREAD_TITLE"] }}
-
-
-
- {{ props["headings"][props.column] }} :
- {{ props["item"]["PROCESS_NAME"] }}
-
-
-
- {{ props["headings"][props.column] }} :
-
-
-
-
-
- {{ props["headings"][props.column] }} :
- {{ props["item"]["DUE_DATE"] }}
-
-
-
- {{ props["headings"][props.column] }} :
- {{ props["item"]["DELEGATION_DATE"] }}
-
-
-
- {{ props["headings"][props.column] }} :
- {{ props["item"]["PRIORITY"] }}
-
-
-
-
- {{ props["headings"][props.column] }} :
-
-
-
+
+
+
+
+
+
+
+
+
+ {{ getCustomHeading(column, props) }} :
+
+
+ {{ props["item"]["CASE_NUMBER"] }}
+
+
+ {{ props["item"]["THREAD_TITLE"] }}
+
+
+ {{ props["item"]["PROCESS_NAME"] }}
+
+
+ {{ props["item"]["DUE_DATE"] }}
+
+
+ {{ props["item"]["DELEGATION_DATE"] }}
+
+
+
+
+
+ {{ props["item"]["PRIORITY"] }}
+
+
+
+
+
+ {{ props["item"][column] }}
+
+
+
@@ -705,10 +602,18 @@ export default {
ProcessMaker() {
return window.ProcessMaker;
},
+
},
updated() {},
beforeCreate() {},
methods: {
+ getCustomHeading(column, props) {
+ if (props["headings"] && props["headings"][column]) {
+ return props["headings"][column];
+ } else {
+ return column;
+ }
+ },
/**
* Initialize filters
*/
@@ -842,6 +747,7 @@ export default {
that.filterItems = newItems;
dt = that.formatDataResponse(response.data.data);
that.cardColumns = columns;
+ debugger;
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);
@@ -1070,6 +976,7 @@ export default {
}
this.data.settings = newData.settings;
this.filters = {};
+ this.typeView = newData.settings.view.typeView;
}
if (this.typeView === "GRID" && this.$refs["vueTable"]) {
if (newData.settings && newData.settings.orderBy) {
diff --git a/resources/assets/js/home/CustomCaseList/defaultMixins.js b/resources/assets/js/home/CustomCaseList/defaultMixins.js
index 4816d4bfc..906f98d69 100644
--- a/resources/assets/js/home/CustomCaseList/defaultMixins.js
+++ b/resources/assets/js/home/CustomCaseList/defaultMixins.js
@@ -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