PMCORE-3366

This commit is contained in:
Henry Jordan
2021-09-24 20:17:56 +00:00
parent f24611127e
commit c353ef77f8
7 changed files with 144 additions and 56 deletions

View File

@@ -6,13 +6,15 @@
:key="item.label" :key="item.label"
:class="item.classObject" :class="item.classObject"
> >
<span v-if="item.data.color"> <span @click="item.onClick">
<div <span v-if="item.color">
class="vp-color-breadcrumb" <div
:style="{ backgroundColor: item.data.color }" class="vp-color-breadcrumb"
></div :style="{ backgroundColor: item.color }"
></span> ></div
<span>{{ item.label }}</span> ></span>
<span>{{ item.label }}</span>
</span>
</li> </li>
<div <div
v-for="item in settings" v-for="item in settings"
@@ -47,19 +49,11 @@ export default {
formatOptions(data) { formatOptions(data) {
let options = data; let options = data;
for (let i = 0; i <= options.length - 1; i++) { for (let i = 0; i <= options.length - 1; i++) {
if (i === options.length - 1) { options[i].classObject = {
options[i].classObject = { "vp-breadcrumb-item": true,
"vp-breadcrumb-item": true, active: false,
active: true, "vp-inline-block": true,
"vp-inline-block": true, };
};
} else {
options[i].classObject = {
"vp-breadcrumb-item": true,
active: false,
"vp-inline-block": true,
};
}
} }
return options; return options;
}, },

View File

@@ -4,7 +4,7 @@ export default {
data() { data() {
let that = this; let that = this;
return { return {
typeView: this.settings.view && this.settings.view.typeView typeView: this.settings && this.settings.view && this.settings.view.typeView
? this.settings.view.typeView ? this.settings.view.typeView
: "GRID", : "GRID",
random: 1, random: 1,

View File

@@ -6,7 +6,7 @@
</h6> </h6>
<div> <div>
<BreadCrumb <BreadCrumb
:options="breadCrumbs.data" :options="dataBreadcrumbs()"
:settings="settingsBreadcrumbs" :settings="settingsBreadcrumbs"
/> />
<ProcessPopover <ProcessPopover
@@ -28,7 +28,9 @@
@select="changeOption" @select="changeOption"
></multiselect> ></multiselect>
</div> </div>
<label class="vp-inline-block vp-padding-l20">{{ $t("ID_TOP10") }}</label> <label class="vp-inline-block vp-padding-l20">{{
$t("ID_TOP10")
}}</label>
<div class="vp-inline-block"> <div class="vp-inline-block">
<b-form-checkbox <b-form-checkbox
v-model="top" v-model="top"
@@ -104,7 +106,7 @@ export default {
BreadCrumb, BreadCrumb,
ProcessPopover, ProcessPopover,
}, },
props: ["data", "breadCrumbs"], props: ["data"],
data() { data() {
let that = this; let that = this;
return { return {
@@ -289,7 +291,7 @@ export default {
.then((response) => { .then((response) => {
that.totalCases = response.data; that.totalCases = response.data;
that.formatTotalCases(response.data); that.formatTotalCases(response.data);
}) })
.catch((e) => { .catch((e) => {
console.error(err); console.error(err);
}); });
@@ -429,6 +431,20 @@ export default {
}); });
eventBus.$emit("home::sidebar::click-item", taskList); eventBus.$emit("home::sidebar::click-item", taskList);
}, },
/**
* Return the breadcrumbs
*/
dataBreadcrumbs() {
let res = [];
if (this.data[1]) {
res.push({
label: this.data[1]["name"],
onClick() {},
color: this.data[1]["color"],
});
}
return res;
},
}, },
}; };
</script> </script>

View File

@@ -1,10 +1,10 @@
<template> <template>
<div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block"> <div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block">
<div class="p-1 v-flex"> <div class="p-1 v-flex">
<h6 class="v-search-title">{{$t("ID_DRILL_DOWN_RISK_MATRIX")}}</h6> <h6 class="v-search-title">{{ $t("ID_DRILL_DOWN_RISK_MATRIX") }}</h6>
<div> <div>
<BreadCrumb <BreadCrumb
:options="breadCrumbs.data" :options="dataBreadcrumbs()"
:settings="settingsBreadcrumbs" :settings="settingsBreadcrumbs"
/> />
<div class="vp-width-p30 vp-inline-block"> <div class="vp-width-p30 vp-inline-block">
@@ -36,9 +36,7 @@
></b-form-datepicker> ></b-form-datepicker>
</div> </div>
<div class="vp-inline-block"> <div class="vp-inline-block">
<label class="form-label">{{ <label class="form-label">{{ $t("ID_TOP") }}</label>
$t("ID_TOP")
}}</label>
</div> </div>
<div class="vp-inline-block"> <div class="vp-inline-block">
<multiselect <multiselect
@@ -298,7 +296,7 @@ export default {
this.$refs["LevelThreeChart"].updateOptions({ this.$refs["LevelThreeChart"].updateOptions({
yaxis: { yaxis: {
max: 0, max: 0,
tickAmount: 7 tickAmount: 7,
}, },
title: { title: {
text: "Days before being Overdue", text: "Days before being Overdue",
@@ -309,7 +307,7 @@ export default {
this.$refs["LevelThreeChart"].updateOptions({ this.$refs["LevelThreeChart"].updateOptions({
yaxis: { yaxis: {
max: 0, max: 0,
tickAmount: 7 tickAmount: 7,
}, },
title: { title: {
text: "Days before being At-Risk", text: "Days before being At-Risk",
@@ -421,6 +419,27 @@ export default {
}); });
}); });
}, },
/**
* Return the breadcrumbs
*/
dataBreadcrumbs() {
let res = [];
if (this.data[1]) {
res.push({
label: this.data[1]["name"],
onClick() {},
color: this.data[1]["color"],
});
}
if (this.data[2]) {
res.push({
label: this.data[2]["name"],
onClick() {},
color: null,
});
}
return res;
},
}, },
}; };
</script> </script>

View File

@@ -6,7 +6,7 @@
</h6> </h6>
<div> <div>
<BreadCrumb <BreadCrumb
:options="breadCrumbs.data" :options="dataBreadcrumbs()"
:settings="settingsBreadcrumbs" :settings="settingsBreadcrumbs"
/> />
<div class="vp-width-p30 vp-inline-block"> <div class="vp-width-p30 vp-inline-block">
@@ -94,7 +94,7 @@ export default {
Multiselect, Multiselect,
BreadCrumb, BreadCrumb,
}, },
props: ["data", "breadCrumbs"], props: ["data"],
data() { data() {
let that = this; let that = this;
return { return {
@@ -155,12 +155,12 @@ export default {
this.changeOption(); this.changeOption();
}, },
watch: { watch: {
dateFrom () { dateFrom() {
this.validateDateTo(); this.validateDateTo();
}, },
dateTo () { dateTo() {
this.validateDateTo(); this.validateDateTo();
} },
}, },
computed: {}, computed: {},
updated() {}, updated() {},
@@ -282,7 +282,7 @@ export default {
* Validate range date * Validate range date
*/ */
validateDateTo() { validateDateTo() {
if (this.dateFrom !== '' && this.dateTo !== '') { if (this.dateFrom !== "" && this.dateTo !== "") {
if (this.dateFrom > this.dateTo) { if (this.dateFrom > this.dateTo) {
this.stateDateTo = false; this.stateDateTo = false;
} else { } else {
@@ -290,6 +290,27 @@ export default {
} }
} }
}, },
/**
* Return the breadcrumbs
*/
dataBreadcrumbs() {
let res = [];
if (this.data[1]) {
res.push({
label: this.data[1]["name"],
onClick() {},
color: this.data[1]["color"],
});
}
if (this.data[2]) {
res.push({
label: this.data[2]["name"],
onClick() {},
color: null,
});
}
return res;
},
}, },
}; };
</script> </script>

View File

@@ -2,7 +2,7 @@
<div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block"> <div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block">
<div class="p-1 v-flex"> <div class="p-1 v-flex">
<h6 class="v-search-title">{{ $t("ID_DRILL_DOWN_NUMBER_TASKS") }}</h6> <h6 class="v-search-title">{{ $t("ID_DRILL_DOWN_NUMBER_TASKS") }}</h6>
<BreadCrumb :options="breadCrumbs.data" :settings="settingsBreadcrumbs" /> <BreadCrumb :options="dataBreadcrumbs" :settings="settingsBreadcrumbs" />
<apexchart <apexchart
v-show="typeView === 'donut'" v-show="typeView === 'donut'"
ref="apexchart1" ref="apexchart1"
@@ -52,7 +52,7 @@ export default {
name: "VueChartLvZero", name: "VueChartLvZero",
mixins: [], mixins: [],
components: { BreadCrumb }, components: { BreadCrumb },
props: ["breadCrumbs"], props: [],
data() { data() {
let that = this; let that = this;
return { return {
@@ -68,6 +68,57 @@ export default {
onClick() {}, onClick() {},
}, },
], ],
dataBreadcrumbs: [
{
label: that.$i18n.t("ID_INBOX"),
onClick() {
that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_INBOX"),
name: that.$i18n.t("ID_INBOX"),
level: 1,
color: "#179a6e",
});
},
color: "#179a6e",
},
{
label: this.$i18n.t("ID_DRAFT"),
onClick() {
that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_DRAFT"),
name: that.$i18n.t("ID_DRAFT"),
level: 1,
color: "#feb019",
});
},
color: "#feb019",
},
{
label: this.$i18n.t("ID_PAUSED"),
onClick() {
that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_PAUSED"),
name: that.$i18n.t("ID_PAUSED"),
level: 1,
color: "#008ffb",
});
},
color: "#008ffb",
},
{
label: this.$i18n.t("ID_UNASSIGNED"),
onClick() {
that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_UNASSIGNED"),
name: that.$i18n.t("ID_UNASSIGNED"),
level: 1,
color: "#8f99a0",
});
},
color: "#8f99a0",
},
],
optionsDonut: { optionsDonut: {
labels: [ labels: [
this.$i18n.t("ID_INBOX"), this.$i18n.t("ID_INBOX"),
@@ -78,20 +129,10 @@ export default {
chart: { chart: {
id: "apexchart1", id: "apexchart1",
type: "donut", type: "donut",
events: { events: {},
legendClick: function (chartContext, seriesIndex, config) {
that.currentSelection = that.data[seriesIndex];
that.$emit("updateDataLevel", {
id: that.currentSelection["List Name"],
name: that.currentSelection["List Name"],
level: 1,
color: that.formatColor(that.currentSelection["Color"]),
data: that.currentSelection,
});
},
},
}, },
legend: { legend: {
show: false,
position: "top", position: "top",
offsetY: 0, offsetY: 0,
}, },
@@ -127,6 +168,7 @@ export default {
}, },
}, },
legend: { legend: {
show: false,
position: "top", position: "top",
offsetY: 0, offsetY: 0,
}, },

View File

@@ -3,27 +3,23 @@
<vue-chart-lv-zero <vue-chart-lv-zero
v-show="level === 0" v-show="level === 0"
@updateDataLevel="updateDataLevel" @updateDataLevel="updateDataLevel"
:breadCrumbs="dataBreadCrumbs()"
/> />
<vue-chart-lv-one <vue-chart-lv-one
:key="key1" :key="key1"
v-show="level === 1" v-show="level === 1"
:data="levels" :data="levels"
@updateDataLevel="updateDataLevel" @updateDataLevel="updateDataLevel"
:breadCrumbs="dataBreadCrumbs()"
/> />
<vue-chart-lv-two <vue-chart-lv-two
:key="key2" :key="key2"
v-show="level === 2" v-show="level === 2"
:data="levels" :data="levels"
@updateDataLevel="updateDataLevel" @updateDataLevel="updateDataLevel"
:breadCrumbs="dataBreadCrumbs()"
/> />
<vue-chart-lv-three <vue-chart-lv-three
:key="key3" :key="key3"
v-show="level === 3" v-show="level === 3"
:data="levels" :data="levels"
:breadCrumbs="dataBreadCrumbs()"
/> />
</div> </div>
</template> </template>