PMCORE-3268:Preview does not work in mode edit
Correction ellipsis CR
This commit is contained in:
@@ -58,6 +58,7 @@ export default {
|
|||||||
if (response.statusText === "OK") {
|
if (response.statusText === "OK") {
|
||||||
that.$refs["modal-delete-list"].hide();
|
that.$refs["modal-delete-list"].hide();
|
||||||
that.$parent.$refs["table"].getData();
|
that.$parent.$refs["table"].getData();
|
||||||
|
that.$parent.$refs['ellipsis-' + that.data.id].hideActionButtons();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,14 @@ export default {
|
|||||||
return this.$parent.$parent.$parent.$parent.getCasesForPreview(data)
|
return this.$parent.$parent.$parent.$parent.getCasesForPreview(data)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
customCaseId: '',
|
||||||
|
statusTitle: {
|
||||||
|
ON_TIME: this.$i18n.t("ID_IN_PROGRESS"),
|
||||||
|
OVERDUE: this.$i18n.t("ID_TASK_OVERDUE"),
|
||||||
|
DRAFT: this.$i18n.t("ID_IN_DRAFT"),
|
||||||
|
PAUSED: this.$i18n.t("ID_PAUSED"),
|
||||||
|
UNASSIGNED: this.$i18n.t("ID_UNASSIGNED"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -119,25 +127,19 @@ export default {
|
|||||||
paged,
|
paged,
|
||||||
limit = data.limit,
|
limit = data.limit,
|
||||||
start = data.page === 1 ? 0 : limit * (data.page - 1),
|
start = data.page === 1 ? 0 : limit * (data.page - 1),
|
||||||
filters = {},
|
filters = {};
|
||||||
sort = "";
|
|
||||||
paged = start + "," + limit;
|
paged = start + "," + limit;
|
||||||
filters = {
|
filters = {
|
||||||
paged: paged,
|
paged: paged,
|
||||||
}
|
}
|
||||||
_.forIn(this.filters, function (item, key) {
|
if (this.customCaseId !== '') {
|
||||||
if(filters && item.value) {
|
filters['id'] = this.customCaseId;
|
||||||
filters[item.filterVar] = item.value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (sort) {
|
|
||||||
filters["sort"] = sort;
|
|
||||||
}
|
}
|
||||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||||
switch (that.type) {
|
switch (that.type) {
|
||||||
case 'inbox':
|
case 'inbox':
|
||||||
api.cases
|
api.cases
|
||||||
.todo(filters)
|
.inbox(filters)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
dt = that.formatDataResponse(response.data.data);
|
dt = that.formatDataResponse(response.data.data);
|
||||||
resolutionFunc({
|
resolutionFunc({
|
||||||
@@ -195,39 +197,47 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Format Response API to grid todo and columns
|
* Format Response API custom case list to grid todo and columns
|
||||||
|
* @param {object} response
|
||||||
|
* @returns {object}
|
||||||
*/
|
*/
|
||||||
formatDataResponse(response) {
|
formatDataResponse(response) {
|
||||||
let data = [];
|
let data = [];
|
||||||
_.forEach(response, (v) => {
|
_.forEach(response, (v) => {
|
||||||
data.push({
|
data.push({
|
||||||
CASE_NUMBER: v.APP_NUMBER,
|
...v,
|
||||||
CASE_TITLE: v.DEL_TITLE,
|
...{
|
||||||
PROCESS_NAME: v.PRO_TITLE,
|
CASE_NUMBER: v.APP_NUMBER,
|
||||||
TASK: [{
|
CASE_TITLE: v.DEL_TITLE,
|
||||||
TITLE: v.TAS_TITLE,
|
PROCESS_NAME: v.PRO_TITLE,
|
||||||
CODE_COLOR: v.TAS_COLOR,
|
TASK: [
|
||||||
COLOR: v.TAS_COLOR_LABEL,
|
{
|
||||||
DELAYED_TITLE:
|
TITLE: v.TAS_TITLE,
|
||||||
v.TAS_STATUS === "OVERDUE"
|
CODE_COLOR: v.TAS_COLOR,
|
||||||
? this.$i18n.t("ID_DELAYED") + ":"
|
COLOR: v.TAS_COLOR_LABEL,
|
||||||
: this.statusTitle[v.TAS_STATUS],
|
DELAYED_TITLE:
|
||||||
DELAYED_MSG: v.TAS_STATUS === "OVERDUE" ? v.DELAY : "",
|
v.TAS_STATUS === "OVERDUE"
|
||||||
}],
|
? this.$i18n.t("ID_DELAYED") + ":"
|
||||||
USER_DATA: this.formatUser(v.SEND_BY_INFO),
|
: this.statusTitle[v.TAS_STATUS],
|
||||||
USERNAME_DISPLAY_FORMAT: utils.userNameDisplayFormat({
|
DELAYED_MSG:
|
||||||
userName: v.USR_LASTNAME,
|
v.TAS_STATUS === "OVERDUE" ? v.DELAY : "",
|
||||||
firstName: v.USR_LASTNAME,
|
},
|
||||||
lastName: v.USR_LASTNAME,
|
],
|
||||||
format: window.config.FORMATS.format || null,
|
USER_DATA: this.formatUser(v.SEND_BY_INFO),
|
||||||
}),
|
USERNAME_DISPLAY_FORMAT: utils.userNameDisplayFormat({
|
||||||
DUE_DATE: v.DEL_TASK_DUE_DATE_LABEL,
|
userName: v.USR_LASTNAME,
|
||||||
DELEGATION_DATE: v.DEL_DELEGATE_DATE_LABEL,
|
firstName: v.USR_LASTNAME,
|
||||||
PRIORITY: v.DEL_PRIORITY_LABEL,
|
lastName: v.USR_LASTNAME,
|
||||||
DEL_INDEX: v.DEL_INDEX,
|
format: window.config.FORMATS.format || null,
|
||||||
APP_UID: v.APP_UID,
|
}),
|
||||||
PRO_UID: v.PRO_UID,
|
DUE_DATE: v.DEL_TASK_DUE_DATE_LABEL,
|
||||||
TAS_UID: v.TAS_UID,
|
DELEGATION_DATE: v.DEL_DELEGATE_DATE_LABEL,
|
||||||
|
PRIORITY: v.DEL_PRIORITY_LABEL,
|
||||||
|
DEL_INDEX: v.DEL_INDEX,
|
||||||
|
APP_UID: v.APP_UID,
|
||||||
|
PRO_UID: v.PRO_UID,
|
||||||
|
TAS_UID: v.TAS_UID,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="home">
|
<div id="home">
|
||||||
|
<ModalPreview ref="modal-preview"></ModalPreview>
|
||||||
<div class="demo">
|
<div class="demo">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h5>{{ $t("ID_NEW_CASES_LISTS") }} ({{ module.title }})</h5>
|
<h5>{{ $t("ID_NEW_CASES_LISTS") }} ({{ module.title }})</h5>
|
||||||
@@ -284,7 +285,7 @@
|
|||||||
<b-button tvariant="danger" @click="onCancel">{{
|
<b-button tvariant="danger" @click="onCancel">{{
|
||||||
$t("ID_CANCEL")
|
$t("ID_CANCEL")
|
||||||
}}</b-button>
|
}}</b-button>
|
||||||
<b-button variant="outline-primary">{{
|
<b-button variant="outline-primary" @click="showPreview">{{
|
||||||
$t("ID_PREVIEW")
|
$t("ID_PREVIEW")
|
||||||
}}</b-button>
|
}}</b-button>
|
||||||
<b-button type="submit" variant="primary">{{
|
<b-button type="submit" variant="primary">{{
|
||||||
@@ -301,6 +302,7 @@ import utils from "../../../utils/utils";
|
|||||||
import Multiselect from "vue-multiselect";
|
import Multiselect from "vue-multiselect";
|
||||||
import Api from "./Api/CaseList";
|
import Api from "./Api/CaseList";
|
||||||
import IconPicker from "../../../components/iconPicker/IconPicker.vue";
|
import IconPicker from "../../../components/iconPicker/IconPicker.vue";
|
||||||
|
import ModalPreview from "../../Modals/ModalPreview.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CaseListSketh",
|
name: "CaseListSketh",
|
||||||
@@ -308,6 +310,7 @@ export default {
|
|||||||
Multiselect,
|
Multiselect,
|
||||||
IconPicker,
|
IconPicker,
|
||||||
IconPicker,
|
IconPicker,
|
||||||
|
ModalPreview,
|
||||||
},
|
},
|
||||||
props: ["params", "module"],
|
props: ["params", "module"],
|
||||||
data() {
|
data() {
|
||||||
@@ -370,7 +373,8 @@ export default {
|
|||||||
defaultCaseList: [],
|
defaultCaseList: [],
|
||||||
isValidName: null,
|
isValidName: null,
|
||||||
isValidTable: null,
|
isValidTable: null,
|
||||||
pmTable: null
|
pmTable: null,
|
||||||
|
isPreview: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -603,6 +607,7 @@ export default {
|
|||||||
* On submit event handler
|
* On submit event handler
|
||||||
*/
|
*/
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
let that = this;
|
||||||
this.isValidName = true;
|
this.isValidName = true;
|
||||||
this.isValidTable = true;
|
this.isValidTable = true;
|
||||||
if (!this.params.name) {
|
if (!this.params.name) {
|
||||||
@@ -621,7 +626,15 @@ export default {
|
|||||||
delete this.params["tableName"];
|
delete this.params["tableName"];
|
||||||
Api.updateCaseList(this.params)
|
Api.updateCaseList(this.params)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.$emit("closeSketch");
|
if (that.isPreview) {
|
||||||
|
that.$refs["modal-preview"].columns = that.getColumns();
|
||||||
|
that.$refs["modal-preview"].type = that.params.type;
|
||||||
|
that.$refs["modal-preview"].customCaseId = that.params.id;
|
||||||
|
that.$refs["modal-preview"].show();
|
||||||
|
that.isPreview = false;
|
||||||
|
} else {
|
||||||
|
this.$emit("closeSketch");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.makeToast('danger', this.$i18n.t('ID_ERROR'), err.response.statusText);
|
this.makeToast('danger', this.$i18n.t('ID_ERROR'), err.response.statusText);
|
||||||
@@ -630,8 +643,16 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
Api.createCaseList(this.params)
|
Api.createCaseList(this.params)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.$emit("closeSketch");
|
if (that.isPreview) {
|
||||||
|
that.params.id = response.data.id;
|
||||||
|
that.$refs["modal-preview"].columns = that.getColumns();
|
||||||
|
that.$refs["modal-preview"].type = that.params.type;
|
||||||
|
that.$refs["modal-preview"].customCaseId = that.params.id;
|
||||||
|
that.$refs["modal-preview"].show();
|
||||||
|
that.isPreview = false;
|
||||||
|
} else {
|
||||||
|
this.$emit("closeSketch");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.makeToast('danger',this.$i18n.t('ID_ERROR') ,err.response.statusText);
|
this.makeToast('danger',this.$i18n.t('ID_ERROR') ,err.response.statusText);
|
||||||
@@ -691,6 +712,30 @@ export default {
|
|||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Show modal preview
|
||||||
|
*/
|
||||||
|
showPreview() {
|
||||||
|
this.isPreview = true;
|
||||||
|
this.onSubmit();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get columns to show in the preview
|
||||||
|
*/
|
||||||
|
getColumns() {
|
||||||
|
var columns = [],
|
||||||
|
auxColumn,
|
||||||
|
i;
|
||||||
|
for (i = 0; i < this.dataCaseList.length; i += 1) {
|
||||||
|
auxColumn = this.dataCaseList[i];
|
||||||
|
if (auxColumn.set) {
|
||||||
|
columns.push(auxColumn.field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
columns.push('actions');
|
||||||
|
columns.unshift('detail');
|
||||||
|
return columns
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
>
|
>
|
||||||
<div slot="actions" slot-scope="props">
|
<div slot="actions" slot-scope="props">
|
||||||
<div @click="updateDataEllipsis(props.row)">
|
<div @click="updateDataEllipsis(props.row)">
|
||||||
<ellipsis ref="ellipsis" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
<ellipsis :ref="`ellipsis-${props.row.id}`" v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="owner" slot-scope="props">
|
<div slot="owner" slot-scope="props">
|
||||||
@@ -196,6 +196,7 @@ export default {
|
|||||||
showPreview(data) {
|
showPreview(data) {
|
||||||
this.$refs["modal-preview"].columns = this.getColumns(data);
|
this.$refs["modal-preview"].columns = this.getColumns(data);
|
||||||
this.$refs["modal-preview"].type = data.type;
|
this.$refs["modal-preview"].type = data.type;
|
||||||
|
this.$refs["modal-preview"].customCaseId = data.id;
|
||||||
this.$refs["modal-preview"].show();
|
this.$refs["modal-preview"].show();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -297,7 +298,7 @@ export default {
|
|||||||
that.downloadCaseList(data);
|
that.downloadCaseList(data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pause: {
|
preview: {
|
||||||
name: "preview",
|
name: "preview",
|
||||||
icon: "fas fa-tv",
|
icon: "fas fa-tv",
|
||||||
color: "green",
|
color: "green",
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export let cases = {
|
|||||||
}
|
}
|
||||||
return Api.get({
|
return Api.get({
|
||||||
service,
|
service,
|
||||||
params: data.filters,
|
params: data,
|
||||||
keys
|
keys
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user