Bulk of fixes

This commit is contained in:
2024-03-24 17:04:36 +01:00
parent 29f1191afa
commit b60c4ae88c
3 changed files with 33 additions and 16 deletions

View File

@@ -32,8 +32,18 @@ const countryCurrency = ref([])
const currencyHash = ref([])
const ccountry = ref([])
const ccountry_list = ref([])
const items = ref([])
const ccountry_list = computed(() => {
let computed_list = settingsStore.ccountry_list.filter((c) => (c.online == (settingsStore.online ? 'Y' : 'N')) || settingsStore.online == true);
console.log('COMPUTED_LIST',computed_list);
return computed_list;
})
const scountry_list = computed(() => {
let computed_list = settingsStore.ccountry_list.filter((c) => (c.online == (settingsStore.online ? 'Y' : 'N')) || settingsStore.online == true);
console.log('COMPUTED_LIST',computed_list);
return computed_list;
})
let tsettings = computed(() => {
let country = "GB";
@@ -127,21 +137,15 @@ const fetch = async () => {
let aCntry = ccountry.value.map((country) => [country.country_name]);
settingsStore.ccountry_filter.push(...aCntry);
ccountry_list.value = ccountry.value.map((country) => {
console.log('CCOUNTRY=',ccountry);
settingsStore.ccountry_list = ccountry.value.map((country) => {
return {
name: country.country_name,
code: country.country_code,
status: country.status,
online: country.only_online,
};
});
var i = 1;
items.value = ccountry.value.map((country) => {
return {
country: country.country_name,
currency: country.currency_code,
id: i++,
};
});
console.log("TEST=", settingsStore.ccountry_filter, ccountry_list.value);
} catch (e) {
const response = await Swal.fire({
@@ -242,9 +246,9 @@ onMounted(fetch_menu);
<span class="font-extrabold font-mono">Country in which search product</span>
</div>
<div class="">
<multiselect @select="selectCurrency" placeholder="All" :close-on-select="true" :multiple="false" v-model="settingsStore.country" :options="ccodes" label="country" track-by="code">
<multiselect @select="selectCurrency" placeholder="All" :close-on-select="true" :multiple="false" v-model="settingsStore.country" :options="scountry_list" label="name" track-by="name">
<template #option="slotProps">
<span :class="'pl-6 fi fi-' + slotProps.option.code.toLowerCase()">{{ slotProps.option.country }}</span>
<span :class="'pl-6 fi fi-' + slotProps.option.code.toLowerCase()">{{ slotProps.option.name }}</span>
</template>
</multiselect>
</div>
@@ -276,10 +280,11 @@ onMounted(fetch_menu);
<slot />
</div>
<fwb-footer class="p-4 rounded-none bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-900 bottom-0 absolute w-full">
All information without guarantee
<fwb-footer-copyright
by="JD a MH Slovakia™"
href="/"
copyright-message="We are not responsible..."
copyright-message=""
/>
</fwb-footer>
</template>

View File

@@ -83,6 +83,17 @@ const onHover = (data) => {
hover.value = !hover.value;
};
const chart_coutries = computed(() => {
let countries = [["Country"]];
for (let i=0; i < settingsStore.ccountry_list.length ; i++) {
if (settingsStore.ccountry_list[i].online == (settingsStore.online ? 'Y' : 'N') || settingsStore.online == true)
countries.push([settingsStore.ccountry_list[i].name]);
}
return countries;
})
const tproducts = computed(() => {
console.log("PR=", products);
console.log("CC=", countryCurrency.value);
@@ -443,7 +454,7 @@ const selectedRowClassNameFunction = (item) => {
<GChart
:events="gchartEvents"
:type="type"
:data="settingsStore.ccountry_filter"
:data="chart_coutries"
:options="options"
:settings="chart_settings"
/>

View File

@@ -10,6 +10,7 @@ export const settingsStore = reactive({
currency: "EUR",
online: false,
ccountry_filter: [["Country"]],
ccountry_list: [],
currencyCoef: 1.0,
settings: {},
});