소스 검색

feat: 添加接口参数信息,补充显示内容

lixuan 3 주 전
부모
커밋
18702a8461

+ 21 - 2
apps/web-velofex/src/layouts/header/header.vue

@@ -12,7 +12,6 @@ import Logo from '#/assets/image/logo.png';
 import { router } from '#/router';
 
 import SelectLang from '../select-lang.vue';
-import Avatar from './avatar.vue';
 
 const userStore = useUserStore();
 
@@ -112,7 +111,18 @@ watch(
         placement="bottom"
         @menu-click="(info: any) => handleMenuClick(info)"
       >
-        <Avatar :avatar="useAvatar" class="cursor-pointer" @click="openLogin" />
+        <img
+          v-if="userStore.userInfo?.avatar"
+          :avatar="`/File/Download?fileId=${userStore.userInfo?.avatar}`"
+          class="cursor-pointer"
+          @click="openLogin"
+        />
+        <img
+          v-else
+          :avatar="useAvatar"
+          class="cursor-pointer"
+          @click="openLogin"
+        />
       </Dropdown>
     </div>
   </div>
@@ -135,4 +145,13 @@ watch(
     }
   }
 }
+
+.cursor-pointer {
+  width: 24px;
+  height: 24px;
+  overflow: hidden;
+  border: none;
+  border-color: transparent;
+  border-radius: 50%;
+}
 </style>

+ 6 - 6
apps/web-velofex/src/views/dashboard/application-management/application-modal.vue

