huangxw 2 semanas atrás
pai
commit
75c875c73d

+ 24 - 18
src/components/ut-confirm-dialog/ut-confirm-dialog.vue

@@ -1,25 +1,31 @@
 // 如果up-popup弹框的遮罩层被覆盖或者是变为白色,需要查看unocss配置,unocss把u-popup__content—transition转化为两个变量了,需要过滤
 <template>
     <up-popup :show="internalShow" mode="center" :round="16" :closeable="false" @close="handleClose" bgColor="transparent">
-        <view class="confirm-dialog" :style="{width}">
+        <view class="confirm-dialog" :style="{ width }">
             <!-- 标题区域 -->
-            <view class="dialog-header pd-32">
-                <text class="dialog-title f-s-32 f-w-6 c-#333">{{ title }}</text>
-                <up-icon v-if="closeable" name="close" size="20" color="#999" class="close-icon" @click="handleClose" />
-            </view>
+            <slot name="title">
+                <view class="dialog-header pd-32">
+                    <text class="dialog-title f-s-32 f-w-6 c-#333">{{ title }}</text>
+                    <up-icon v-if="closeable" name="close" size="20" color="#999" class="close-icon" @click="handleClose" />
+                </view>
+            </slot>
             <!-- 内容区域(slot插槽) -->
-            <view class="dialog-content pd-32 pt-0">
-                <slot></slot>
-            </view>
+            <slot name="content">
+                <view class="dialog-content pd-32 pt-0">
+                    <slot></slot>
+                </view>
+            </slot>
             <!-- 按钮区域 -->
-            <view class="dialog-footer pd-32 pt-0">
-                <up-button v-if="showCancel" class="cancel-btn" :style="{ backgroundColor: cancelBgColor, color: cancelColor }" :customStyle="{ height: '80rpx', fontSize: '32rpx', borderRadius: '8rpx', flex: 1 }" @click="handleCancel">
-                    {{ cancelText }}
-                </up-button>
-                <up-button class="confirm-btn" :style="{ backgroundColor: confirmBgColor, color: confirmColor }" :customStyle="{ height: '80rpx', fontSize: '32rpx', borderRadius: '8rpx', flex: 1, marginLeft: showCancel ? '24rpx' : '0' }" @click="handleConfirm">
-                    {{ confirmText }}
-                </up-button>
-            </view>
+            <slot name="footer">
+                <view class="dialog-footer pd-32 pt-0">
+                    <up-button v-if="showCancel" class="cancel-btn" :style="{ backgroundColor: cancelBgColor, color: cancelColor }" :customStyle="{ height: '80rpx', fontSize: '32rpx', borderRadius: '8rpx', flex: 1 }" @click="handleCancel">
+                        {{ cancelText }}
+                    </up-button>
+                    <up-button class="confirm-btn" :style="{ backgroundColor: confirmBgColor, color: confirmColor }" :customStyle="{ height: '80rpx', fontSize: '32rpx', borderRadius: '8rpx', flex: 1, marginLeft: showCancel ? '24rpx' : '0' }" @click="handleConfirm">
+                        {{ confirmText }}
+                    </up-button>
+                </view>
+            </slot>
         </view>
     </up-popup>
 </template>
