Merged feature/PMCORE-3049 into feature/PMCORE-3062-A

This commit is contained in:
Henry Jonathan Quispe Quispe
2021-07-22 21:46:43 +00:00
12 changed files with 88 additions and 62 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="pm-vue-card">
<div class="card pm-vue-card-inside" style="width: 20rem">
<div class="card pm-vue-card-inside" style="width: 20rem" @dblclick="dblClick">
<div class="card-body">
<slot> </slot>
</div>
@@ -11,7 +11,7 @@
<script>
export default {
name: "VueCardView",
props: ["columns", "item"],
props: ["options", "item"],
data() {
return {};
},
@@ -19,6 +19,12 @@ export default {
classBtn(cls) {
return "btn btn-slim btn-force-radius v-btn-header " + cls;
},
/**
* Event handler dbl click
*/
dblClick(event){
this.options.dblClick(event, this.item, this.options);
}
},
};
</script>

View File

@@ -5,7 +5,7 @@
class="pm-vue-card-view-body"
:style="{height: height + 'px'}"
>
<vue-card v-for="item in data" :key="item.id">
<vue-card v-for="item in data" :key="item.id" :item="item" :options="options">
<slot
v-for="column in options.columns"
:name="column"

View File

@@ -1,6 +1,6 @@
<template>
<div class="pm-vue-list">
<div class="card pm-vue-list-inside">
<div class="card pm-vue-list-inside" @dblclick.prevent="dblClick">
<div class="card-body">
<slot> </slot>
</div>
@@ -11,7 +11,7 @@
<script>
export default {
name: "VueCardView",
props: ["columns", "item"],
props: ["item","options"],
data() {
return {};
},
@@ -19,6 +19,12 @@ export default {
classBtn(cls) {
return "btn btn-slim btn-force-radius v-btn-header " + cls;
},
/**
* Event handler dbl click
*/
dblClick(event){
this.options.dblClick(event, this.item, this.options);
}
},
};
</script>

View File

@@ -5,7 +5,7 @@
class="pm-vue-list-view-body"
:style="{height: height + 'px'}"
>
<vue-list v-for="item in data" :key="item.id">
<vue-list v-for="item in data" :key="item.id" :item="item" :options="options">
<slot
v-for="column in options.columns"
:name="column"

View File

@@ -43,9 +43,9 @@
</div>
</div>
</v-server-table>
<VueCardView
<VueCardView
v-if="typeView === 'CARD'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueCardView"
>
<div slot="detail" slot-scope="props">
@@ -102,7 +102,7 @@
</VueCardView>
<VueListView
v-if="typeView === 'LIST'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueListView"
>
<div slot="detail" slot-scope="props">
@@ -475,7 +475,15 @@ export default {
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
if (this.typeView === "GRID") {
this.$refs["vueTable"].getData();
}
if (this.typeView === "CARD") {
this.$refs["vueCardView"].getData();
}
if (this.typeView === "LIST") {
this.$refs["vueListView"].getData();
}
},
/**
* Show options in the ellipsis

View File

@@ -33,8 +33,11 @@ export default {
},
],
},
optionsVueCardView: {
optionsVueView: {
limit: 10,
dblClick:(event, item, options)=>{
this.openCase(item);
},
headings: {
detail: "",
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
@@ -57,10 +60,10 @@ export default {
"task"
],
requestFunction(data) {
return that.getCasesVueList(data);
return that.getCases(data);
},
requestFunctionViewMore(data) {
return that.getCasesVueListViewMore(data);
return that.getCasesViewMore(data);
}
}
}
@@ -72,7 +75,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueList(data) {
getCases(data) {
let that = this,
dt,
start = 0,
@@ -105,7 +108,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueListViewMore(data) {
getCasesViewMore(data) {
let that = this,
dt,
paged,

View File

@@ -55,7 +55,7 @@
</v-server-table>
<VueCardView
v-if="typeView === 'CARD'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueCardView"
>
<div slot="detail" slot-scope="props">
@@ -112,7 +112,7 @@
</VueCardView>
<VueListView
v-if="typeView === 'LIST'"
:options="optionsVueListView"
:options="optionsVueView"
ref="vueListView"
>
<div slot="detail" slot-scope="props">
@@ -497,7 +497,15 @@ export default {
* update view in component
*/
updateView() {
this.$refs["vueTable"].getData();
if (this.typeView === "GRID") {
this.$refs["vueTable"].getData();
}
if (this.typeView === "CARD") {
this.$refs["vueCardView"].getData();
}
if (this.typeView === "LIST") {
this.$refs["vueListView"].getData();
}
},
},
};

