mirror of
https://github.com/frappe/books.git
synced 2025-02-08 23:18:31 +00:00
incr: update dashboard
- change aspect ratio to 3:2
This commit is contained in:
parent
1c0896553e
commit
b85f5db980
2
main.ts
2
main.ts
@ -26,7 +26,7 @@ export class Main {
|
|||||||
mainWindow: BrowserWindow | null = null;
|
mainWindow: BrowserWindow | null = null;
|
||||||
|
|
||||||
WIDTH = 1200;
|
WIDTH = 1200;
|
||||||
HEIGHT = process.platform === 'win32' ? 926 : 900;
|
HEIGHT = process.platform === 'win32' ? 826 : 800;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.icon = this.isDevelopment
|
this.icon = this.isDevelopment
|
||||||
|
@ -53,16 +53,12 @@
|
|||||||
@mouseover="$emit('change', i)"
|
@mouseover="$emit('change', i)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</svg>
|
<text
|
||||||
<div
|
:x="cx"
|
||||||
class="text-center w-28 relative"
|
:y="cy"
|
||||||
:style="{
|
text-anchor="middle"
|
||||||
top: `calc(-50% + ${textOffsetY}px)`,
|
style="font-size: 6px; font-weight: bold; fill: #415668"
|
||||||
left: `calc(50% + ${textOffsetX}px)`,
|
|
||||||
transform: 'translateX(-50%)',
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<p class="text-base font-bold whitespace-nowrap">
|
|
||||||
{{
|
{{
|
||||||
valueFormatter(
|
valueFormatter(
|
||||||
active !== null && sectors.length !== 0
|
active !== null && sectors.length !== 0
|
||||||
@ -71,23 +67,20 @@
|
|||||||
'Currency'
|
'Currency'
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</p>
|
</text>
|
||||||
<p
|
<text
|
||||||
class="
|
:x="cx"
|
||||||
text-xs text-gray-600
|
:y="cy + 8"
|
||||||
font-semibold
|
text-anchor="middle"
|
||||||
whitespace-nowrap
|
style="font-size: 5px; fill: #a1abb4"
|
||||||
overflow-x-auto
|
|
||||||
no-scrollbar
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
active !== null && sectors.length !== 0
|
active !== null && sectors.length !== 0
|
||||||
? sectors[active].label
|
? sectors[active].label
|
||||||
: totalLabel
|
: totalLabel
|
||||||
}}
|
}}
|
||||||
</p>
|
</text>
|
||||||
</div>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="grid grid-cols-3 text-gray-800 text-sm select-none items-center"
|
class="grid grid-cols-3 text-gray-800 text-sm select-none items-center"
|
||||||
style="height: 52px"
|
style="height: 50px"
|
||||||
>
|
>
|
||||||
<!-- Length Display -->
|
<!-- Length Display -->
|
||||||
<div class="justify-self-start">
|
<div class="justify-self-start">
|
||||||
|
@ -2,17 +2,17 @@
|
|||||||
<div>
|
<div>
|
||||||
<!-- Title and Period Selector -->
|
<!-- Title and Period Selector -->
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div class="font-medium">{{ t`Cashflow` }}</div>
|
<div class="font-medium text-base">{{ t`Cashflow` }}</div>
|
||||||
|
|
||||||
<!-- Chart Legend -->
|
<!-- Chart Legend -->
|
||||||
<div class="flex text-base" v-if="hasData">
|
<div class="flex text-base gap-8" v-if="hasData">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center gap-2">
|
||||||
<span class="w-3 h-3 rounded-sm inline-block bg-blue-500"></span>
|
<span class="w-3 h-3 rounded-sm inline-block bg-blue-500" />
|
||||||
<span class="ml-2 text-gray-900">{{ t`Inflow` }}</span>
|
<span class="text-gray-900">{{ t`Inflow` }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center ml-6">
|
<div class="flex items-center gap-2">
|
||||||
<span class="w-3 h-3 rounded-sm inline-block bg-gray-500"></span>
|
<span class="w-3 h-3 rounded-sm inline-block bg-gray-500" />
|
||||||
<span class="ml-2 text-gray-900">{{ t`Outflow` }}</span>
|
<span class="text-gray-900">{{ t`Outflow` }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="w-16 h-5 bg-gray-200 rounded" />
|
<div v-else class="w-16 h-5 bg-gray-200 rounded" />
|
||||||
@ -28,7 +28,9 @@
|
|||||||
|
|
||||||
<!-- Line Chart -->
|
<!-- Line Chart -->
|
||||||
<LineChart
|
<LineChart
|
||||||
|
class="mt-4"
|
||||||
v-if="chartData.points.length"
|
v-if="chartData.points.length"
|
||||||
|
:aspect-ratio="4.15"
|
||||||
:colors="chartData.colors"
|
:colors="chartData.colors"
|
||||||
:points="chartData.points"
|
:points="chartData.points"
|
||||||
:x-labels="chartData.xLabels"
|
:x-labels="chartData.xLabels"
|
||||||
|
@ -2,15 +2,16 @@
|
|||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<PageHeader :title="t`Dashboard`" />
|
<PageHeader :title="t`Dashboard`" />
|
||||||
|
|
||||||
<div class="mx-4 overflow-y-auto no-scrollbar flex flex-col gap-8">
|
<div class="overflow-y-hidden no-scrollbar flex flex-col">
|
||||||
<Cashflow class="" />
|
<Cashflow class="p-4" />
|
||||||
<hr />
|
<hr />
|
||||||
<UnpaidInvoices />
|
<UnpaidInvoices />
|
||||||
<hr />
|
<hr />
|
||||||
<div class="flex gap-8">
|
<div class="flex">
|
||||||
<ProfitAndLoss class="w-full" />
|
<ProfitAndLoss class="w-full p-4 border-r" />
|
||||||
<Expenses class="w-full" />
|
<Expenses class="w-full p-4" />
|
||||||
</div>
|
</div>
|
||||||
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
<PeriodSelector :value="period" @change="(value) => (period = value)" />
|
<PeriodSelector :value="period" @change="(value) => (period = value)" />
|
||||||
</template>
|
</template>
|
||||||
</SectionHeader>
|
</SectionHeader>
|
||||||
|
|
||||||
<div class="flex relative" v-show="hasData">
|
<div class="flex relative" v-show="hasData">
|
||||||
<!-- Chart Legend -->
|
<!-- Chart Legend -->
|
||||||
<div class="w-1/2 flex flex-col gap-5 mt-8">
|
<div class="w-1/2 flex flex-col gap-4 justify-center">
|
||||||
<!-- Ledgend Item -->
|
<!-- Ledgend Item -->
|
||||||
<div
|
<div
|
||||||
class="flex items-center text-sm"
|
class="flex items-center text-sm"
|
||||||
@ -27,7 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<DonutChart
|
<DonutChart
|
||||||
class="w-1/2"
|
class="w-1/2 my-auto"
|
||||||
:active="active"
|
:active="active"
|
||||||
:sectors="sectors"
|
:sectors="sectors"
|
||||||
:offset-x="3"
|
:offset-x="3"
|
||||||
@ -52,6 +53,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { truncate } from 'lodash';
|
||||||
import { fyo } from 'src/initFyo';
|
import { fyo } from 'src/initFyo';
|
||||||
import theme from 'src/theme';
|
import theme from 'src/theme';
|
||||||
import { getDatesAndPeriodList } from 'src/utils/misc';
|
import { getDatesAndPeriodList } from 'src/utils/misc';
|
||||||
@ -72,7 +74,7 @@ export default {
|
|||||||
expenses: [],
|
expenses: [],
|
||||||
}),
|
}),
|
||||||
watch: {
|
watch: {
|
||||||
period(new_, old) {
|
period() {
|
||||||
this.setData();
|
this.setData();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -89,7 +91,7 @@ export default {
|
|||||||
sectors() {
|
sectors() {
|
||||||
return this.expenses.map(({ account, color, total }) => ({
|
return this.expenses.map(({ account, color, total }) => ({
|
||||||
color,
|
color,
|
||||||
label: account,
|
label: truncate(account, { length: 21 }),
|
||||||
value: total,
|
value: total,
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</SectionHeader>
|
</SectionHeader>
|
||||||
<BarChart
|
<BarChart
|
||||||
|
class="mt-4"
|
||||||
v-if="hasData"
|
v-if="hasData"
|
||||||
|
:aspect-ratio="2.05"
|
||||||
:colors="chartData.colors"
|
:colors="chartData.colors"
|
||||||
:points="chartData.points"
|
:points="chartData.points"
|
||||||
:x-labels="chartData.xLabels"
|
:x-labels="chartData.xLabels"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-baseline justify-between">
|
<div class="flex items-baseline justify-between">
|
||||||
<span class="font-medium"><slot name="title"></slot></span>
|
<span class="font-medium text-base"><slot name="title"></slot></span>
|
||||||
<slot name="action"></slot>
|
<slot name="action"></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex justify-between gap-8">
|
<div class="flex">
|
||||||
<div
|
<div
|
||||||
class="flex-col justify-between flex-1"
|
|
||||||
v-for="(invoice, i) in invoices"
|
v-for="(invoice, i) in invoices"
|
||||||
|
class="flex-col justify-between w-full p-4"
|
||||||
|
:class="i === 0 ? 'border-r' : ''"
|
||||||
:key="invoice.title"
|
:key="invoice.title"
|
||||||
>
|
>
|
||||||
<!-- Title and Period Selector -->
|
<!-- Title and Period Selector -->
|
||||||
@ -26,9 +27,9 @@
|
|||||||
</SectionHeader>
|
</SectionHeader>
|
||||||
|
|
||||||
<!-- Widget Body -->
|
<!-- Widget Body -->
|
||||||
<div>
|
<div class="mt-4">
|
||||||
<!-- Paid & Unpaid Amounts -->
|
<!-- Paid & Unpaid Amounts -->
|
||||||
<div class="mt-6 flex justify-between">
|
<div class="flex justify-between">
|
||||||
<!-- Paid -->
|
<!-- Paid -->
|
||||||
<div
|
<div
|
||||||
class="text-sm bold"
|
class="text-sm bold"
|
||||||
|
@ -16,15 +16,14 @@
|
|||||||
<!-- Printview Preview -->
|
<!-- Printview Preview -->
|
||||||
<div
|
<div
|
||||||
v-if="doc && printSettings"
|
v-if="doc && printSettings"
|
||||||
class="flex justify-center flex-1 -mt-36 overflow-auto relative"
|
class="flex justify-center flex-1 overflow-auto relative"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="h-full shadow-lg mb-12 absolute"
|
class="h-full shadow my-4 absolute"
|
||||||
style="
|
style="
|
||||||
width: 21cm;
|
width: 21cm;
|
||||||
min-height: 29.7cm;
|
height: 29.7cm;
|
||||||
height: max-content;
|
transform: scale(0.7) translateY(-240px);
|
||||||
transform: scale(0.7);
|
|
||||||
"
|
"
|
||||||
ref="printContainer"
|
ref="printContainer"
|
||||||
>
|
>
|
||||||
@ -39,13 +38,19 @@
|
|||||||
|
|
||||||
<!-- Printview Customizer -->
|
<!-- Printview Customizer -->
|
||||||
<div class="border-l w-80" v-if="showCustomiser">
|
<div class="border-l w-80" v-if="showCustomiser">
|
||||||
<div class="px-4 flex items-center justify-between h-row-largest border-b">
|
<div
|
||||||
|
class="px-4 flex items-center justify-between h-row-largest border-b"
|
||||||
|
>
|
||||||
<h2 class="font-semibold">{{ t`Customise` }}</h2>
|
<h2 class="font-semibold">{{ t`Customise` }}</h2>
|
||||||
<Button :icon="true" @click="showCustomiser = false">
|
<Button :icon="true" @click="showCustomiser = false">
|
||||||
<feather-icon name="x" class="w-4 h-4" />
|
<feather-icon name="x" class="w-4 h-4" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<TwoColumnForm :doc="printSettings" :autosave="true" class="border-none"/>
|
<TwoColumnForm
|
||||||
|
:doc="printSettings"
|
||||||
|
:autosave="true"
|
||||||
|
class="border-none"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user