@@ -62,7 +68,7 @@ const props = withDefaults(defineProps<Props>(), {
     confirmBgColor: '#37A954',
     confirmColor: '#fff',
     showCancel: true,
-    width: 'auto'
+    width: 'auto',
 });
 
 const emit = defineEmits<{
@@ -115,7 +121,7 @@ const handleConfirm = () => {
     flex-direction: column;
     background-color: #fff;
     border-radius: 16rpx;
-    overflow: hidden;
+    // overflow: hidden;
 
     .dialog-header {
         display: flex;

+ 1 - 1
src/pages/plant/base/index.vue

@@ -298,7 +298,7 @@ const handleDeleteCancel = () => {
     basetype.value = null;
 };
 const handlechoseConfirm = () => {
-    uni.$u.route({ type: 'navigateTo', url: '/plant/base/base-edit/index', params: { basetype: basetype.value } });
+    uni.$u.route({ type: 'navigateTo', url: '/plant/base/base-edit/index', params: { baseType: basetype.value } });
 };
 
 onMounted(() => {

+ 79 - 30
src/plant/base/base-edit/index.vue

@@ -16,15 +16,10 @@
                 <up-alert type="primary" fontSize="24rpx" description="注意:基地不强制与品种挂钩!基地地址以行政村为界,可成片集中或相对集中,跨村则视为另一基地(连片跨村除外)。"></up-alert>
                 <view class="pd-10"></view>
                 <view class="h-1" id="baseTypepppp"></view>
-                <ut-action-sheet v-model="form.baseInfo.baseType" :tabs="pt_base_type" title="选择基地类型">
-                    <up-form-item borderBottom label="基地类型" required prop="baseType">
-                        <view v-if="form.baseInfo.baseType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_base_type, form.baseInfo.baseType) }}</view>
-                        <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择基地类型</view>
-                        <template #right>
-                            <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
-                        </template>
-                    </up-form-item>
-                </ut-action-sheet>
+                <up-form-item borderBottom label="基地类型" required prop="baseType">
+                    <view v-if="form.baseInfo.baseType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_base_type, form.baseInfo.baseType) }}</view>
+                    <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择基地类型</view>
+                </up-form-item>
                 <!-- 基地名称 -->
                 <view class="h-1" id="baseNamepppp"></view>
                 <up-form-item borderBottom label="基地名称" required prop="baseName">
@@ -126,7 +121,7 @@
                     <view class="startline-title">地块信息</view>
                 </view>
                 <view class="pd-24 bg-#fff">
-                    <up-button type="primary" text="确定" plain>
+                    <up-button @click="addPlot({ landType: form.baseInfo.baseType, areaUnit: form.baseInfo.gapInfo.areaUnit }, '添加地块')" type="primary" text="确定" plain>
                         <up-icon class="mr-10" name="plus" color="#37A954"></up-icon>
                         <span>添加地块信息</span>
                     </up-button>
@@ -137,7 +132,7 @@
                     <view class="startline-title">圈舍信息</view>
                 </view>
                 <view class="pd-24 bg-#fff">
-                    <up-button type="primary" text="确定" plain>
+                    <up-button @click="addPlot({ landType: form.baseInfo.baseType, areaUnit: form.baseInfo.gapInfo.areaUnit }, '添加圈舍')" type="primary" text="确定" plain>
                         <up-icon class="mr-10" name="plus" color="#37A954"></up-icon>
                         <span>添加圈舍信息</span>
                     </up-button>
@@ -148,7 +143,7 @@
                     <view class="startline-title">组培架信息</view>
                 </view>
                 <view class="pd-24 bg-#fff">
-                    <up-button type="primary" text="确定" plain>
+                    <up-button @click="addPlot({ landType: form.baseInfo.baseType, areaUnit: form.baseInfo.gapInfo.areaUnit, capacityUnit: '瓶' }, '添加组培架')" type="primary" text="确定" plain>
                         <up-icon class="mr-10" name="plus" color="#37A954"></up-icon>
                         <span>添加组培架信息</span>
                     </up-button>
@@ -175,21 +170,41 @@
                 </view>
                 <view class="pd-24 bg-#fff mb-10">
                     <view class="f-s-32 c-#333 f-w-600">环境信息</view>
-                    <up-form-item label="土壤类型" prop="environmentInfo.soilType" borderBottom>
-                        <up-input v-model="form.environmentInfo.soilType" placeholder="请输入土壤类型" border="none" clearable></up-input>
-                    </up-form-item>
-                    <up-form-item label="土壤质地" prop="environmentInfo.soilTexture" borderBottom>
-                        <up-input v-model="form.environmentInfo.soilTexture" placeholder="请输入土壤质地" border="none" clearable></up-input>
-                    </up-form-item>
+                    <!-- 土壤类型选择 -->
+                    <ut-action-sheet v-model="form.environmentInfo.soilType" :tabs="pt_soil_type" title="选择土壤类型">
+                        <up-form-item borderBottom label="土壤类型" prop="soilType">
+                            <view v-if="form.environmentInfo.soilType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_soil_type, form.environmentInfo.soilType) }}</view>
+                            <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择土壤类型</view>
+                            <template #right>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                            </template>
+                        </up-form-item>
+                    </ut-action-sheet>
+                    <!-- 字典 -->
+                    <ut-action-sheet v-model="form.environmentInfo.soilTexture" :tabs="pt_soil_texture" title="选择土壤质地">
+                        <up-form-item borderBottom label="土壤质地" prop="soilTexture">
+                            <view v-if="form.environmentInfo.soilTexture" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_soil_texture, form.environmentInfo.soilTexture) }}</view>
+                            <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择土壤质地</view>
+                            <template #right>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                            </template>
+                        </up-form-item>
+                    </ut-action-sheet>
                     <up-form-item label="有机质含量" prop="environmentInfo.organic" borderBottom>
                         <up-input v-model="form.environmentInfo.organic" placeholder="请输入有机质含量" border="none" clearable></up-input>
                     </up-form-item>
                     <up-form-item label="土壤PH值" prop="environmentInfo.soilPh" borderBottom>
                         <up-input v-model="form.environmentInfo.soilPh" placeholder="请输入土壤PH值" border="none" clearable></up-input>
                     </up-form-item>
-                    <up-form-item label="水源类型" prop="environmentInfo.waterType" borderBottom>
-                        <up-input v-model="form.environmentInfo.waterType" placeholder="请输入水源类型" border="none" clearable></up-input>
-                    </up-form-item>
+                    <ut-action-sheet v-model="form.environmentInfo.waterType" :tabs="pt_water_type" title="选择水源类型">
+                        <up-form-item borderBottom label="水源类型" prop="waterType">
+                            <view v-if="form.environmentInfo.waterType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_water_type, form.environmentInfo.waterType) }}</view>
+                            <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择水源类型</view>
+                            <template #right>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                            </template>
+                        </up-form-item>
+                    </ut-action-sheet>
                     <up-form-item label="无霜期" prop="environmentInfo.notFrost" borderBottom>
                         <up-input v-model="form.environmentInfo.notFrost" placeholder="请输入无霜期" border="none" clearable></up-input>
                         <template #right>
@@ -263,9 +278,16 @@
                 </view>
                 <view class="pd-24 bg-#fff mb-10">
                     <view class="f-s-32 c-#333 f-w-600">环境信息</view>
-                    <up-form-item label="水源类型" prop="environmentInfo.waterType" borderBottom>
-                        <up-input v-model="form.environmentInfo.waterType" placeholder="请输入水源类型" border="none" clearable></up-input>
-                    </up-form-item>
+                    <ut-action-sheet v-model="form.environmentInfo.waterType" :tabs="pt_water_type" title="选择水源类型">
+                        <up-form-item borderBottom label="水源类型" prop="waterType">
+                            <view v-if="form.environmentInfo.waterType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_water_type, form.environmentInfo.waterType) }}</view>
+                            <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择水源类型</view>
+                            <template #right>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                            </template>
+                        </up-form-item>
+                    </ut-action-sheet>
+
                     <up-form-item label="无霜期" prop="environmentInfo.notFrost" borderBottom>
                         <up-input v-model="form.environmentInfo.notFrost" placeholder="请输入无霜期" border="none" clearable></up-input>
                         <template #right>
@@ -365,12 +387,15 @@
         </template>
     </z-paging>
     <ut-picker-area v-model:show="showArea" v-model="form.baseInfo.gapInfo.adcode" @confirm="confirmArea"></ut-picker-area>
+    <FormPlot v-if="showPlot" v-model:show="showPlot" v-model="rowForm" :title="plotTitle" :dict="{ pt_light_type, pt_capacity_unit }"></FormPlot>
 </template>
 <script setup lang="ts">
 import { useUserStore } from '@/store';
 import { useClientRequest } from '@/utils/request';
 import { isOpenSetting } from '@/utils/common';
 import { generateUniqueId } from '@/utils/public';
+import FormPlot from './models/form-plot.vue';
+
 const tabs = reactive([
     { label: '基本信息', value: 'base' },
     { label: '地块信息', value: 'plot' },
@@ -378,10 +403,13 @@ const tabs = reactive([
 ]);
 const activeTab = ref('base');
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { yes_no, pt_org_type, pt_base_type } = toRefs<any>(proxy?.useDict('yes_no', 'pt_org_type', 'pt_base_type'));
+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'));
 const paging = ref<any>(null);
 const upFormRef = ref<any>(null);
 const showArea = ref(false);
+const showPlot = ref(false);
+const plotTitle = ref('添加地块信息');
+const rowForm = ref<any>(null);
 const form = ref<any>({
     baseInfo: {
         baseType: '',
@@ -473,15 +501,17 @@ const submitForm = async () => {
 
 const mapDrawArea = async () => {
     uni.$on('mapAreaData', (data: any) => {
+        console.log(data);
+
         // 这里可以将 data 赋值给 form 中的相应字段
         form.value.baseInfo.gapInfo.basePic = data.gapInfo.basePic;
         form.value.baseInfo.gapInfo.area = String(data.gapInfo.area);
         form.value.baseInfo.gapInfo.areaUnit = data.gapInfo.areaUnit;
         form.value.baseInfo.coordinates = data.coordinates;
-        form.value.baseInfo.gapInfo.lng = data.gapInfo.lng;
-        form.value.baseInfo.gapInfo.lat = data.gapInfo.lat;
-        form.value.baseInfo.lnglat = `${data.gapInfo.lng},${data.gapInfo.lat}`;
-        form.value.baseInfo.zoom = data.zoom;
+        form.value.baseInfo.gapInfo.lng = data.mapInfo.lng;
+        form.value.baseInfo.gapInfo.lat = data.mapInfo.lat;
+        form.value.baseInfo.lnglat = `${data.mapInfo.lng},${data.mapInfo.lat}`;
+        form.value.baseInfo.zoom = data.mapInfo.zoom;
         uni.$off('mapAreaData');
     });
     if (form.value.baseInfo.gapInfo?.basePic) {
@@ -556,7 +586,26 @@ const getLocationByAddress = async () => {
         lat: location.latitude,
     };
 };
-
+const addPlot = (rowItem: any, title = '添加地块') => {
+    console.log(rowItem, '+dadas');
+    
+    rowForm.value = {
+        ...rowItem,
+    };
+    plotTitle.value = title;
+    showPlot.value = true;
+};
+const mapUnitByBaseType: any = {
+    '1': '亩',
+    '2': '平方米',
+    '3': '平方米',
+};
+onLoad((options: any) => {
+    form.value.baseInfo.baseType = options.baseType || '1';
+    form.value.baseInfo.gapInfo.areaUnit = mapUnitByBaseType[options.baseType || '1'];
+    console.log(options, mapUnitByBaseType[options.baseType || '1']);
+    
+});
 </script>
 <style lang="scss" scoped>
 .z-paging-wrap {

+ 303 - 0
src/plant/base/base-edit/models/form-plot.ts

@@ -0,0 +1,303 @@
+/**
+ * BaseAllAddDTO,种植端基地添加对象 pt_base
+ */
+export interface Request {
+    baseInfo?: BaseAddDTO;
+    environmentInfo?: BaseEnvironmentAddDTO;
+    /**
+     * 地块信息
+     */
+    landInfoList?: BaseLandInfoAddDTO[];
+    /**
+     * 是否暂存
+     */
+    tempFlag?: string;
+    [property: string]: any;
+}
+
+/**
+ * BaseAddDTO,种植端基地添加对象 pt_base
+ */
+export interface BaseAddDTO {
+    /**
+     * 基地编码
+     */
+    baseCode?: string;
+    /**
+     * 基地名称
+     */
+    baseName: string;
+    /**
+     * 基地类型
+     */
+    baseType: string;
+    /**
+     * 建设时间
+     */
+    buildDate: string;
+    /**
+     * 基地负责人
+     */
+    contactId?: number;
+    /**
+     * 基地联系电话
+     */
+    contactTel?: string;
+    /**
+     * 坐标系
+     */
+    coordinates?: Array<PointDTO[]>;
+    /**
+     * 是否GAP基地 0否 1是
+     */
+    gapFlag: string;
+    /**
+     * 基地ID
+     */
+    gapId?: number;
+    gapInfo?: GapRefBaseInfoDTO;
+    id?: number;
+    /**
+     * 基地组织方式
+     */
+    orgType: string;
+    /**
+     * 随机编码
+     */
+    randomCode?: string;
+    /**
+     * 是否暂存
+     */
+    tempFlag?: string;
+    [property: string]: any;
+}
+
+/**
+ * PointDTO
+ */
+export interface PointDTO {
+    lat?: number;
+    lng?: number;
+    [property: string]: any;
+}
+
+/**
+ * GapRefBaseInfoDTO,GAP认证信息关联基地视图对象
+ */
+export interface GapRefBaseInfoDTO {
+    /**
+     * 行政区划代码
+     */
+    adcode?: string;
+    /**
+     * 详细地址
+     */
+    address?: string;
+    /**
+     * 认证面积
+     */
+    area?: number;
+    /**
+     * 认证面积单位
+     */
+    areaUnit?: string;
+    /**
+     * 基地图片
+     */
+    basePic?: string;
+    /**
+     * 基地名称
+     */
+    gapBaseName?: string;
+    /**
+     * 主键
+     */
+    id?: number;
+    /**
+     * 纬度
+     */
+    lat?: number;
+    /**
+     * 经度
+     */
+    lng?: number;
+    /**
+     * 药材ID
+     */
+    medicineId?: number;
+    /**
+     * 药材名称
+     */
+    medicineName?: string;
+    /**
+     * 获评时间
+     */
+    ratedDate?: Date;
+    [property: string]: any;
+}
+
+/**
+ * BaseEnvironmentAddDTO,基地环境信息添加对象 pt_base_environment
+ */
+export interface BaseEnvironmentAddDTO {
+    /**
+     * 选址依据
+     */
+    accordFile?: AccesseryDTO[];
+    /**
+     * 选址适应性材料
+     */
+    adaptFile?: AccesseryDTO[];
+    /**
+     * 海拔
+     */
+    altitude?: string;
+    /**
+     * 年平均气温
+     */
+    avgTem?: string;
+    /**
+     * 基地ID
+     */
+    baseId?: number;
+    /**
+     * 基地图片
+     */
+    basePic?: string;
+    /**
+     * 基地视频
+     */
+    baseVoice?: AccesseryDTO[];
+    /**
+     * 是否道地场区
+     */
+    daoStatus?: string;
+    /**
+     * 年绝对最高气温
+     */
+    maxTem?: string;
+    /**
+     * 年绝对最低气温
+     */
+    minTem?: string;
+    /**
+     * 无霜期
+     */
+    notFrost?: string;
+    /**
+     * 有机质含量
+     */
+    organic?: string;
+    /**
+     * 年降水量
+     */
+    precipitation?: string;
+    /**
+     * 水、土壤、大气等环评报告
+     */
+    report?: AccesseryDTO[];
+    /**
+     * 土壤PH值
+     */
+    soilPh?: string;
+    /**
+     * 土壤质地
+     */
+    soilTexture?: string;
+    /**
+     * 土壤类型
+     */
+    soilType?: string;
+    /**
+     * 年日照时数
+     */
+    sunshineHours?: string;
+    /**
+     * 是否暂存
+     */
+    tempFlag?: string;
+    /**
+     * 水源类型
+     */
+    waterType?: string;
+    [property: string]: any;
+}
+
+/**
+ * AccesseryDTO,2025-03-10 10:14:28
+ * 附件DTO
+ */
+export interface AccesseryDTO {
+    /**
+     * 文件名称
+     */
+    fileName?: string;
+    /**
+     * 文件大小
+     */
+    fileSize?: number;
+    /**
+     * 文件URL
+     */
+    url?: string;
+    [property: string]: any;
+}
+
+/**
+ * BaseLandInfoAddDTO,基地地块添加对象 pt_base_land_info
+ */
+export interface BaseLandInfoAddDTO {
+    /**
+     * 面积
+     */
+    area?: number;
+    /**
+     * 面积单位
+     */
+    areaUnit?: string;
+    /**
+     * 基地ID
+     */
+    baseId: number;
+    /**
+     * 每层容量
+     */
+    capacityAmount?: number;
+    /**
+     * 容量单位
+     */
+    capacityUnit?: string;
+    /**
+     * 负责人ID
+     */
+    contact?: number;
+    /**
+     * 负责人名称
+     */
+    contactName?: string;
+    /**
+     * 地块名称/编号
+     */
+    landName: string;
+    /**
+     * 地块类型
+     */
+    landType?: string;
+    /**
+     * 层数
+     */
+    layers?: number;
+    /**
+     * 光照类型
+     */
+    lightType?: string;
+    /**
+     * 是否有独立温控
+     */
+    tempeStatus?: string;
+    /**
+     * 是否暂存
+     */
+    tempFlag?: string;
+    [property: string]: any;
+}

+ 190 - 0
src/plant/base/base-edit/models/form-plot.vue

@@ -0,0 +1,190 @@
+<template>
+    <ut-confirm-dialog v-model:show="visable" :title="title" width="680rpx">
+        <template #content>
+            <scroll-view scroll-y class="scroll-view-content" style="max-height: 60vh">
+                <view class="p-rtv pd4-0-24-24-24">
+                    <up-form ref="formRef" :model="form" :rules="rules" labelWidth="auto" class="p-rtv" labelPosition="top">
+                        <up-form-item label="名称/编号" prop="landName" required borderBottom>
+                            <up-input v-model="form.landName" placeholder="请输入名称/编号" border="none" clearable />
+                        </up-form-item>
+                        <template v-if="['1', '2'].includes(form.landType as string)">
+                            <up-form-item label="面积" prop="area" required borderBottom>
+                                <up-input v-model="form.area" placeholder="请输入面积" border="none" clearable />
+                                <template #right>
+                                    <span>{{ form.areaUnit || '亩' }}</span>
+                                </template>
+                            </up-form-item>
+                        </template>
+                        <template v-if="['3'].includes(form.landType as string)">
+                            <up-form-item label="层数" prop="layers" required borderBottom>
+                                <up-input v-model="form.layers" placeholder="请输入层数" border="none" clearable />
+                            </up-form-item>
+                            <up-form-item label="每层容量" prop="capacityAmount" required borderBottom>
+                                <up-input v-model="form.capacityAmount" placeholder="请输入每层容量" border="none" clearable />
+                                <template #right>
+                                    <span>{{ form.capacityUnit || '瓶' }}</span>
+                                </template>
+                            </up-form-item>
+                            <!-- 光照类型 -->
+                            <up-form-item label="光照类型" prop="lightType" borderBottom>
+                                <up-radio-group v-model="form.lightType" direction="row">
+                                    <up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in pt_light_type" :key="index" :label="item.label" :name="item.value"></up-radio>
+                                </up-radio-group>
+                            </up-form-item>
+                        </template>
+                        <up-form-item @click="selectCpyMember" borderBottom label="负责人" prop="contact">
+                            <view v-if="form.contact" class="f-s-30 c-333 f-w-5 flex1">{{ form.contactName }}</view>
+                            <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择负责人</view>
+                            <template #right>
+                                <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                            </template>
+                        </up-form-item>
+                    </up-form>
+                </view>
+            </scroll-view>
+        </template>
+        <template #footer>
+            <view class="pd-24 d-flex a-c">
+                <up-button class="mr-16">取消</up-button>
+                <up-button type="primary">添加</up-button>
+            </view>
+        </template>
+    </ut-confirm-dialog>
+</template>
+
+<script setup lang="ts" name="FormPlot">
+import { BaseLandInfoAddDTO } from './form-plot';
+const props = withDefaults(
+    defineProps<{
+        show: boolean;
+        title?: string;
+        modelValue?: BaseLandInfoAddDTO;
+        dict: any;
+    }>(),
+    {
+        show: false,
+        title: '新增地块',
+        dict: () => ({}),
+        modelValue: () => ({
+            landName: '',
+            area: undefined,
+            areaUnit: '亩',
+            baseId: 0,
+            capacityAmount: undefined,
+            capacityUnit: '株',
+            contact: undefined,
+            contactName: '',
+            landType: '',
+            layers: undefined,
+            lightType: '',
+            tempeStatus: '',
+            tempFlag: '',
+        }),
+    }
+);
+const { pt_base_type, pt_light_type } = toRefs(props.dict);
+const visable = ref(props.show);
+const emit = defineEmits<{
+    'update:show': [value: boolean];
+    close: [];
+    submit: [data: BaseLandInfoAddDTO];
+}>();
+
+const formRef = ref();
+const submitting = ref(false);
+const form = reactive<BaseLandInfoAddDTO>({
+    landName: '',
+    area: undefined,
+    areaUnit: '亩',
+    baseId: 0,
+    capacityAmount: undefined,
+    capacityUnit: '株',
+    contact: undefined,
+    contactName: '',
+    landType: '',
+    layers: undefined,
+    lightType: '',
+    tempeStatus: '',
+    tempFlag: '',
+});
+const selectCpyMember = () => {
+    uni.showToast({
+        title: '选择负责人功能待实现',
+        icon: 'none',
+    });
+};
+const rules = reactive({
+    landName: [{ required: true, message: '请输入名称/编号' }],
+    area: [
+        {
+            required: ['1', '2'].includes(form.landType as string),
+            message: '请输入面积',
+        },
+    ],
+    layers: [
+        {
+            required: form.landType === '3',
+            message: '请输入层数',
+        },
+    ],
+    capacityAmount: [
+        {
+            required: form.landType === '3',
+            message: '请输入每层容量',
+        },
+    ],
+});
+
+const onClose = () => {
+    emit('update:show', false);
+    emit('close');
+};
+watch(
+    () => props.show,
+    (newVal) => {
+        visable.value = newVal;
+    }
+);
+const onConfirm = async () => {
+    if (submitting.value) return;
+    try {
+        submitting.value = true;
+        // uview-plus 的 up-form 暴露 validate 方法
+        await formRef.value?.validate();
+        emit('submit', form);
+        emit('update:show', false);
+    } catch (e) {
+        // 校验不通过
+    }
+};
+watch(
+    () => props.modelValue,
+    (newVal) => {
+        console.log(newVal, '++++++++++++++++');
+
+        Object.assign(form, newVal);
+    },
+    { immediate: true }
+);
+</script>
+
+<style scoped lang="scss">
+.popup-card {
+    width: 86vw;
+    max-width: 680rpx;
+    background: #fff;
+    border-radius: 16rpx;
+    padding: 24rpx;
+}
+.header {
+    margin-bottom: 12rpx;
+}
+.title {
+    font-size: 32rpx;
+    font-weight: 600;
+}
+.footer {
+    margin-top: 20rpx;
+    gap: 24rpx;
+}
+</style>

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1
stats.html


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff