refactor: set Option
This commit is contained in:
parent
f80e132df5
commit
ea172bfc36
1 changed files with 23 additions and 1 deletions
|
|
@ -1,16 +1,37 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, nextTick, ref, watch } from 'vue';
|
import { onMounted, nextTick, ref, watch } from 'vue';
|
||||||
|
|
||||||
// NOTE: Import stores
|
// NOTE: Import stores
|
||||||
|
import useOptionStore from 'stores/options';
|
||||||
|
|
||||||
// NOTE Import Types
|
// NOTE Import Types
|
||||||
import { BankBook } from 'stores/branch/types';
|
import { BankBook } from 'stores/branch/types';
|
||||||
|
|
||||||
// NOTE: Import Components
|
// NOTE: Import Components
|
||||||
import ViewHeader from './ViewHeader.vue';
|
import ViewHeader from './ViewHeader.vue';
|
||||||
|
import BankComponents from './BankComponents.vue';
|
||||||
|
|
||||||
|
const optionStore = useOptionStore();
|
||||||
let count = 50;
|
let count = 50;
|
||||||
|
|
||||||
const elements = ref<HTMLElement[]>([]);
|
const elements = ref<HTMLElement[]>([]);
|
||||||
const chunks = ref<number[][]>([[]]);
|
const chunks = ref<number[][]>([[]]);
|
||||||
|
|
||||||
|
const bankList = ref<BankBook[]>([
|
||||||
|
{
|
||||||
|
id: 'cm14grwo30003z8chvzouoc87',
|
||||||
|
currentlyUse: true,
|
||||||
|
branchId: 'cm14grwo30002z8ch55keto89',
|
||||||
|
bankUrl:
|
||||||
|
'http://192.168.1.61:20102/api/v1/branch/cm14grwo30002z8ch55keto89/bank-qr/cm14grwo30003z8chvzouoc87?ts=1729148488206',
|
||||||
|
bankName: 'ktb',
|
||||||
|
bankBranch: 'โรงพยาบาลศิริราชปิยมหาราชการุณย์',
|
||||||
|
accountType: '',
|
||||||
|
accountNumber: '1-520-361442-23',
|
||||||
|
accountName: 'บริษัท สยามเทคโนโลยี จำกัด',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
async function assignData() {
|
async function assignData() {
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
let el = elements.value.at(-1);
|
let el = elements.value.at(-1);
|
||||||
|
|
@ -48,7 +69,8 @@ function getHeight(el: HTMLElement) {
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
await optionStore.fetchOption();
|
||||||
assignData();
|
assignData();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue