emis-frontend/src/views/emis/EmisBaseTools/ExchangeRatePanel.vue

58 lines
1.0 KiB
Vue
Raw Normal View History

2024-07-18 12:06:17 +00:00
<template>
<div>
{{from}}->{{to}}:{{ svalue }}
</div>
</template>
<script>
import { getValidExchangeRate } from "@/api/emis/emisExchangeRate";
export default {
name: "ExchangeRatePanel",
props: {
value: {
type: String,
required: false
},
from: {
type: String,
required: false
},
to: {
type: String,
required: false
},
placeholder: {
type: String,
required: false
},
},
data() {
return {
svalue: this.value,
};
},
watch: {
from(newVal,oldVal) {
this.queryData();
},
to(newVal,oldVal) {
this.queryData();
}
},
created() {
this.queryData();
},
methods: {
queryData() {
let queryParams = {
from:this.from,
to:this.to
};
2024-07-18 13:24:03 +00:00
getValidExchangeRate(queryParams).then(response => {
2024-07-18 12:06:17 +00:00
this.value = response.data;
});
},
}
};
</script>