mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 17:54:30 +08:00
modify style
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-text-field type="number" :density="density"
|
<v-text-field type="number" :density="density" :disabled="disabled"
|
||||||
:rules="rules" v-model="value"
|
:rules="rules" v-model="value"
|
||||||
@keydown="onKeyUpDown" @keyup="onKeyUpDown"
|
@keydown="onKeyUpDown" @keyup="onKeyUpDown"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
@@ -11,6 +11,7 @@ import transactionConstants from '@/consts/transaction.js';
|
|||||||
export default {
|
export default {
|
||||||
props: [
|
props: [
|
||||||
'density',
|
'density',
|
||||||
|
'disabled',
|
||||||
'modelValue'
|
'modelValue'
|
||||||
],
|
],
|
||||||
emits: [
|
emits: [
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
.disabled {
|
.disabled {
|
||||||
opacity: 0.55 !important;
|
opacity: 0.55 !important;
|
||||||
pointer-events: none !important;
|
pointer-events: none !important;
|
||||||
|
-webkit-user-select: none !important;
|
||||||
|
-ms-user-select: none !important;
|
||||||
|
user-select: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.readonly {
|
.readonly {
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row class="match-height">
|
<v-row class="match-height">
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-card>
|
<v-card :class="{ 'disabled': loading }">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span>{{ $t('Exchange Rates Data') }}</span>
|
<span>{{ $t('Exchange Rates Data') }}</span>
|
||||||
<v-btn density="compact" color="default" variant="text"
|
<v-btn density="compact" color="default" variant="text"
|
||||||
class="ml-2" :class="{ 'disabled': updating }"
|
class="ml-2" :icon="true"
|
||||||
:icon="true" @click="update">
|
v-if="!loading" @click="update">
|
||||||
<v-icon :icon="icons.refresh" size="24" />
|
<v-icon :icon="icons.refresh" size="24" />
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
<v-progress-circular indeterminate size="24" class="ml-2" v-if="loading"></v-progress-circular>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<span class="text-sm">
|
<span class="text-sm">
|
||||||
{{ $t('Data source') }}
|
{{ $t('Data source') }}
|
||||||
<a target="_blank" :href="exchangeRatesData.referenceUrl" v-if="exchangeRatesData.referenceUrl">{{ exchangeRatesData.dataSource }}</a>
|
<a tabindex="-1" target="_blank" :href="exchangeRatesData.referenceUrl" v-if="exchangeRatesData.referenceUrl">{{ exchangeRatesData.dataSource }}</a>
|
||||||
<span v-else-if="!exchangeRatesData.referenceUrl">{{ exchangeRatesData.dataSource }}</span>
|
<span v-else-if="!exchangeRatesData.referenceUrl">{{ exchangeRatesData.dataSource }}</span>
|
||||||
<span v-if="exchangeRatesDataUpdateTime"> , {{ $t('Last Updated') }} {{ exchangeRatesDataUpdateTime }}</span>
|
<span v-if="exchangeRatesDataUpdateTime"> , {{ $t('Last Updated') }} {{ exchangeRatesDataUpdateTime }}</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -33,6 +34,7 @@
|
|||||||
single-line
|
single-line
|
||||||
item-title="currencyDisplayName"
|
item-title="currencyDisplayName"
|
||||||
item-value="currencyCode"
|
item-value="currencyCode"
|
||||||
|
:disabled="loading"
|
||||||
:items="availableExchangeRates"
|
:items="availableExchangeRates"
|
||||||
v-model="baseCurrency"
|
v-model="baseCurrency"
|
||||||
></v-select>
|
></v-select>
|
||||||
@@ -43,7 +45,7 @@
|
|||||||
<span class="text-subtitle-1">{{ $t('Base Amount') }}</span>
|
<span class="text-subtitle-1">{{ $t('Base Amount') }}</span>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="10" class="mb-6">
|
<v-col cols="12" md="10" class="mb-6">
|
||||||
<amount-input density="compact" v-model="baseAmount"/>
|
<amount-input density="compact" :disabled="loading" v-model="baseAmount"/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
@@ -76,10 +78,6 @@
|
|||||||
<v-btn color="primary" variant="text" @click="showSnackbar = false">{{ $t('Close') }}</v-btn>
|
<v-btn color="primary" variant="text" @click="showSnackbar = false">{{ $t('Close') }}</v-btn>
|
||||||
</template>
|
</template>
|
||||||
</v-snackbar>
|
</v-snackbar>
|
||||||
|
|
||||||
<v-overlay class="justify-center align-center" :persistent="true" v-model="updating">
|
|
||||||
<v-progress-circular indeterminate></v-progress-circular>
|
|
||||||
</v-overlay>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -101,7 +99,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
baseCurrency: userStore.currentUserDefaultCurrency,
|
baseCurrency: userStore.currentUserDefaultCurrency,
|
||||||
baseAmount: '1',
|
baseAmount: '1',
|
||||||
updating: false,
|
loading: false,
|
||||||
showSnackbar: false,
|
showSnackbar: false,
|
||||||
snackbarMessage: '',
|
snackbarMessage: '',
|
||||||
icons: {
|
icons: {
|
||||||
@@ -160,19 +158,19 @@ export default {
|
|||||||
update() {
|
update() {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (self.updating) {
|
if (self.loading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.updating = true;
|
self.loading = true;
|
||||||
self.exchangeRatesStore.getLatestExchangeRates({
|
self.exchangeRatesStore.getLatestExchangeRates({
|
||||||
silent: false,
|
silent: false,
|
||||||
force: true
|
force: true
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
self.updating = false;
|
self.loading = false;
|
||||||
self.showSnackbarMessage(self.$t('Exchange rates data has been updated'));
|
self.showSnackbarMessage(self.$t('Exchange rates data has been updated'));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
self.updating = false;
|
self.loading = false;
|
||||||
|
|
||||||
if (!error.processed) {
|
if (!error.processed) {
|
||||||
self.showSnackbarMessage(self.$tError(error.message || error));
|
self.showSnackbarMessage(self.$tError(error.message || error));
|
||||||
|
|||||||
Reference in New Issue
Block a user