浏览代码

优化表单2

快乐的梦鱼 2 月之前
父节点
当前提交
d756836d61

+ 8 - 0
src/api/map/MapApi.ts

@@ -56,6 +56,14 @@ export class MapApi extends MapServerRequestModule<DataModel> {
       })
       .catch(e => { throw e });
   }
+  regeoAddress(lat: number, lng: number, querys?: QueryParams) {
+    return this.get(`/v3/geocode/regeo`, `查询经纬度(${lat}, ${lng})地址`, {
+      location: `${lng},${lat}`,
+      ...querys,
+    })
+      .then(res => (res.data as any).regeocode.formattedAddress as string)
+      .catch(e => { throw e });
+  }
   loadCityData() {
     return new Promise((resolve, reject) => {
       uni.request({

+ 6 - 0
src/common/components/dynamicf/ComponentConfigs.ts

@@ -12,4 +12,10 @@ export default [
       loadDistrictInfo: (latlon: [number, number]) => MapApi.regeo(latlon[0], latlon[1]),
     },
   },
+  {
+    name: 'select-address',
+    props: {
+      loadFormattedAddress: (latlon: [number, number]) => MapApi.regeoAddress(latlon[0], latlon[1]),
+    },
+  },
 ] as IDynamicFormComponentAdditionalDefine[];

+ 3 - 2
src/common/components/form/RichTextEditor.vue

@@ -2,12 +2,12 @@
   <view class="d-flex flex-col">
     <view class="richtext-preview-box" @click="edit">
       <Parse v-if="modelValue" :content="modelValue" containerStyle="max-height:400px" />
-      <text v-else>{{placeholder}}</text>
+      <Text v-else color="text.second">{{placeholder}}</Text>
     </view>
     <view class="d-flex flex-row gap-sss align-center mt-2">
       <Button icon="browse" text="预览" size="small" @click="preview" />
       <Button icon="edit" text="编辑" size="small" @click="edit" type="primary" />
-      <text v-if="maxLength > 0">{{ modelValue?.length || 0 }}/{{ maxLength }} 字</text>
+      <Text v-if="maxLength > 0">{{ modelValue?.length || 0 }}/{{ maxLength }} 字</Text>
     </view>
   </view>
 </template>
@@ -17,6 +17,7 @@ import { onPageShow } from '@dcloudio/uni-app';
 import { navTo } from '@/components/utils/PageAction';
 import Parse from '@/components/display/parse/Parse.vue';
 import Button from '@/components/basic/Button.vue';
+import Text from '@/components/basic/Text.vue';
 
 const props = defineProps({	
   modelValue: { 

+ 9 - 0
src/components/dynamic/DynamicFormControl.vue

@@ -130,6 +130,14 @@
           v-bind="(params as any)"
         />
       </template>
+      <template v-else-if="item.type === 'select-address'">
+        <PickerAddressField
+          ref="itemRef"
+          :modelValue="model"
+          @update:modelValue="onValueChanged"
+          v-bind="(params as any)"
+        />
+      </template>
       <template v-else-if="item.type === 'select-lonlat'">
         <PickerLonlat
           ref="itemRef"
@@ -231,6 +239,7 @@ import Rate, { type RateProps } from '../form/Rate.vue';
 import ComponentConfigs from '@/common/components/dynamicf/ComponentConfigs';
 import ComponentRender from '@/common/components/dynamicf/ComponentRender.vue';
 import type { Rules } from 'async-validator';
+import PickerAddressField from './wrappers/PickerAddressField.vue';
 
 export interface FormCeilProps {
   value: unknown,

+ 3 - 0
src/components/dynamic/wrappers/PickerAddressField.ts

@@ -0,0 +1,3 @@
+export interface PickerCityFieldProps {
+  cityDataUrl?: string;
+}

+ 48 - 0
src/components/dynamic/wrappers/PickerAddressField.vue

@@ -0,0 +1,48 @@
+<template>
+  <FlexRow width="100%" justify="space-between" align="center">
+    <input 
+      :value="modelValue"
+      placeholder="输入地址或者选择地图地址"
+      @input="handleInput"
+    />
+    <Button type="primary" size="mini" icon="map" @click="selectFromMap">地图选择</Button>
+  </FlexRow>
+</template>
+
+<script setup lang="ts">
+import { type PropType } from 'vue';
+import Button from '@/components/basic/Button.vue';
+import FlexRow from '@/components/layout/FlexRow.vue';
+
+const props = defineProps({
+  modelValue: {
+    type: String,
+    default: '',
+  },
+  loadFormattedAddress: {
+    type: Function as PropType<(latlon: [number,number]) => Promise<string>>,
+    default: null,
+  },
+});
+const emit = defineEmits(['update:modelValue']);
+
+function handleInput(e: any) {
+  emit('update:modelValue', e.detail.value);
+}
+function selectFromMap() {
+  uni.chooseLocation({
+    success: (res) => {
+      props.loadFormattedAddress([res.latitude, res.longitude]).then((info) => {
+        console.log(info);
+        emit('update:modelValue', info)
+      })
+    }
+  })
+}
+
+defineOptions({
+  options: {
+    virtualHost: true,
+  }
+})
+</script>

+ 1 - 0
src/components/dynamic/wrappers/PickerLonlat.vue

@@ -25,6 +25,7 @@ function openPicker() {
     latitude: props.modelValue?.[0] || props.defaultLongLat?.[0],
     longitude: props.modelValue?.[1] || props.defaultLongLat?.[1],
     success: (res) => {
+      console.log(res);
       emit('update:modelValue', [res.latitude, res.longitude]);
     },
   });

+ 5 - 0
src/manifest.json

@@ -84,6 +84,11 @@
             "maps" : {
                 "qqmap" : {
                     "key" : "LDXBZ-JIWWC-IXW2S-AUDZS-26VC2-GRBC4"
+                },
+                "amap" : {
+                    "key" : "212b86dc49a5116a34e945d31da7ad14",
+                    "securityJsCode" : "46cae8205a707cfaf5801abcc4301566",
+                    "serviceHost" : ""
                 }
             }
         },

+ 530 - 377
src/pages/dig/forms/data/building.ts

@@ -1,412 +1,565 @@
-import VillageInfoApi, { VillageBulidingInfo } from "@/api/inhert/VillageInfoApi";
+import VillageInfoApi, { CommonInfoModel, VillageBulidingInfo } from "@/api/inhert/VillageInfoApi";
 import type { CheckBoxListProps } from "@/components/dynamic/wrappers/CheckBoxList.vue";
 import type { PickerIdFieldProps } from "@/components/dynamic/wrappers/PickerIdField";
 import type { FieldProps } from "@/components/form/Field.vue";
 import type { SingleForm } from "../forms";
+import type { UploaderFieldProps } from "@/components/form/UploaderField.vue";
+import { useAliOssUploadCo } from "@/common/components/upload/AliOssUploadCo";
+import { villageCommonContent } from "./common";
 
-export const villageInfoBuildingForm : SingleForm = [VillageBulidingInfo, () => ({
-  formItems: [
-    {
-      label: '建筑名称', 
-      name: 'name', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入建筑名称',
-      },
-      rules:  [{
-        required: true,
-        message: '请输入建筑名称',
-      }] 
-    }, 
-    {
-      label: '建筑编码', 
-      name: 'code', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入建筑编码',
+export function villageInfoBuildingForm(title: string) : SingleForm  {
+  return [VillageBulidingInfo, (r) => ({
+    formItems: [
+      
+      {
+        label: '基础信息',
+        name: 'baseInfo',
+        type: 'flat-group',
+        childrenColProps: { span: 24 },
+        children: [
+          {
+            label: '建筑名称', 
+            name: 'name', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: {
+              placeholder: '请输入建筑名称',
+            },
+            rules:  [{
+              required: true,
+              message: '请输入建筑名称',
+            }] 
+          }, 
+          {
+            label: '建筑编码', 
+            name: 'code', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: {
+              placeholder: '请输入建筑编码',
+            },
+            rules:  [{
+              required: true,
+              message: '请输入建筑编码',
+            }] 
+          },
+          {
+            label: '产权归属', 
+            name: 'ownership',
+            type: 'select-id', 
+            additionalProps: {
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(152))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as PickerIdFieldProps,
+            formProps: { showRightArrow: true } as FieldProps,
+            rules: [{
+              required: true,
+              message: '请选择产权归属',
+            }],
+          },
+          {
+            label: '位置', 
+            name: 'position', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: {
+              placeholder: '请输入位置',
+            },
+            rules:  [{
+              required: true,
+              message: '请输入位置',
+            }] 
+          },
+          {
+            label: '建筑类型', 
+            name: 'buildingType',
+            type: 'select-id', 
+            additionalProps: {
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(163))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as PickerIdFieldProps,
+            formProps: { showRightArrow: true } as FieldProps,
+            rules: [{
+              required: true,
+              message: '请选择建筑类型',
+            }],
+          },
+          {
+            label: '其他建筑类型', 
+            name: 'otherBuildingType', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: { placeholder: '其他建筑类型' },
+            show: { callback: (_, m) => m.buildingType == 170 },
+            rules: [{
+              required: true,
+              message: '请输入其他建筑类型',
+            }]
+          },
+        ]
       },
-      rules:  [{
-        required: true,
-        message: '请输入建筑编码',
-      }] 
-    },
-    {
-      label: '产权归属', 
-      name: 'ownership',
-      type: 'select-id', 
-      additionalProps: {
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(152))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as PickerIdFieldProps,
-      formProps: { showRightArrow: true } as FieldProps,
-      rules: [{
-        required: true,
-        message: '请选择产权归属',
-      }],
-    },
-    {
-      label: '位置', 
-      name: 'position', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入位置',
+      {
+        label: '简介和故事',
+        name: 'extraInfo',
+        type: 'flat-group',
+        childrenColProps: { span: 24 },
+        children: [
+          {
+            label: '建筑中的故事', 
+            name: 'story', 
+            type: 'richtext', 
+            defaultValue: '',
+            additionalProps: {
+              placeholder: '请输入建筑中的故事',
+              maxLength: 200,
+              showWordLimit: true, 
+            },
+            rules:  [{
+              required: true,
+              message: '请输入建筑中的故事',
+            }] 
+          },
+          {
+            label: '功能特点', 
+            name: 'funcFeatures', 
+            type: 'richtext', 
+            defaultValue: '',
+            additionalProps: {
+              placeholder: '请输入功能特点',
+              maxLength: 200,
+              showWordLimit: true, 
+            },
+            rules:  [] 
+          },
+          ...villageCommonContent(r, {
+            title: title,
+            showContent: false,
+            showTitle: false,
+          }).formItems
+        ]
       },
-      rules:  [{
-        required: true,
-        message: '请输入位置',
-      }] 
-    },
-    {
-      label: '建筑类型', 
-      name: 'buildingType',
-      type: 'select-id', 
-      additionalProps: {
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(163))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as PickerIdFieldProps,
-      formProps: { showRightArrow: true } as FieldProps,
-      rules: [{
-        required: true,
-        message: '请选择建筑类型',
-      }],
-    },
-    {
-      label: '建筑中的故事', 
-      name: 'story', 
-      type: 'richtext', 
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入建筑中的故事',
-        maxLength: 200,
-        showWordLimit: true, 
+      {
+        label: '详细信息',
+        name: 'detailsInfo',
+        type: 'flat-group',
+        childrenColProps: { span: 24 },
+        children: [
+
+
+          {
+            label: '保护级别', 
+            name: 'protectionLevel',
+            type: 'select-id', 
+            additionalProps: {
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(171))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as PickerIdFieldProps,
+            formProps: { showRightArrow: true } as FieldProps,
+            rules: [{
+              required: true,
+              message: '请选择建筑类型',
+            }],
+          },
+          {
+            label: '其他保护级别', 
+            name: 'otherProtectionLevel', 
+            type: 'text', 
+            defaultValue: '',
+            show: { callback: (_, m) => m.protectionLevel == 177 },
+            additionalProps: { placeholder: '其他保护级别' },
+            rules: [{
+              required: true,
+              message: '请输入其他保护级别',
+            }]
+          },
+          {
+            label: '总占地面积', 
+            name: 'area', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: {
+              placeholder: '请输入总占地面积',
+            },
+            rules:  [{
+              required: true,
+              message: '请输入总占地面积',
+            }] 
+          },
+          {
+            label: '建筑面积', 
+            name: 'buildingArea', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: {
+              placeholder: '请输入建筑面积',
+            },
+            rules:  [{
+              required: true,
+              message: '请输入建筑面积',
+            }] 
+          },
+          {
+            label: '建筑层数', 
+            name: 'floor', 
+            type: 'number', 
+            defaultValue: 0,
+            additionalProps: {
+              min: 0,
+              max: 1000,
+            },
+            rules:  [{
+              required: true,
+              message: '请输入建筑层数',
+            }] 
+          },
+          {
+            label: '所含建筑幢数', 
+            name: 'num', 
+            type: 'number', 
+            defaultValue: 0,
+            additionalProps: {
+              min: 0,
+              max: 1000,
+            },
+            rules:  [{
+              required: true,
+              message: '请输入所含建筑幢数',
+            }] 
+          },
+          {
+            label: '始建时间(年)', 
+            name: 'age', 
+            type: 'number', 
+            defaultValue: 2025,
+            additionalProps: {
+              min: -50000,
+              max: 2000,
+            },
+            rules:  [{
+              required: true,
+              message: '请输入始建时间',
+            }] 
+          },
+          {
+            label: '承重结构(多选)', 
+            name: 'bearingType', 
+            type: 'check-box-list', 
+            additionalProps: {
+              multiple: true,
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(246))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as CheckBoxListProps,
+            defaultValue: [],
+            rules: [{
+              required: true,
+              message: '请选择类型',
+            }],
+          },
+          {
+            label: '其他承重结构类型', 
+            name: 'otherBearing', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: { placeholder: '其他承重结构类型' },
+            rules: []
+          },
+          {
+            label: '居民建筑类型', 
+            name: 'residentialBuildingType', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: { placeholder: '居民建筑类型' },
+            rules: []
+          },
+          {
+            label: '修缮过程', 
+            name: 'repairProcess', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '修缮过程',
+              maxLength: 200,
+              showWordLimit: true, 
+             },
+            rules: []
+          },
+          {
+            label: '建筑风貌', 
+            name: 'architecturalStyle', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '建筑风貌',
+              maxLength: 200,
+              showWordLimit: true, 
+             },
+            rules: []
+          },
+          {
+            label: '院落布局', 
+            name: 'layout', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '院落布局',
+              maxLength: 200,
+              showWordLimit: true, 
+             },
+            rules: []
+          },
+        ]
       },
-      rules:  [{
-        required: true,
-        message: '请输入建筑中的故事',
-      }] 
-    },
-    {
-      label: '保护级别', 
-      name: 'protectionLevel',
-      type: 'select-id', 
-      additionalProps: {
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(171))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as PickerIdFieldProps,
-      formProps: { showRightArrow: true } as FieldProps,
-      rules: [{
-        required: true,
-        message: '请选择建筑类型',
-      }],
-    },
-    {
-      label: '总占地面积', 
-      name: 'area', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入总占地面积',
+      
+      {
+        label: '建筑做法',
+        name: 'detailsInfo',
+        type: 'flat-group',
+        childrenColProps: { span: 24 },
+        children: [
+          {
+            label: '屋面形式(多选)', 
+            name: 'roofForm', 
+            type: 'check-box-list', 
+            additionalProps: {
+              multiple: true,
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(264))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as CheckBoxListProps,
+            defaultValue: [],
+            rules: [],
+          },
+          {
+            label: '屋面形式说明', 
+            name: 'roofDescribe', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '屋面形式说明',
+              maxLength: 200,
+              showWordLimit: true, 
+            },
+            rules: []
+          },
+          {
+            label: '围护墙体(多选)', 
+            name: 'wallType', 
+            type: 'check-box-list', 
+            additionalProps: {
+              multiple: true,
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(271))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as CheckBoxListProps,
+            defaultValue: [],
+            rules: [],
+          },
+          {
+            label: '围护墙体说明', 
+            name: 'otherBuildingType', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '围护墙体说明',
+              maxLength: 200,
+              showWordLimit: true, 
+            },
+            rules: []
+          },
+          {
+            label: '地面做法(多选)', 
+            name: 'floorType', 
+            type: 'check-box-list', 
+            additionalProps: {
+              multiple: true,
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(258))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as CheckBoxListProps,
+            defaultValue: [],
+            rules: [],
+          },
+          {
+            label: '地面做法说明', 
+            name: 'floorDescribe', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '地面做法说明',
+              maxLength: 200,
+              showWordLimit: true, 
+             },
+            rules: []
+          },
+          {
+            label: '特殊工艺做法', 
+            name: 'specialProcess', 
+            type: 'text', 
+            defaultValue: '',
+            additionalProps: { placeholder: '特殊工艺做法' },
+            rules: []
+          },
+        ]
       },
-      rules:  [{
-        required: true,
-        message: '请输入总占地面积',
-      }] 
-    },
-    {
-      label: '建筑面积', 
-      name: 'buildingArea', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入建筑面积',
+      {
+        label: '建筑用途',
+        name: 'detailsInfo',
+        type: 'flat-group',
+        childrenColProps: { span: 24 },
+        children: [
+          {
+            label: '历史功能', 
+            name: 'funcHistory', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '历史功能',
+              maxLength: 200,
+              showWordLimit: true, 
+            },
+            rules: []
+          },
+          {
+            label: '现状用途(多选)', 
+            name: 'purpose', 
+            type: 'check-box-list', 
+            additionalProps: {
+              multiple: true,
+              loadData: async () => 
+              (await VillageInfoApi.getCategoryChildList(252))
+                .map((p) => ({
+                  value: p.id,
+                  text: p.title,
+                }))
+              ,
+            } as CheckBoxListProps,
+            defaultValue: [],
+            rules: [],
+          },
+          {
+            label: '其他现状用途', 
+            name: 'otherPurpose', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '其他现状用途',
+              maxLength: 200,
+              showWordLimit: true, 
+            },
+            rules: []
+          },
+          {
+            label: '改扩建情况及维修状况', 
+            name: 'repair', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '改扩建情况及维修状况',
+              maxLength: 200,
+              showWordLimit: true, 
+            },
+            rules: []
+          },
+          {
+            label: '改扩建情况及维修状况说明', 
+            name: 'repairDescribe', 
+            type: 'textarea', 
+            defaultValue: '',
+            additionalProps: { 
+              placeholder: '改扩建情况及维修状况说明',
+              maxLength: 200,
+              showWordLimit: true, 
+             },
+            rules: []
+          },
+        ]
       },
-      rules:  [{
-        required: true,
-        message: '请输入建筑面积',
-      }] 
-    },
-    {
-      label: '建筑层数', 
-      name: 'floor', 
-      type: 'number', 
-      defaultValue: 0,
-      additionalProps: {
-        min: 0,
-        max: 1000,
-      },
-      rules:  [{
-        required: true,
-        message: '请输入建筑层数',
-      }] 
-    },
+    ] 
+  })]
+}
+
+export const villageInfoDistributionForm : SingleForm = [CommonInfoModel, (r) => ({
+  formItems: [
     {
-      label: '所含建筑幢数', 
+      label: '建筑数量', 
       name: 'num', 
       type: 'number', 
-      defaultValue: 0,
+      defaultValue: '',
       additionalProps: {
         min: 0,
-        max: 1000,
+        max: 100,
       },
       rules:  [{
         required: true,
-        message: '请输入所含建筑幢数',
+        message: '请输入建筑数量',
       }] 
-    },
+    }, 
     {
-      label: '始建时间(年)', 
-      name: 'age', 
-      type: 'number', 
-      defaultValue: 2025,
+      label: '分布图', 
+      name: 'distribution', 
+      type: 'uploader', 
+      defaultValue: '',
       additionalProps: {
-        min: -50000,
-        max: 2000,
-      },
+        upload: useAliOssUploadCo('xiangyuan/distribution'),
+        maxFileSize: 1024 * 1024 * 20,
+        single: true,
+      } as UploaderFieldProps,
       rules:  [{
         required: true,
-        message: '请输入始建时间',
+        message: '请上传分布图',
       }] 
-    },
+    }, 
     {
-      label: '功能特点', 
-      name: 'funcFeatures', 
+      label: '营造智慧', 
+      name: 'wisdom', 
       type: 'richtext', 
       defaultValue: '',
       additionalProps: {
-        placeholder: '请输入功能特点',
+        placeholder: '请输入营造智慧',
         maxLength: 200,
         showWordLimit: true, 
       },
       rules:  [{
         required: true,
-        message: '请输入功能特点',
+        message: '请输入营造智慧',
       }] 
-    },
-    {
-      label: '承重结构(多选)', 
-      name: 'bearingType', 
-      type: 'check-box-list', 
-      additionalProps: {
-        multiple: true,
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(246))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as CheckBoxListProps,
-      defaultValue: [],
-      rules: [{
-        required: true,
-        message: '请选择类型',
-      }],
-    },
-    {
-      label: '其他建筑类型', 
-      name: 'otherBuildingType', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '其他建筑类型' },
-      rules: []
-    },
-    {
-      label: '居民建筑类型', 
-      name: 'residentialBuildingType', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '居民建筑类型' },
-      rules: []
-    },
-    {
-      label: '其他保护级别', 
-      name: 'otherProtectionLevel', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '其他保护级别' },
-      rules: []
-    },
-    {
-      label: '修缮过程', 
-      name: 'repairProcess', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '修缮过程' },
-      rules: []
-    },
-    {
-      label: '建筑风貌', 
-      name: 'architecturalStyle', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '建筑风貌' },
-      rules: []
-    },
-    {
-      label: '院落布局', 
-      name: 'layout', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '院落布局' },
-      rules: []
-    },
-    {
-      label: '其他承重结构类型', 
-      name: 'otherBearing', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '其他承重结构类型' },
-      rules: []
-    },
-    {
-      label: '屋面形式(多选)', 
-      name: 'roofForm', 
-      type: 'check-box-list', 
-      additionalProps: {
-        multiple: true,
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(264))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as CheckBoxListProps,
-      defaultValue: [],
-      rules: [],
-    },
-    {
-      label: '屋面形式说明', 
-      name: 'roofDescribe', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '屋面形式说明' },
-      rules: []
-    },
-    {
-      label: '围护墙体(多选)', 
-      name: 'wallType', 
-      type: 'check-box-list', 
-      additionalProps: {
-        multiple: true,
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(271))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as CheckBoxListProps,
-      defaultValue: [],
-      rules: [],
-    },
-    {
-      label: '围护墙体说明', 
-      name: 'otherBuildingType', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '围护墙体说明' },
-      rules: []
-    },
-    {
-      label: '地面做法(多选)', 
-      name: 'floorType', 
-      type: 'check-box-list', 
-      additionalProps: {
-        multiple: true,
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(258))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as CheckBoxListProps,
-      defaultValue: [],
-      rules: [],
-    },
-    {
-      label: '地面做法说明', 
-      name: 'floorDescribe', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '地面做法说明' },
-      rules: []
-    },
-    {
-      label: '特殊工艺做法', 
-      name: 'specialProcess', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '特殊工艺做法' },
-      rules: []
-    },
-    {
-      label: '历史功能', 
-      name: 'funcHistory', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '历史功能' },
-      rules: []
-    },
-    {
-      label: '现状用途(多选)', 
-      name: 'purpose', 
-      type: 'check-box-list', 
-      additionalProps: {
-        multiple: true,
-        loadData: async () => 
-        (await VillageInfoApi.getCategoryChildList(252))
-          .map((p) => ({
-            value: p.id,
-            text: p.title,
-          }))
-        ,
-      } as CheckBoxListProps,
-      defaultValue: [],
-      rules: [],
-    },
-    {
-      label: '其他现状用途', 
-      name: 'otherPurpose', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '其他现状用途' },
-      rules: []
-    },
-    {
-      label: '改扩建情况及维修状况', 
-      name: 'repair', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '改扩建情况及维修状况' },
-      rules: []
-    },
-    {
-      label: '改扩建情况及维修状况说明', 
-      name: 'repairDescribe', 
-      type: 'text', 
-      defaultValue: '',
-      additionalProps: { placeholder: '改扩建情况及维修状况说明' },
-      rules: []
-    },
+    }, 
+    ...villageCommonContent(r, {
+      title: '建筑分布',
+      showContent: false,
+      showTitle: false,
+    }).formItems
   ] 
