Bulk of fixes
This commit is contained in:
@@ -32,8 +32,18 @@ const countryCurrency = ref([])
|
|||||||
const currencyHash = ref([])
|
const currencyHash = ref([])
|
||||||
|
|
||||||
const ccountry = 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 tsettings = computed(() => {
|
||||||
let country = "GB";
|
let country = "GB";
|
||||||
@@ -127,21 +137,15 @@ const fetch = async () => {
|
|||||||
let aCntry = ccountry.value.map((country) => [country.country_name]);
|
let aCntry = ccountry.value.map((country) => [country.country_name]);
|
||||||
settingsStore.ccountry_filter.push(...aCntry);
|
settingsStore.ccountry_filter.push(...aCntry);
|
||||||
|
|
||||||
ccountry_list.value = ccountry.value.map((country) => {
|
console.log('CCOUNTRY=',ccountry);
|
||||||
|
settingsStore.ccountry_list = ccountry.value.map((country) => {
|
||||||
return {
|
return {
|
||||||
name: country.country_name,
|
name: country.country_name,
|
||||||
code: country.country_code,
|
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) {
|
} catch (e) {
|
||||||
const response = await Swal.fire({
|
const response = await Swal.fire({
|
||||||
@@ -242,9 +246,9 @@ onMounted(fetch_menu);
|
|||||||
<span class="font-extrabold font-mono">Country in which search product</span>
|
<span class="font-extrabold font-mono">Country in which search product</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="">
|
<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">
|
<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>
|
</template>
|
||||||
</multiselect>
|
</multiselect>
|
||||||
</div>
|
</div>
|
||||||
@@ -276,10 +280,11 @@ onMounted(fetch_menu);
|
|||||||
<slot />
|
<slot />
|
||||||
</div>
|
</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">
|
<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
|
<fwb-footer-copyright
|
||||||
by="JD a MH Slovakia™"
|
by="JD a MH Slovakia™"
|
||||||
href="/"
|
href="/"
|
||||||
copyright-message="We are not responsible..."
|
copyright-message=""
|
||||||
/>
|
/>
|
||||||
</fwb-footer>
|
</fwb-footer>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -83,6 +83,17 @@ const onHover = (data) => {
|
|||||||
hover.value = !hover.value;
|
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(() => {
|
const tproducts = computed(() => {
|
||||||
console.log("PR=", products);
|
console.log("PR=", products);
|
||||||
console.log("CC=", countryCurrency.value);
|
console.log("CC=", countryCurrency.value);
|
||||||
@@ -443,7 +454,7 @@ const selectedRowClassNameFunction = (item) => {
|
|||||||
<GChart
|
<GChart
|
||||||
:events="gchartEvents"
|
:events="gchartEvents"
|
||||||
:type="type"
|
:type="type"
|
||||||
:data="settingsStore.ccountry_filter"
|
:data="chart_coutries"
|
||||||
:options="options"
|
:options="options"
|
||||||
:settings="chart_settings"
|
:settings="chart_settings"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const settingsStore = reactive({
|
|||||||
currency: "EUR",
|
currency: "EUR",
|
||||||
online: false,
|
online: false,
|
||||||
ccountry_filter: [["Country"]],
|
ccountry_filter: [["Country"]],
|
||||||
|
ccountry_list: [],
|
||||||
currencyCoef: 1.0,
|
currencyCoef: 1.0,
|
||||||
settings: {},
|
settings: {},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user