|
@@ -36,32 +36,22 @@ const formInline = reactive<any>({
|
|
|
});
|
|
|
provide('query-parameter', formInline);
|
|
|
|
|
|
-const groupOptions: any = ref([]);
|
|
|
-const brandsOptions: any = ref([]);
|
|
|
-const shopOptions: any = ref([]);
|
|
|
+const groupOptions = <any>ref([]);
|
|
|
+const brandsOptions = <any>ref([]);
|
|
|
+const shopOptions = <any>ref([]);
|
|
|
|
|
|
provide('groupOptions', groupOptions);
|
|
|
provide('brandsOptions', brandsOptions);
|
|
|
provide('shopOptions', shopOptions);
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
- fetchAllOptions();
|
|
|
+ fetchOptions();
|
|
|
});
|
|
|
|
|
|
-async function fetchAllOptions() {
|
|
|
- try {
|
|
|
- const [ groupRes, brandsRes, shopRes ] = await Promise.all([
|
|
|
- useResponse(api.getGroupOptions),
|
|
|
- useResponse(api.getBrandsOptions),
|
|
|
- useResponse(api.getShopOptions)
|
|
|
- ]);
|
|
|
-
|
|
|
- groupOptions.value = groupRes.data;
|
|
|
- brandsOptions.value = brandsRes.data;
|
|
|
- shopOptions.value = shopRes.data;
|
|
|
- } catch (error) {
|
|
|
- console.error('Error fetching options: ', error);
|
|
|
- }
|
|
|
+async function fetchOptions() {
|
|
|
+ groupOptions.value = (await useResponse(api.getGroupOptions)).data;
|
|
|
+ brandsOptions.value = (await useResponse(api.getBrandsOptions)).data;
|
|
|
+ shopOptions.value = (await useResponse(api.getShopOptions)).data;
|
|
|
}
|
|
|
|
|
|
async function handleQuery() {
|
|
@@ -78,7 +68,7 @@ function resetParameter() {
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="p-5 flex-grow">
|
|
|
+ <div class="p-5">
|
|
|
<el-card class="h-full" style="color: rgba(0, 0, 0, 0.88);">
|
|
|
<div ref="titleContainer" class="text-xl font-semibold pb-5">商品列表</div>
|
|
|
<!-- 查询条件 -->
|