huangxw 1 settimana fa
parent
commit
91d4714406
1 ha cambiato i file con 11 aggiunte e 9 eliminazioni
  1. 11 9
      src/pages/plant/base/index.vue

+ 11 - 9
src/pages/plant/base/index.vue

@@ -69,10 +69,10 @@
                             </view>
                             <view class="d-flex a-c p-rtv">
                                 <view class="w-220">
-                                    <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
+                                    <ut-action-sheet v-model="form.queryType" :tabs="typeNums" @change="onRefresh" title="选择原料类型">
                                         <view class="d-flex search-select-item a-c">
-                                            <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }} </view>
-                                            <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
+                                            <view class="flex1 ov-hd f-s-26 c-333 text-center f-w-5 w-s-no up-line-1">{{ selectDictLabel(typeNums, form?.queryType) || '全部' }} </view>
+                                            <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="ml-5"></up-icon>
                                         </view>
                                     </ut-action-sheet>
                                 </view>
@@ -350,13 +350,19 @@ const clickTempSwipe = async (event: object) => {
         }
     }
 };
+const typeNums = ref<any[]>([])
 // 获取统计信息
 const getBaseCount = async () => {
     try {
         const res = await useClientRequest.get('/plt-api/app/base/getBaseCount');
         if (res?.code === 200) {
             console.log(res);
-            
+            typeNums.value = res.data?.map((item: any) => {
+                return {
+                    label: `${item.name}(${item.num})`,
+                    value: item.type,
+                };
+            });
         }
     } catch (error) {
         console.error('获取地块统计信息失败:', error);
@@ -367,7 +373,6 @@ onMounted(() => {
     querys
         .select('#topup-navbar')
         .boundingClientRect((data: any) => {
-            console.log(data);
             stickyTop.value = data.top + data.height;
         })
         .exec();
@@ -387,10 +392,7 @@ onShow(() => {
     background-color: #fff;
     border-radius: 10rpx;
     box-sizing: border-box;
-    padding-left: 16rpx;
-    padding-right: 16rpx;
-    padding-top: 14rpx;
-    padding-bottom: 14rpx;
+    padding: 12rpx;
 }
 .temp_flag {
     position: absolute;