@@ -682,6 +682,12 @@ function resetFormData() {
                 :placeholder="$t('applicationManagement.modal.enterAddress')"
               />
             </div>
+            <div class="flex flex-col gap-2">
+              <label class="text-sm font-medium">{{
+                $t('applicationManagement.modal.isEnabled')
+              }}</label>
+              <Switch v-model:checked="formData.isEnabled" class="w-[40px]" />
+            </div>
             <div class="flex flex-col gap-2">
               <label class="text-sm font-medium">{{
                 $t('applicationManagement.modal.description')
@@ -694,12 +700,6 @@ function resetFormData() {
                 :rows="3"
               />
             </div>
-            <div class="flex flex-col gap-2">
-              <label class="text-sm font-medium">{{
-                $t('applicationManagement.modal.isEnabled')
-              }}</label>
-              <Switch v-model:checked="formData.isEnabled" class="w-[40px]" />
-            </div>
             <div class="flex flex-col gap-2">
               <label class="text-sm font-medium">{{
                 $t('applicationManagement.modal.processCount')

+ 15 - 3
apps/web-velofex/src/views/dashboard/application-management/index.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import { computed, ref, watch } from 'vue';
+import { useRoute } from 'vue-router';
 
 import { useUserStore } from '@vben/stores';
 
@@ -42,12 +43,15 @@ const searchParams = ref({
   cooperatePartner: '',
   activateNow: 'Yes',
   currentPage: 1,
-  pageSize: 16,
+  pageSize: 12,
 });
 
 const totalPage = ref(0);
 const totalCount = ref(0);
 
+const route = useRoute();
+const type = route.query.type as string;
+
 function handleSearch() {
   searchParams.value.currentPage = 1;
   fetchApplicationList();
@@ -134,6 +138,10 @@ async function fetchApplicationList() {
           name: 'code',
           value: searchParams.value.applicationId,
         },
+        {
+          name: 'type',
+          value: 'application',
+        },
       ],
     });
     if (result?.result?.model) {
@@ -208,7 +216,11 @@ watch(
   <div class="p-5">
     <div class="mb-4 flex items-center justify-between">
       <div class="text-sm text-[#462424] text-gray-500">
-        {{ $t('applicationManagement.breadcrumb') }}
+        {{
+          type === '1'
+            ? $t('applicationManagement.breadcrumb')
+            : $t('productManagement.breadcrumb')
+        }}
       </div>
       <div
         class="flex cursor-pointer items-center gap-[9px] text-[16px] font-bold text-[#462424]"
@@ -403,7 +415,7 @@ watch(
       <Pagination
         v-model:current="searchParams.currentPage"
         :hide-on-single-page="true"
-        :page-size="16"
+        :page-size="12"
         :show-size-changer="false"
         :total="totalCount"
         @change="handlePageChange"

+ 6 - 12
apps/web-velofex/src/views/dashboard/delivery-partners/index.vue

@@ -428,40 +428,34 @@ onMounted(() => {
             title: $t('deliveryPartners.modal.account'),
             dataIndex: 'account',
             key: 'account',
-            width: 130,
           },
           {
             title: $t('deliveryPartners.modal.name'),
             dataIndex: 'name',
-            width: 130,
             key: 'name',
           },
           {
             title: $t('deliveryPartners.modal.expiredTime'),
             dataIndex: 'expiredTime',
             key: 'expiredTime',
-            width: 130,
           },
           {
             title: $t('deliveryPartners.modal.cellPhone'),
             dataIndex: 'cellPhone',
-            width: 130,
             key: 'cellPhone',
           },
           {
             title: $t('deliveryPartners.modal.emailAddress'),
             dataIndex: 'emailAddress',
-            width: 130,
             key: 'emailAddress',
           },
-          {
-            title: $t('deliveryPartners.accessId'),
-            dataIndex: 'accessId',
-            key: 'accessId',
-          },
+          // {
+          //   title: $t('deliveryPartners.accessId'),
+          //   dataIndex: 'accessId',
+          //   key: 'accessId',
+          // },
           {
             title: $t('deliveryPartners.status'),
-            width: 130,
             key: 'status',
           },
           {
@@ -471,7 +465,7 @@ onMounted(() => {
         ]"
         :data-source="userList"
         :loading="loading"
-        :show-size-changer="false"
+        :pagination="false"
         class="mt-[38px]"
       >
         <template #bodyCell="{ column, record }">

+ 10 - 1
apps/web-velofex/src/views/dashboard/home/application-management.vue

@@ -40,6 +40,10 @@ async function fetchApplicationList() {
           name: 'isEnable',
           value: 1,
         },
+        {
+          name: 'type',
+          value: 'application',
+        },
       ],
     });
     if (result?.result?.model) {
@@ -57,7 +61,12 @@ function handleMore() {
     loginModalStore.open();
     return;
   }
-  router.push('/application-management');
+  router.push({
+    path: '/application-management',
+    query: {
+      type: '1',
+    },
+  });
 }
 
 watch(

+ 77 - 33
apps/web-velofex/src/views/dashboard/home/product-list.vue

@@ -1,5 +1,78 @@
 <script setup lang="ts">
+import { computed, ref, watch } from 'vue';
+import { useRouter } from 'vue-router';
+
+import { useUserStore } from '@vben/stores';
+
 import { $t } from '@/locales';
+
+import { getMyApplicationListApi, type UserApi } from '#/api';
+import { useLoginModalStore } from '#/store';
+
+const applicationList = ref<UserApi.ApplicationModel[]>([]);
+const loginModalStore = useLoginModalStore();
+const router = useRouter();
+const userStore = useUserStore();
+const isLogin = computed(() => !!userStore.userInfo);
+const loading = ref(false);
+
+async function fetchApplicationList() {
+  if (!isLogin.value) {
+    return;
+  }
+
+  try {
+    loading.value = true;
+    const result = await getMyApplicationListApi({
+      currentPage: 1,
+      pageSize: 6,
+      orderByProperty: 'name',
+      Ascending: true,
+      totalPage: 1,
+      totalCount: 1,
+      filters: [
+        {
+          name: 'isEnable',
+          value: 1,
+        },
+        {
+          name: 'type',
+          value: 'product',
+        },
+      ],
+    });
+    if (result?.result?.model) {
+      applicationList.value = result.result.model;
+    }
+  } catch (error) {
+    console.error('获取应用列表失败:', error);
+  } finally {
+    loading.value = false;
+  }
+}
+
+function handleMore() {
+  if (!isLogin.value) {
+    loginModalStore.open();
+    return;
+  }
+  router.push({
+    path: '/application-management',
+    query: {
+      type: '2',
+    },
+  });
+}
+
+watch(
+  () => isLogin.value,
+  (newValue) => {
+    if (newValue) {
+      fetchApplicationList();
+    }
+  },
+  { immediate: true },
+);
 </script>
 
 <template>
@@ -9,47 +82,18 @@ import { $t } from '@/locales';
     </h2>
     <div class="flex flex-wrap gap-[18px]">
       <div
+        v-for="(item, index) in applicationList"
+        :key="index"
         class="mt-[24px] flex cursor-pointer items-center rounded-[30px] border border-gray-200 bg-white px-[24px] py-[7px] shadow-md"
       >
         <img
+          :src="`/File/Download?fileId=${item.imgPhotoFileId}`"
           class="h-[30px] w-auto object-contain"
-          src="@/assets/image/product1.png"
-        />
-      </div>
-      <div
-        class="mt-[24px] flex cursor-pointer items-center rounded-[30px] border border-gray-200 bg-white px-[24px] py-[7px] shadow-md"
-      >
-        <img
-          class="h-[30px] w-auto object-contain"
-          src="@/assets/image/product2.png"
-        />
-      </div>
-      <div
-        class="mt-[24px] flex cursor-pointer items-center rounded-[30px] border border-gray-200 bg-white px-[24px] py-[7px] shadow-md"
-      >
-        <img
-          class="h-[30px] w-auto object-contain"
-          src="@/assets/image/product3.png"
-        />
-      </div>
-      <div
-        class="mt-[24px] flex cursor-pointer items-center rounded-[30px] border border-gray-200 bg-white px-[24px] py-[7px] shadow-md"
-      >
-        <img
-          class="h-[30px] w-auto object-contain"
-          src="@/assets/image/product4.png"
-        />
-      </div>
-      <div
-        class="mt-[24px] flex cursor-pointer items-center rounded-[30px] border border-gray-200 bg-white px-[24px] py-[7px] shadow-md"
-      >
-        <img
-          class="h-[30px] w-auto object-contain"
-          src="@/assets/image/product5.png"
         />
       </div>
       <div
         class="mt-[24px] flex cursor-pointer items-center rounded-[30px] border border-gray-200 bg-white px-[24px] py-[7px] text-[#810041] shadow-md"
+        @click="handleMore"
       >
         {{ $t('btn.more') }} >
       </div>

+ 7 - 0
apps/web-velofex/src/views/dashboard/home/user-info.vue

@@ -34,6 +34,13 @@ function handleEditProfile() {
   >
     <div class="relative w-[52px]">
       <img
+        v-if="userStore.userInfo?.avatar"
+        :src="`/File/Download?fileId=${userStore.userInfo?.avatar}`"
+        alt=""
+        class="h-[24px] w-auto object-contain"
+      />
+      <img
+        v-else
         alt="user"
         class="h-[52px] w-[52px] object-cover"
         src="@/assets/image/user.png"