View File

@@ -34,8 +34,11 @@ export default {
},
],
},
optionsVueCardView: {
optionsVueView: {
limit: 10,
dblClick:(event, item, options)=>{
this.openCase(item);
},
headings: {
detail: "",
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
@@ -58,40 +61,10 @@ export default {
"task"
],
requestFunction(data) {
return that.getCasesVueCard(data);
return that.getCases(data);
},
requestFunctionViewMore(data) {
return that.getCasesVueCardViewMore(data);
}
},
optionsVueListView: {
limit: 10,
headings: {
detail: "",
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
case_title: this.$i18n.t("ID_CASE_TITLE"),
process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"),
current_user: this.$i18n.t("ID_CURRENT_USER"),
due_date: this.$i18n.t("ID_DUE_DATE"),
delegation_date: this.$i18n.t("ID_DELEGATION_DATE"),
priority: this.$i18n.t("ID_PRIORITY")
},
columns: [
"detail",
"case_number",
"case_title",
"process_name",
"due_date",
"delegation_date",
"priority",
"task"
],
requestFunction(data) {
return that.getCasesVueCard(data);
},
requestFunctionViewMore(data) {
return that.getCasesVueCardViewMore(data);
return that.getCasesViewMore(data);
}
}
}
@@ -103,7 +76,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueCard(data) {
getCases(data) {
let that = this,
dt,
start = 0,
@@ -134,7 +107,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueCardViewMore(data) {
getCasesViewMore(data) {
let that = this,
dt,
paged,

View File

@@ -55,7 +55,7 @@
</v-server-table>
<VueCardView
v-if="typeView === 'CARD'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueCardView"
>
<div slot="detail" slot-scope="props">
@@ -112,7 +112,7 @@
</VueCardView>
<VueListView
v-if="typeView === 'LIST'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueListView"
>
<div slot="detail" slot-scope="props">
@@ -505,7 +505,15 @@ export default {
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
if (this.typeView === "GRID") {
this.$refs["vueTable"].getData();
}
if (this.typeView === "CARD") {
this.$refs["vueCardView"].getData();
}
if (this.typeView === "LIST") {
this.$refs["vueListView"].getData();
}
},
/**
* Show options in the ellipsis

View File

@@ -33,8 +33,11 @@ export default {
},
],
},
optionsVueCardView: {
optionsVueView: {
limit: 10,
dblClick:(event, item, options)=>{
this.openCase(item);
},
headings: {
detail: "",
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
@@ -57,10 +60,10 @@ export default {
"task"
],
requestFunction(data) {
return that.getCasesVueList(data);
return that.getCases(data);
},
requestFunctionViewMore(data) {
return that.getCasesVueListViewMore(data);
return that.getCasesViewMore(data);
}
}
}
@@ -72,7 +75,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueList(data) {
getCases(data) {
let that = this,
dt,
start = 0,
@@ -105,7 +108,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueListViewMore(data) {
getCasesViewMore(data) {
let that = this,
dt,
paged,

View File

@@ -475,7 +475,15 @@ export default {
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
if (this.typeView === "GRID") {
this.$refs["vueTable"].getData();
}
if (this.typeView === "CARD") {
this.$refs["vueCardView"].getData();
}
if (this.typeView === "LIST") {
this.$refs["vueListView"].getData();
}
},
/**
* set data by default in the ellipsis component

View File

@@ -35,6 +35,9 @@ export default {
},
optionsVueList: {
limit: 10,
dblClick:(event, item, options)=>{
this.openCase(item);
},
headings: {
detail: "",
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),