huangxw 14 часов назад
Родитель
Сommit
a9d2b3bfd7
2 измененных файлов с 36 добавлено и 12 удалено
  1. 18 6
      src/plant/base/base-detail/index.vue
  2. 18 6
      src/plant/base/base-edit/index.vue

+ 18 - 6
src/plant/base/base-detail/index.vue

@@ -4,7 +4,7 @@
             <ut-navbar title="基地详情" :fixed="false" border></ut-navbar>
             <view class="bg-fff mb-20 pd2-0-24">
                 <view class="pd-5"></view>
-                <ut-tabs v-model="activeTab" :tabs="tabs" mode="btw" @change="changeActiveTab"></ut-tabs>
+                <ut-tabs v-model="activeTab" :tabs="tabs[form?.baseInfo?.baseType]" mode="btw" @change="changeActiveTab"></ut-tabs>
             </view>
         </template>
         <view class="p-rtv">
@@ -335,11 +335,23 @@ import { useClientRequest } from '@/utils/request';
 import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { yes_no, pt_org_type, pt_base_type, pt_water_type, pt_soil_type, pt_soil_texture, pt_light_type, pt_base_form } = toRefs<any>(proxy?.useDict('yes_no', 'pt_org_type', 'pt_base_type', 'pt_water_type', 'pt_soil_type', 'pt_soil_texture', 'pt_light_type', 'pt_base_form'));
-const tabs = reactive([
-    { label: '基本信息', value: 'base' },
-    { label: '地块信息', value: 'plot' },
-    { label: '选址依据及环境信息', value: 'environment' },
-]);
+const tabs = reactive<any>({
+    1: [
+        { label: '基本信息', value: 'base' },
+        { label: '地块信息', value: 'plot' },
+        { label: '选址依据及环境信息', value: 'environment' },
+    ],
+    2: [
+        { label: '基本信息', value: 'base' },
+        { label: '圈舍信息', value: 'plot' },
+        { label: '选址依据及环境信息', value: 'environment' },
+    ],
+    3: [
+        { label: '基本信息', value: 'base' },
+        { label: '培养架信息', value: 'plot' },
+        { label: '环境信息', value: 'environment' },
+    ],
+});
 const activeTab = ref('base');
 const paging = ref<any>(null);
 const mapUnitByBaseType: any = {

+ 18 - 6
src/plant/base/base-edit/index.vue

@@ -4,7 +4,7 @@
             <ut-navbar :title="did && !+form?.baseInfo?.tempFlag ? '编辑基地' : '添加基地'" :fixed="false" border></ut-navbar>
             <view class="bg-fff pd2-0-24">
                 <view class="pd-5"></view>
-                <ut-tabs v-model="activeTab" :tabs="tabs" mode="btw" @change="changeActiveTab"></ut-tabs>
+                <ut-tabs v-model="activeTab" :tabs="tabs[form?.baseInfo?.baseType]" mode="btw" @change="changeActiveTab"></ut-tabs>
             </view>
         </template>
         <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
@@ -475,11 +475,23 @@ import { generateUniqueId } from '@/utils/public';
 import FormPlot from './models/form-plot.vue';
 import { getUrlParams, recursiveDecodeURIComponent } from '@/utils/ruoyi';
 // import { $uGetRect } from 'uview-plus'
-const tabs = reactive([
-    { label: '基本信息', value: 'base' },
-    { label: '地块信息', value: 'plot' },
-    { label: '选址依据及环境信息', value: 'environment' },
-]);
+const tabs = reactive<any>({
+    1: [
+        { label: '基本信息', value: 'base' },
+        { label: '地块信息', value: 'plot' },
+        { label: '选址依据及环境信息', value: 'environment' },
+    ],
+    2: [
+        { label: '基本信息', value: 'base' },
+        { label: '圈舍信息', value: 'plot' },
+        { label: '选址依据及环境信息', value: 'environment' },
+    ],
+    3: [
+        { label: '基本信息', value: 'base' },
+        { label: '培养架信息', value: 'plot' },
+        { label: '环境信息', value: 'environment' },
+    ],
+});
 const activeTab = ref('base');
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { yes_no, pt_org_type, pt_base_type, pt_water_type, pt_soil_type, pt_soil_texture, pt_light_type, pt_capacity_unit } = toRefs<any>(proxy?.useDict('yes_no', 'pt_org_type', 'pt_base_type', 'pt_water_type', 'pt_soil_type', 'pt_soil_texture', 'pt_light_type', 'pt_capacity_unit'));