-})]
+})];

+ 1 - 1
src/pages/dig/forms/data/common.ts

@@ -3,7 +3,7 @@ import type { IDynamicFormOptions, IDynamicFormRef } from "@/components/dynamic"
 import type { UploaderFieldProps } from "@/components/form/UploaderField.vue";
 import type { Ref } from "vue";
 
-export function villageCommonContent (model: Ref<IDynamicFormRef>, options: { 
+export function villageCommonContent (ref: Ref<IDynamicFormRef>, options: { 
   title: string,
   showTitle?: boolean,
   showContent?: boolean,

+ 259 - 0
src/pages/dig/forms/data/element.ts

@@ -0,0 +1,259 @@
+import VillageInfoApi, { CommonInfoModel } from "@/api/inhert/VillageInfoApi";
+import { useAliOssUploadCo } from "@/common/components/upload/AliOssUploadCo";
+import type { PickerIdFieldProps } from "@/components/dynamic/wrappers/PickerIdField";
+import type { FieldProps } from "@/components/form/Field.vue";
+import type { StepperProps } from "@/components/form/Stepper.vue";
+import type { UploaderFieldProps } from "@/components/form/UploaderField.vue";
+import type { SingleForm } from "../forms";
+import { villageCommonContent } from "./common";
+
+export const vilElementForm : SingleForm = [CommonInfoModel, (r) => ({
+  formItems: [
+    {
+      label: '基础信息',
+      name: 'baseInfo',
+      type: 'flat-group',
+      childrenColProps: { span: 24 },
+      children: [
+        {
+          label: '名称', 
+          name: 'name', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入名称',
+          },
+          rules:  [{
+            required: true,
+            message: '请输入名称',
+          }] 
+        }, 
+        {
+          label: '编号', 
+          name: 'code', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '(可选)请输入编号',
+          },
+        },
+        {
+          label: '年代', 
+          name: 'age',
+          type: 'select-id', 
+          additionalProps: {
+            loadData: async () => 
+            (await VillageInfoApi.getCategoryChildList(103))
+              .map((p) => ({
+                value: p.id,
+                text: p.title,
+              }))
+            ,
+          } as PickerIdFieldProps,
+          formProps: { showRightArrow: true } as FieldProps,
+          rules: [{
+            required: true,
+            message: '请选择年代',
+          }],
+        },
+        {
+          label: '要素类型', 
+          name: 'elementType',
+          type: 'select-id', 
+          additionalProps: {
+            loadData: async () => 
+            (await VillageInfoApi.getCategoryChildList(178))
+              .map((p) => ({
+                value: p.id,
+                text: p.title,
+              }))
+            ,
+          } as PickerIdFieldProps,
+          formProps: { showRightArrow: true } as FieldProps,
+          rules: [{
+            required: true,
+            message: '请选择要素类型',
+          }],
+        },
+      ]
+    },
+    {
+      label: '详细信息',
+      name: 'detailInfo',
+      type: 'flat-group',
+      childrenColProps: { span: 24 },
+      children: [
+        {
+          label: '环境特点', 
+          name: 'environment', 
+          type: 'richtext', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入环境特点',
+            maxLength: 500,
+            showWordLimit: true, 
+          } as FieldProps,
+          rules:  [] 
+        },
+        {
+          label: '功能特点', 
+          name: 'funcFeatures', 
+          type: 'richtext', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入功能特点',
+            maxLength: 300,
+            showWordLimit: true, 
+          } as FieldProps,
+          rules:  [] 
+        },
+        {
+          label: '保存状况', 
+          name: 'condition', 
+          type: 'richtext', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入保存状况',
+            maxLength: 500,
+            showWordLimit: true, 
+          } as FieldProps,
+          rules:  [] 
+        },
+        {
+          label: '文化故事', 
+          name: 'story', 
+          type: 'richtext', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入文化故事',
+            maxLength: 1000,
+            showWordLimit: true, 
+          } as FieldProps,
+          rules:  [] 
+        },
+        {
+          label: '图片', 
+          name: 'images', 
+          type: 'uploader', 
+          defaultValue: '',
+          additionalProps: {
+            upload: useAliOssUploadCo('xiangyuan/element'),
+            maxFileSize: 1024 * 1024 * 20,
+            maxUploadCount: 20,
+          } as UploaderFieldProps,
+          rules:  [] 
+        },
+        ...villageCommonContent(r, {
+          title: '环境要素',
+          showContent: false,
+          showTitle: false,
+        }).formItems
+      ]
+    },
+    {
+      label: '位置信息',
+      name: 'locationInfo',
+      type: 'flat-group',
+      childrenColProps: { span: 24 },
+      children: [
+        {
+          label: '位置', 
+          name: 'position', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入位置',
+          },
+          rules:  [{
+            required: true,
+            message: '请输入位置',
+          }] 
+        },
+        {
+          label: '经纬度', 
+          name: 'lonlat', 
+          type: 'select-lonlat', 
+          defaultValue: '',
+          additionalProps: {},
+          formProps: { showRightArrow: true } as FieldProps,
+          rules:  [{
+            required: true,
+            message: '请输入经纬度',
+          }]
+        }, 
+        {
+          label: '地址', 
+          name: 'address', 
+          type: 'select-address', 
+          defaultValue: '',
+          additionalProps: {},
+          rules:  [{
+            required: true,
+            message: '请输入地址',
+          }] 
+        },
+        {
+          label: '方位', 
+          name: 'orientation', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: { placeholder: '方位' },
+          rules: []
+        },
+        {
+          label: '相对距离', 
+          name: 'distance', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: { placeholder: '相对距离' },
+          rules: []
+        },
+        {
+          name: '',
+          label: '平面坐标XY',
+          type: 'flat-simple',
+          children: [
+            { 
+              label: '', 
+              name: 'mapX', 
+              type: 'number', 
+              defaultValue: 0,
+              additionalProps: {
+                min: -250,
+                max: 250,
+              } as StepperProps,
+              formProps: {
+                labelWidth: '0rpx',
+                labelPosition: 'left',
+                showBottomBorder: false,
+              },
+              rules:  [{
+                required: true,
+                message: '请输入X',
+              }] 
+            },
+            { 
+              label: '', 
+              name: 'mapY', 
+              type: 'number', 
+              defaultValue: 0,
+              additionalProps: {
+                min: -250,
+                max: 250,
+              } as StepperProps,
+              formProps: {
+                labelWidth: '0rpx',
+                labelPosition: 'left',
+                showBottomBorder: false,
+              },
+              rules:  [{
+                required: true,
+                message: '请输入Y',
+              }] 
+            },
+          ]
+        },
+      ]
+    },
+  ] 
+})]

