diff --git a/resources/assets/js/components/dataViews/vueCardView/VueCardView.vue b/resources/assets/js/components/dataViews/vueCardView/VueCardView.vue index 19ca3480c..e9410815d 100644 --- a/resources/assets/js/components/dataViews/vueCardView/VueCardView.vue +++ b/resources/assets/js/components/dataViews/vueCardView/VueCardView.vue @@ -15,12 +15,12 @@ :column="column" :headings="options.headings" > - + > --> - --> + @@ -54,13 +62,23 @@ export default { props: ["options"], data() { return { - loadMore: this.$t("ID_LOAD_MORE") + loadMore: this.$t("ID_LOAD_MORE"), + chunkColumns: [] }; }, mounted() { - this.filterOptions(); + this.chunkColumns = this.chunkArray(this.options.columns, 2); + debugger }, methods: { + chunkArray(array, size) { + let result = [], + arrayCopy = [...array]; + while (arrayCopy.length > 0) { + result.push(arrayCopy.splice(0, size)); + } + return result; + }, classBtn(cls) { return "btn btn-slim btn-force-radius v-btn-header " + cls; }, diff --git a/resources/assets/js/home/CustomCaseList/CustomCaseList.vue b/resources/assets/js/home/CustomCaseList/CustomCaseList.vue index 1b6a0cda8..3278ab2d9 100644 --- a/resources/assets/js/home/CustomCaseList/CustomCaseList.vue +++ b/resources/assets/js/home/CustomCaseList/CustomCaseList.vue @@ -110,197 +110,94 @@ -
- {{ 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["item"]["DUE_DATE"] }} - -
-
- {{ props["headings"][props.column] }} : - {{ props["item"]["DELEGATION_DATE"] }} - -
-
- {{ props["headings"][props.column] }} : - - - -
-
- {{ props["headings"][props.column] }} : - {{ props["item"]["PRIORITY"] }} - -
-
- {{ props["headings"][props.column] }} : - - - -
+ - -
- - -
- -
-
- -
- - -
-
-
+
+ + +
+
- - {{ 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] }} : - - - + +
+ +
+
+
+ @@ -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