Merged in feature/PMCORE-3170 (pull request #7993)

PMCORE-3170
This commit is contained in:
Henry Jonathan Quispe Quispe
2021-07-22 20:14:23 +00:00
committed by Rodrigo Quelca
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,7 +43,7 @@
</v-server-table>
<VueCardView
v-if="typeView === 'CARD'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueCardView"
>
<div slot="detail" slot-scope="props">
@@ -100,7 +100,7 @@
</VueCardView>
<VueListView
v-if="typeView === 'LIST'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueListView"
>
<div slot="detail" slot-scope="props">
@@ -461,7 +461,15 @@ export default {
* update view in component
*/
updateView(){
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

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

View File

@@ -53,7 +53,7 @@
</v-server-table>
<VueCardView
v-if="typeView === 'CARD'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueCardView"
>
<div slot="detail" slot-scope="props">
@@ -110,7 +110,7 @@
</VueCardView>
<VueListView
v-if="typeView === 'LIST'"
:options="optionsVueListView"
:options="optionsVueView"
ref="vueListView"
>
<div slot="detail" slot-scope="props">
@@ -484,7 +484,15 @@ export default {
* update view in component
*/
updateView() {
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

@@ -32,8 +32,11 @@ export default {
},
],
},
optionsVueCardView: {
optionsVueView: {
limit: 10,
dblClick:(event, item, options)=>{
this.openCase(item);
},
headings: {
detail: "",
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
@@ -56,40 +59,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);
}
}
}
@@ -101,7 +74,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueCard(data) {
getCases(data) {
let that = this,
dt,
start = 0,
@@ -132,7 +105,7 @@ export default {
/**
* Get cases for Vue Card View
*/
getCasesVueCardViewMore(data) {
getCasesViewMore(data) {
let that = this,
dt,
paged,

View File

@@ -53,7 +53,7 @@
</v-server-table>
<VueCardView
v-if="typeView === 'CARD'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueCardView"
>
<div slot="detail" slot-scope="props">
@@ -110,7 +110,7 @@
</VueCardView>
<VueListView
v-if="typeView === 'LIST'"
:options="optionsVueCardView"
:options="optionsVueView"
ref="vueListView"
>
<div slot="detail" slot-scope="props">
@@ -492,7 +492,15 @@ export default {
* update view in component
*/
updateView(){
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

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

View File

@@ -462,7 +462,15 @@ export default {
* update view in component
*/
updateView(){
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

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