+ 39 - 31
src/pages/dig/forms/data/food.ts

@@ -1,35 +1,43 @@
 import { VillageBulidingInfo } from "@/api/inhert/VillageInfoApi";
 import type { SingleForm } from "../forms";
+import { villageCommonContent } from "./common";
 
-export const villageInfoFoodProductsForm : SingleForm = [VillageBulidingInfo, () => ({
-  formItems: [
-    {
-      label: '名称',
-      name: 'name',
-      type: 'text',
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入名称',
+export function villageInfoFoodProductsForm(title: string) : SingleForm {
+  return [VillageBulidingInfo, (r) => ({
+    formItems: [
+      {
+        label: `${title}名称`,
+        name: 'name',
+        type: 'text',
+        defaultValue: '',
+        additionalProps: {
+          placeholder: '请输入名称',
+        },
+        rules:  [{
+          required: true,
+          message: '请输入名称',
+        }]
+      }, 
+      {
+        label: `${title}详情`,
+        name: 'details',
+        type: 'richtext',
+        defaultValue: '',
+        additionalProps: {
+          placeholder: '请输入详情',
+          maxLength: 200,
+          showWordLimit: true, 
+        },
+        rules:  [{
+          required: true,
+          message: '请输入详情',
+        }]
       },
-      rules:  [{
-        required: true,
-        message: '请输入名称',
-      }]
-    }, 
-    {
-      label: '详情',
-      name: 'details',
-      type: 'richtext',
-      defaultValue: '',
-      additionalProps: {
-        placeholder: '请输入详情',
-        maxLength: 200,
-        showWordLimit: true, 
-      },
-      rules:  [{
-        required: true,
-        message: '请输入详情',
-      }]
-    },
-  ]
-})];
+      ...(villageCommonContent(r, { 
+        title: title,
+        showContent: false,
+        showTitle: false,
+      })).formItems
+    ]
+  })];
+}

