This commit is contained in:
2022-02-25 20:58:01 +00:00
parent 4bcc457025
commit 58a636e24c
3 changed files with 36 additions and 6 deletions

View File

@@ -62,7 +62,12 @@ export default {
type: "GzDashLaborHoursPersonal", type: "GzDashLaborHoursPersonal",
scheduleableUserOnly: true, scheduleableUserOnly: true,
singleOnly: false, singleOnly: false,
settings: { customTitle: null, dateRange: "*thismonth*", unit: "day" } settings: {
customTitle: null,
dateRange: "*thismonth*",
unit: "day",
color: "#000000"
}
}, },
{ {
id: "dash-labor-hours-personal-bar", id: "dash-labor-hours-personal-bar",
@@ -71,7 +76,12 @@ export default {
type: "GzDashLaborHoursPersonalBar", type: "GzDashLaborHoursPersonalBar",
scheduleableUserOnly: true, scheduleableUserOnly: true,
singleOnly: false, singleOnly: false,
settings: { customTitle: null, dateRange: "*thismonth*", unit: "day" } settings: {
customTitle: null,
dateRange: "*thismonth*",
unit: "day",
color: "#000000"
}
}, },
{ {
id: "TestBarWidgetCountByUserType", id: "TestBarWidgetCountByUserType",

View File

@@ -67,6 +67,13 @@
v-model="localSettings.customTitle" v-model="localSettings.customTitle"
:label="$ay.t('Name')" :label="$ay.t('Name')"
></v-text-field> ></v-text-field>
<v-color-picker
v-model="localSettings.color"
hide-mode-switch
hide-inputs
mode="hexa"
></v-color-picker>
</v-card-text> </v-card-text>
<v-divider></v-divider> <v-divider></v-divider>
@@ -91,7 +98,7 @@
</template> </template>
<script> <script>
import GzDash from "./dash-base.vue"; import GzDash from "./dash-base.vue";
import Palette from "../api/palette"; //import Palette from "../api/palette";
export default { export default {
components: { components: {
GzDash GzDash
@@ -145,7 +152,7 @@ export default {
datasets: [ datasets: [
{ {
label: this.$ay.t("WorkOrderItemLaborServiceRateQuantity"), label: this.$ay.t("WorkOrderItemLaborServiceRateQuantity"),
backgroundColor: Palette.color.soft_green, backgroundColor: this.settings.color ?? "#000000",
data: this.obj data: this.obj
} }
] ]
@@ -170,6 +177,7 @@ export default {
this.settings.customTitle = this.localSettings.customTitle; this.settings.customTitle = this.localSettings.customTitle;
this.settings.dateRange = this.localSettings.dateRange; this.settings.dateRange = this.localSettings.dateRange;
this.settings.unit = this.localSettings.unit; this.settings.unit = this.localSettings.unit;
this.settings.color = this.localSettings.color;
this.$emit("dash-change"); this.$emit("dash-change");
this.context = false; this.context = false;
this.getDataFromApi(); this.getDataFromApi();

View File

@@ -22,6 +22,7 @@
></gz-chart-line> --> ></gz-chart-line> -->
<gz-chart-line <gz-chart-line
v-if="visible"
:width="400" :width="400"
:height="330" :height="330"
:chart-data="chartData" :chart-data="chartData"
@@ -67,6 +68,13 @@
v-model="localSettings.customTitle" v-model="localSettings.customTitle"
:label="$ay.t('Name')" :label="$ay.t('Name')"
></v-text-field> ></v-text-field>
<v-color-picker
v-model="localSettings.color"
hide-mode-switch
hide-inputs
mode="hexa"
></v-color-picker>
</v-card-text> </v-card-text>
<v-divider></v-divider> <v-divider></v-divider>
@@ -91,7 +99,6 @@
</template> </template>
<script> <script>
import GzDash from "./dash-base.vue"; import GzDash from "./dash-base.vue";
import Palette from "../api/palette";
export default { export default {
components: { components: {
GzDash GzDash
@@ -102,6 +109,7 @@ export default {
data() { data() {
return { return {
obj: {}, obj: {},
visible: true,
context: false, context: false,
localSettings: {}, localSettings: {},
selectLists: { selectLists: {
@@ -145,7 +153,7 @@ export default {
datasets: [ datasets: [
{ {
label: this.$ay.t("WorkOrderItemLaborServiceRateQuantity"), label: this.$ay.t("WorkOrderItemLaborServiceRateQuantity"),
borderColor: Palette.color.soft_deep_blue, borderColor: this.settings.color ?? "#000000",
//backgroundColor: Palette.color.soft_deep_blue, //backgroundColor: Palette.color.soft_deep_blue,
fill: false, fill: false,
radius: 0, radius: 0,
@@ -175,9 +183,13 @@ export default {
this.settings.customTitle = this.localSettings.customTitle; this.settings.customTitle = this.localSettings.customTitle;
this.settings.dateRange = this.localSettings.dateRange; this.settings.dateRange = this.localSettings.dateRange;
this.settings.unit = this.localSettings.unit; this.settings.unit = this.localSettings.unit;
this.settings.color = this.localSettings.color;
this.$emit("dash-change"); this.$emit("dash-change");
this.context = false; this.context = false;
this.getDataFromApi(); this.getDataFromApi();
this.visible = false;
this.visible = true;
}, },
async getDataFromApi() { async getDataFromApi() {