+ 266 - 0
src/pages/dig/forms/data/relic.ts

@@ -0,0 +1,266 @@
+import VillageInfoApi, { CommonInfoModel } from "@/api/inhert/VillageInfoApi";
+import { useAliOssUploadCo } from "@/common/components/upload/AliOssUploadCo";
+import type { PickerIdFieldProps } from "@/components/dynamic/wrappers/PickerIdField";
+import type { FieldProps } from "@/components/form/Field.vue";
+import type { StepperProps } from "@/components/form/Stepper.vue";
+import type { UploaderFieldProps } from "@/components/form/UploaderField.vue";
+import type { SingleForm } from "../forms";
+import { villageCommonContent } from "./common";
+
+export const villageInfoRelicForm : SingleForm = [CommonInfoModel, (r) => ({
+  formItems: [
+    {
+      label: '基础信息',
+      name: 'baseInfo',
+      type: 'flat-group',
+      childrenColProps: { span: 24 },
+      children: [
+        {
+          label: '建筑名称', 
+          name: 'name', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入建筑名称',
+          },
+          rules:  [{
+            required: true,
+            message: '请输入建筑名称',
+          }] 
+        }, 
+        {
+          label: '文物编码', 
+          name: 'code', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入文物编码',
+          },
+          rules:  [{
+            required: true,
+            message: '请输入文物编码',
+          }] 
+        },
+        {
+          label: '年代', 
+          name: 'age',
+          type: 'select-id', 
+          additionalProps: {
+            loadData: async () => 
+            (await VillageInfoApi.getCategoryChildList(103))
+              .map((p) => ({
+                value: p.id,
+                text: p.title,
+              }))
+            ,
+          } as PickerIdFieldProps,
+          formProps: { showRightArrow: true } as FieldProps,
+          rules: [{
+            required: true,
+            message: '请选择年代',
+          }],
+        },
+        {
+          label: '保护级别', 
+          name: 'level',
+          type: 'select-id', 
+          additionalProps: {
+            loadData: async () => 
+            (await VillageInfoApi.getCategoryChildList(158))
+              .map((p) => ({
+                value: p.id,
+                text: p.title,
+              }))
+            ,
+          } as PickerIdFieldProps,
+          formProps: { showRightArrow: true } as FieldProps,
+          rules: [{
+            required: true,
+            message: '请选择保护级别',
+          }],
+        },
+        {
+          label: '文物类型', 
+          name: 'crType',
+          type: 'select-id', 
+          additionalProps: {
+            loadData: async () => 
+            (await VillageInfoApi.getCategoryChildList(3))
+              .map((p) => ({
+                value: p.id,
+                text: p.title,
+              }))
+            ,
+          } as PickerIdFieldProps,
+          formProps: { showRightArrow: true } as FieldProps,
+          rules: [{
+            required: true,
+            message: '请选择文物类型',
+          }],
+        },
+      ]
+    },
+    {
+      label: '介绍',
+      name: 'introdInfo',
+      type: 'flat-group',
+      childrenColProps: { span: 24 },
+      children: [
+        {
+          label: '简介', 
+          name: 'intro', 
+          type: 'richtext', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入简介',
+            maxLength: 200,
+            showWordLimit: true, 
+          },
+          rules:  [{
+            required: true,
+            message: '请输入简介',
+          }] 
+        },
+        {
+          label: '描述', 
+          name: 'description', 
+          type: 'richtext', 
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入简介',
+            maxLength: 200,
+            showWordLimit: true, 
+          },
+          rules:  [{
+            required: true,
+            message: '请输入描述',
+          }] 
+        },
+        {
+          label: '图片', 
+          name: 'images', 
+          type: 'uploader', 
+          defaultValue: '',
+          additionalProps: {
+            upload: useAliOssUploadCo('xiangyuan/relic'),
+            maxFileSize: 1024 * 1024 * 20,
+            maxUploadCount: 20,
+          } as UploaderFieldProps,
+          rules:  [] 
+        },
+        {
+          label: '文化故事', 
+          name: 'content', 
+          type: 'richtext', 
+          defaultValue: '',
+          additionalProps: { 
+            placeholder: '输入关于此文物的历史文化故事',
+            maxLength: 5000,
+            showWordLimit: true, 
+          } as FieldProps,
+          rules: []
+        },
+        ...villageCommonContent(r, {
+          title: '文物古迹',
+          showContent: false,
+          showTitle: false,
+        }).formItems
+      ]
+    },
+    {
+      label: '位置信息',
+      name: 'locationInfo',
+      type: 'flat-group',
+      childrenColProps: { span: 24 },
+      children: [
+        {
+          label: '经纬度', 
+          name: 'lonlat', 
+          type: 'select-lonlat', 
+          defaultValue: '',
+          additionalProps: {},
+          formProps: { showRightArrow: true } as FieldProps,
+          rules:  [{
+            required: true,
+            message: '请输入经纬度',
+          }]
+        }, 
+        {
+          label: '地址', 
+          name: 'address', 
+          type: 'select-address', 
+          defaultValue: '',
+          additionalProps: {},
+          rules:  [{
+            required: true,
+            message: '请输入地址',
+          }] 
+        },
+        {
+          label: '方位', 
+          name: 'orientation', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: { placeholder: '方位' },
+          rules: []
+        },
+        {
+          label: '相对距离', 
+          name: 'distance', 
+          type: 'text', 
+          defaultValue: '',
+          additionalProps: { placeholder: '相对距离' },
+          rules: []
+        },
+        {
+          name: '',
+          label: '平面坐标XY',
+          type: 'flat-simple',
+          children: [
+            { 
+              label: '', 
+              name: 'mapX', 
+              type: 'number', 
+              defaultValue: 0,
+              additionalProps: {
+                min: -250,
+                max: 250,
+              } as StepperProps,
+              formProps: {
+                labelWidth: '0rpx',
+                labelPosition: 'left',
+                showBottomBorder: false,
+              },
+              rules:  [{
+                required: true,
+                message: '请输入X',
+              }] 
+            },
+            { 
+              label: '', 
+              name: 'mapY', 
+              type: 'number', 
+              defaultValue: 0,
+              additionalProps: {
+                min: -250,
+                max: 250,
+              } as StepperProps,
+              formProps: {
+                labelWidth: '0rpx',
+                labelPosition: 'left',
+                showBottomBorder: false,
+              },
+              rules:  [{
+                required: true,
+                message: '请输入Y',
+              }] 
+            },
+          ]
+        },
+      ]
+    },
+
+
+    
+  ] 
+})];

+ 20 - 461
src/pages/dig/forms/forms.ts

@@ -14,12 +14,14 @@ import type { RowProps } from "@/components/layout/grid/Row.vue";
 import type { NewDataModel } from "@imengyu/js-request-transform";
 import type { Ref } from "vue";
 import { villageCommonContent } from "./data/common";
-import { villageInfoBuildingForm } from "./data/building";
+import { villageInfoBuildingForm, villageInfoDistributionForm } from "./data/building";
 import { villageInfoCulture, villageInfoFolkCultureForm } from "./data/cultural";
 import { villageInfoFoodProductsForm } from "./data/food";
 import { villageInfoOverviewForm } from "./data/overview";
 import { ichFormItems } from "./data/ich";
 import { villageInfoEnvironmentForm } from "./data/environment";
+import { villageInfoRelicForm } from "./data/relic";
+import { vilElementForm } from "./data/element";
 
 export type SingleForm = [NewDataModel, (formRef: Ref<IDynamicFormRef>) => IDynamicFormOptions]
 export type GroupForm = Record<number, SingleForm>
@@ -122,422 +124,21 @@ const villageInfoForm : Record<string, GroupForm> = {
     })],
   },
   'element': {
-    [0]: [CommonInfoModel, () => ({
-      formItems: [
-        {
-          label: '名称', 
-          name: 'name', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入名称',
-          },
-          rules:  [{
-            required: true,
-            message: '请输入名称',
-          }] 
-        }, 
-        {
-          label: '位置', 
-          name: 'position', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入位置',
-          },
-          rules:  [{
-            required: true,
-            message: '请输入位置',
-          }] 
-        },
-        {
-          label: '年代', 
-          name: 'age',
-          type: 'select-id', 
-          additionalProps: {
-            loadData: async () => 
-            (await VillageInfoApi.getCategoryChildList(103))
-              .map((p) => ({
-                value: p.id,
-                text: p.title,
-              }))
-            ,
-          } as PickerIdFieldProps,
-          formProps: { showRightArrow: true } as FieldProps,
-          rules: [{
-            required: true,
-            message: '请选择年代',
-          }],
-        },
-        {
-          label: '要素类型', 
-          name: 'elementType',
-          type: 'select-id', 
-          additionalProps: {
-            loadData: async () => 
-            (await VillageInfoApi.getCategoryChildList(178))
-              .map((p) => ({
-                value: p.id,
-                text: p.title,
-              }))
-            ,
-          } as PickerIdFieldProps,
-          formProps: { showRightArrow: true } as FieldProps,
-          rules: [{
-            required: true,
-            message: '请选择	要素类型',
-          }],
-        },
-        {
-          label: '编号', 
-          name: 'code', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '(可选)请输入编号',
-          },
-        }, 
-        {
-          label: '环境特点', 
-          name: 'environment', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入环境特点',
-            maxLength: 500,
-            showWordLimit: true, 
-          } as FieldProps,
-          rules:  [{
-            required: true,
-            message: '请输入环境特点',
-          }] 
-        },
-        {
-          label: '文化故事', 
-          name: 'story', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入文化故事',
-            maxLength: 1000,
-            showWordLimit: true, 
-          } as FieldProps,
-          rules:  [{
-            required: true,
-            message: '请输入文化故事',
-          }] 
-        },
-        {
-          label: '保存状况', 
-          name: 'condition', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入保存状况',
-            maxLength: 500,
-            showWordLimit: true, 
-          } as FieldProps,
-          rules:  [{
-            required: true,
-            message: '请输入保存状况',
-          }] 
-        },
-        {
-          label: '功能特点', 
-          name: 'funcFeatures', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入功能特点',
-            maxLength: 300,
-            showWordLimit: true, 
-          } as FieldProps,
-          rules:  [{
-            required: true,
-            message: '请输入功能特点',
-          }] 
-        },
-      ] 
-    })]
+    [0]: vilElementForm,
   },
   'environment': {
     [0]: villageInfoEnvironmentForm
   },
   'building': {
-    [1]: villageInfoBuildingForm,
-    [2]: villageInfoBuildingForm,
-    [3]: villageInfoBuildingForm,
+    [1]: villageInfoBuildingForm('文物建筑'),
+    [2]: villageInfoBuildingForm('历史建筑'),
+    [3]: villageInfoBuildingForm('重要传统建筑'),
   },
   'distribution': {
-    [0]: [CommonInfoModel, () => ({
-      formItems: [
-        {
-          label: '建筑数量', 
-          name: 'num', 
-          type: 'number', 
-          defaultValue: '',
-          additionalProps: {
-            min: 0,
-            max: 100,
-          },
-          rules:  [{
-            required: true,
-            message: '请输入建筑数量',
-          }] 
-        }, 
-        {
-          label: '分布图', 
-          name: 'distribution', 
-          type: 'uploader', 
-          defaultValue: '',
-          additionalProps: {
-            upload: useAliOssUploadCo('xiangyuan/distribution'),
-            maxFileSize: 1024 * 1024 * 20,
-            single: true,
-          } as UploaderFieldProps,
-          rules:  [{
-            required: true,
-            message: '请上传分布图',
-          }] 
-        }, 
-        {
-          label: '营造智慧', 
-          name: 'wisdom', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入营造智慧',
-            maxLength: 200,
-            showWordLimit: true, 
-          },
-          rules:  [{
-            required: true,
-            message: '请输入营造智慧',
-          }] 
-        }, 
-      ] 
-    })],
+    [0]: villageInfoDistributionForm,
   },
   'relic': {
-    [0]: [CommonInfoModel, () => ({
-      formItems: [
-        {
-          label: '建筑名称', 
-          name: 'name', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入建筑名称',
-          },
-          rules:  [{
-            required: true,
-            message: '请输入建筑名称',
-          }] 
-        }, 
-        {
-          label: '文物编码', 
-          name: 'code', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入文物编码',
-          },
-          rules:  [{
-            required: true,
-            message: '请输入文物编码',
-          }] 
-        },
-        {
-          label: '年代', 
-          name: 'age',
-          type: 'select-id', 
-          additionalProps: {
-            loadData: async () => 
-            (await VillageInfoApi.getCategoryChildList(103))
-              .map((p) => ({
-                value: p.id,
-                text: p.title,
-              }))
-            ,
-          } as PickerIdFieldProps,
-          formProps: { showRightArrow: true } as FieldProps,
-          rules: [{
-            required: true,
-            message: '请选择年代',
-          }],
-        },
-        {
-          label: '简介', 
-          name: 'intro', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: {},
-          rules:  [{
-            required: true,
-            message: '请输入简介',
-          }] 
-        },
-        {
-          label: '描述', 
-          name: 'description', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: {},
-          rules:  [{
-            required: true,
-            message: '请输入描述',
-          }] 
-        },
-        {
-          label: '保护级别', 
-          name: 'level',
-          type: 'select-id', 
-          additionalProps: {
-            loadData: async () => 
-            (await VillageInfoApi.getCategoryChildList(158))
-              .map((p) => ({
-                value: p.id,
-                text: p.title,
-              }))
-            ,
-          } as PickerIdFieldProps,
-          formProps: { showRightArrow: true } as FieldProps,
-          rules: [{
-            required: true,
-            message: '请选择保护级别',
-          }],
-        },
-        {
-          label: '文物类型', 
-          name: 'crType',
-          type: 'select-id', 
-          additionalProps: {
-            loadData: async () => 
-            (await VillageInfoApi.getCategoryChildList(3))
-              .map((p) => ({
-                value: p.id,
-                text: p.title,
-              }))
-            ,
-          } as PickerIdFieldProps,
-          formProps: { showRightArrow: true } as FieldProps,
-          rules: [{
-            required: true,
-            message: '请选择文物类型',
-          }],
-        },
-        {
-          label: '经纬度', 
-          name: 'lonlat', 
-          type: 'select-lonlat', 
-          defaultValue: '',
-          additionalProps: {},
-          formProps: { showRightArrow: true } as FieldProps,
-          rules:  [{
-            required: true,
-            message: '请输入经纬度',
-          }]
-        }, 
-        {
-          name: '',
-          label: '平面坐标XY',
-          type: 'flat-simple',
-          children: [
-            { 
-              label: '', 
-              name: 'mapX', 
-              type: 'number', 
-              defaultValue: 0,
-              additionalProps: {
-                min: -250,
-                max: 250,
-              } as StepperProps,
-              formProps: {
-                labelWidth: '0rpx',
-                labelPosition: 'left',
-                showBottomBorder: false,
-              },
-              rules:  [{
-                required: true,
-                message: '请输入X',
-              }] 
-            },
-            { 
-              label: '', 
-              name: 'mapY', 
-              type: 'number', 
-              defaultValue: 0,
-              additionalProps: {
-                min: -250,
-                max: 250,
-              } as StepperProps,
-              formProps: {
-                labelWidth: '0rpx',
-                labelPosition: 'left',
-                showBottomBorder: false,
-              },
-              rules:  [{
-                required: true,
-                message: '请输入Y',
-              }] 
-            },
-          ]
-        },
-        {
-          label: '地址', 
-          name: 'address', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入地址',
-          },
-          rules:  [{
-            required: true,
-            message: '请输入地址',
-          }] 
-        },
-        {
-          label: '图片', 
-          name: 'images', 
-          type: 'uploader', 
-          defaultValue: '',
-          additionalProps: {
-            upload: useAliOssUploadCo('xiangyuan/relic'),
-            maxFileSize: 1024 * 1024 * 20,
-            maxUploadCount: 20,
-          } as UploaderFieldProps,
-          rules:  [] 
-        },
-        {
-          label: '文化故事', 
-          name: 'content', 
-          type: 'richtext', 
-          defaultValue: '',
-          additionalProps: { 
-            placeholder: '文化故事',
-            maxLength: 5000,
-            showWordLimit: true, 
-          } as FieldProps,
-          rules: []
-        },
-        {
-          label: '方位', 
-          name: 'orientation', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: { placeholder: '方位' },
-          rules: []
-        },
-        {
-          label: '相对距离', 
-          name: 'distance', 
-          type: 'text', 
-          defaultValue: '',
-          additionalProps: { placeholder: '相对距离' },
-          rules: []
-        },
-      ] 
-    })],
+    [0]: villageInfoRelicForm,
   },
   'folk_culture': {
     [1]: villageInfoFolkCultureForm('节庆活动'),
@@ -1140,15 +741,15 @@ const villageInfoForm : Record<string, GroupForm> = {
     })]
   },
   'food_product': {
-    [1]: villageInfoFoodProductsForm,
-    [2]: villageInfoFoodProductsForm,
-    [3]: villageInfoFoodProductsForm,
-    [4]: villageInfoFoodProductsForm,
-    [5]: villageInfoFoodProductsForm,
-    [6]: villageInfoFoodProductsForm,
+    [1]: villageInfoFoodProductsForm('农副产品'),
+    [2]: villageInfoFoodProductsForm('食品产品'),
+    [3]: villageInfoFoodProductsForm('特色美食'),
+    [4]: villageInfoFoodProductsForm('商业集市'),
+    [5]: villageInfoFoodProductsForm('服装服饰'),
+    [6]: villageInfoFoodProductsForm('运输工具'),
   },
   'collect': {
-    [1]: [CommonInfoModel, () => ({
+    [1]: [CommonInfoModel, (r) => ({
       formItems: [
         {
           label: '标题',
@@ -1164,40 +765,6 @@ const villageInfoForm : Record<string, GroupForm> = {
           }]
         },
         {
-          label: '组图',
-          name: 'images',
-          type: 'uploader',
-          defaultValue: '',
-          additionalProps: {
-            upload: useAliOssUploadCo('xiangyuan/note'),
-            maxFileSize: 1024 * 1024 * 10,
-            maxUploadCount: 10,
-          } as UploaderFieldProps,
-          rules: []
-        },
-        {
-          label: '视频',
-          name: 'video',
-          type: 'uploader',
-          defaultValue: '',
-          additionalProps: {
-            upload: useAliOssUploadCo('xiangyuan/note'),
-            maxFileSize: 1024 * 1024 * 100,
-            maxUploadCount: 1,
-          } as UploaderFieldProps,
-          rules: []
-        },
-        {
-          label: '关键字',
-          name: 'keywords',
-          type: 'text',
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入关键字,多个关键字用逗号分隔',
-          } as FieldProps,
-          rules: []
-        },
-        {
           label: '描述',
           name: 'desc',
           type: 'richtext',
@@ -1209,18 +776,10 @@ const villageInfoForm : Record<string, GroupForm> = {
           } as FieldProps,
           rules: []
         },
-        {
-          label: '内容',
-          name: 'content',
-          type: 'richtext',
-          defaultValue: '',
-          additionalProps: {
-            placeholder: '请输入内容',
-            maxLength: 2000,
-            showWordLimit: true,
-          } as FieldProps,
-          rules: []
-        }
+        ...villageCommonContent(r, {
+          title: '记录',
+          showTitle: false,
+        }).formItems
       ]
     })]
   },