import VillageInfoApi, { CommonInfoModel, VillageBulidingInfo, VillageEnvInfo } from "@/api/inhert/VillageInfoApi";
import type { FormDefine, FormDefineItem, IFormItemCallback, IFormItemCallbackAdditionalProps } from "@/common/components/form";
import type { DynamicSelectProps } from "@/common/components/form/components/DynamicSelect.vue";
import type { FormGroupProps } from "@/common/components/form/SimpleDynamicFormCate.vue";
import type { NewDataModel } from "@imengyu/js-request-transform";

type SingleForm = [NewDataModel, FormDefine]

const villageInfoBuildingForm : SingleForm = [VillageBulidingInfo, {
  items: [
    {
      label: '建筑名称', 
      name: 'name', 
      type: 'text', 
      defaultValue: '',
      params: {
        placeholder: '请输入建筑名称',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入建筑名称',
      }] 
    }, 
    {
      label: '建筑编码', 
      name: 'code', 
      type: 'text', 
      defaultValue: '',
      params: {
        placeholder: '请输入建筑编码',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入建筑编码',
      }] 
    },
    {
      label: '产权归属', 
      name: 'ownership',
      type: 'dynamic-select', 
      params: {
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(152))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      rules: [{
        required: true,
        errorMessage: '请选择产权归属',
      }],
    },
    {
      label: '位置', 
      name: 'position', 
      type: 'text', 
      defaultValue: '',
      params: {
        placeholder: '请输入位置',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入位置',
      }] 
    },
    {
      label: '建筑类型', 
      name: 'buildingType',
      type: 'dynamic-select', 
      params: {
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(163))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      rules: [{
        required: true,
        errorMessage: '请选择建筑类型',
      }],
    },
    {
      label: '建筑中的故事', 
      name: 'story', 
      type: 'text', 
      defaultValue: '',
      params: {
        placeholder: '请输入建筑中的故事',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入建筑中的故事',
      }] 
    },
    {
      label: '保护级别', 
      name: 'protectionLevel',
      type: 'dynamic-select', 
      params: {
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(171))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      rules: [{
        required: true,
        errorMessage: '请选择建筑类型',
      }],
    },
    {
      label: '总占地面积', 
      name: 'area', 
      type: 'text', 
      defaultValue: '',
      params: {
        placeholder: '请输入总占地面积',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入总占地面积',
      }] 
    },
    {
      label: '建筑面积', 
      name: 'buildingArea', 
      type: 'text', 
      defaultValue: '',
      params: {
        placeholder: '请输入建筑面积',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入建筑面积',
      }] 
    },
    {
      label: '建筑层数', 
      name: 'floor', 
      type: 'number', 
      defaultValue: 0,
      params: {
        min: 0,
        max: 1000,
      },
      rules:  [{
        required: true,
        errorMessage: '请输入建筑层数',
      }] 
    },
    {
      label: '所含建筑幢数', 
      name: 'num', 
      type: 'number', 
      defaultValue: 0,
      params: {
        min: 0,
        max: 1000,
      },
      rules:  [{
        required: true,
        errorMessage: '请输入所含建筑幢数',
      }] 
    },
    {
      label: '始建时间', 
      name: 'age', 
      type: 'number', 
      defaultValue: 0,
      params: {
        min: 1900,
        max: 2000,
      },
      rules:  [{
        required: true,
        errorMessage: '请输入始建时间',
      }] 
    },
    {
      label: '功能特点', 
      name: 'funcFeatures', 
      type: 'text', 
      defaultValue: '',
      params: {
        placeholder: '请输入功能特点',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入功能特点',
      }] 
    },
    {
      label: '承重结构（多选）', 
      name: 'bearingType', 
      type: 'dynamic-checkbox', 
      params: {
        multiple: true,
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(246))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      defaultValue: [],
      rules: [{
        required: true,
        errorMessage: '请选择类型',
      }],
    },
    {
      label: '其他建筑类型', 
      name: 'otherBuildingType', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '其他建筑类型' },
      rules: []
    },
    {
      label: '居民建筑类型', 
      name: 'residentialBuildingType', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '居民建筑类型' },
      rules: []
    },
    {
      label: '其他保护级别', 
      name: 'otherProtectionLevel', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '其他保护级别' },
      rules: []
    },
    {
      label: '修缮过程', 
      name: 'repairProcess', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '修缮过程' },
      rules: []
    },
    {
      label: '建筑风貌', 
      name: 'architecturalStyle', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '建筑风貌' },
      rules: []
    },
    {
      label: '院落布局', 
      name: 'layout', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '院落布局' },
      rules: []
    },
    {
      label: '其他承重结构类型', 
      name: 'otherBearing', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '其他承重结构类型' },
      rules: []
    },
    {
      label: '屋面形式（多选）', 
      name: 'roofForm', 
      type: 'dynamic-checkbox', 
      params: {
        multiple: true,
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(264))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      defaultValue: [],
      rules: [],
    },
    {
      label: '屋面形式说明', 
      name: 'roofDescribe', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '屋面形式说明' },
      rules: []
    },
    {
      label: '围护墙体（多选）', 
      name: 'wallType', 
      type: 'dynamic-checkbox', 
      params: {
        multiple: true,
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(271))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      defaultValue: [],
      rules: [],
    },
    {
      label: '围护墙体说明', 
      name: 'otherBuildingType', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '围护墙体说明' },
      rules: []
    },
    {
      label: '地面做法（多选）', 
      name: 'floorType', 
      type: 'dynamic-checkbox', 
      params: {
        multiple: true,
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(258))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      defaultValue: [],
      rules: [],
    },
    {
      label: '地面做法说明', 
      name: 'floorDescribe', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '地面做法说明' },
      rules: []
    },
    {
      label: '特殊工艺做法', 
      name: 'specialProcess', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '特殊工艺做法' },
      rules: []
    },
    {
      label: '历史功能', 
      name: 'funcHistory', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '历史功能' },
      rules: []
    },
    {
      label: '现状用途（多选）', 
      name: 'purpose', 
      type: 'dynamic-checkbox', 
      params: {
        multiple: true,
        loadData: async () => 
        (await VillageInfoApi.getCategoryChildList(252))
          .map((p) => ({
            value: p.id,
            text: p.title,
          }))
        ,
      } as DynamicSelectProps,
      defaultValue: [],
      rules: [],
    },
    {
      label: '其他现状用途', 
      name: 'otherPurpose', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '其他现状用途' },
      rules: []
    },
    {
      label: '改扩建情况及维修状况', 
      name: 'repair', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '改扩建情况及维修状况' },
      rules: []
    },
    {
      label: '改扩建情况及维修状况说明', 
      name: 'repairDescribe', 
      type: 'text', 
      defaultValue: '',
      params: { placeholder: '改扩建情况及维修状况说明' },
      rules: []
    },
  ] 
}]
const villageInfoFolkCultureForm : SingleForm = [VillageBulidingInfo, {
  items: [
    {
      label: '名称',
      name: 'name',
      type: 'text',
      defaultValue: '',
      params: {
        placeholder: '请输入名称',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入名称',
      }]
    }, 
    {
      label: '详情',
      name: 'details',
      type: 'text',
      defaultValue: '',
      params: {
        placeholder: '请输入详情',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入详情',
      }]
    }, 
    {
      label: '村落非遗项目', 
      name: 'ichId',
      type: 'dynamic-select', 
      defaultValue: null,
      params: {
        loadData: {
          callback: (m, r, p, f) => async () => 
            (await VillageInfoApi.getList(
              'ich', undefined, undefined,
              f.villageId,
              f.villageVolunteerId
            )).map((p) => ({
              value: p.id,
              text: p.title,
            }))
        },
      } as IFormItemCallbackAdditionalProps<DynamicSelectProps>,
      rules: [],
    },
    {
      label: '文化资源关联内容ID',
      name: 'details',
      type: 'text',
      defaultValue: '',
      params: {
        placeholder: '输入文化资源关联内容ID',
      },
      rules:  []
    }, 
  ]
}];
const villageInfoFoodProductsForm : SingleForm = [VillageBulidingInfo, {
  items: [
    {
      label: '名称',
      name: 'name',
      type: 'text',
      defaultValue: '',
      params: {
        placeholder: '请输入名称',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入名称',
      }]
    }, 
    {
      label: '详情',
      name: 'details',
      type: 'text',
      defaultValue: '',
      params: {
        placeholder: '请输入详情',
      },
      rules:  [{
        required: true,
        errorMessage: '请输入详情',
      }]
    },
  ]
}];

//TODO: 图片上传组件
//TODO: 关联的文化资源ID

const villageInfoForm : Record<string, Record<number, SingleForm>> = {
  'overview': {
    [1]: [CommonInfoModel, {
      items: [
        { 
          label: '村落名称', 
          name: 'name', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入村落名称',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入村落名称',
          }] 
        }, 
        { 
          label: '村落编码', 
          name: 'code', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入村落编码',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入村落编码',
          }] 
        }, 
        { 
          label: '村落地址', 
          name: 'cityAddress', 
          type: 'city-select', 
          defaultValue: () => [],
          params: {
            placeholder: '请选择村落地址',
          },
          rules:  [{
            required: true,
            errorMessage: '请选择村落地址',
          }] 
        },
        { 
          label: '村落乡镇', 
          name: 'township', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入村落所在乡镇',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入村落所在乡镇',
          }] 
        }, 
        { 
          label: '村落类型', 
          name: 'villageType',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(94))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择类型',
          }],
        },
      ]
    }],
    [2]: [VillageEnvInfo, {
      items: [
        { 
          label: '经纬度', 
          name: 'lonlat', 
          type: 'lonlat-picker', 
          defaultValue: '',
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请输入村落经纬度',
          }]
        }, 
        { 
          label: '海拔', 
          name: 'altitude', 
          type: 'number', 
          defaultValue: 0,
          params: {
            placeholder: '请输入村落海拔',
            min: -1000,
            max: 10000,
            step: 10,
          },
          rules:  [{
            required: true,
            errorMessage: '请输入村落海拔',
          }] 
        }, 
        { 
          label: '地形地貌特征（多选）', 
          name: 'landforms',
          type: 'dynamic-checkbox', 
          params: {
            multiple: true,
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(97))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          defaultValue: [],
          rules: [{
            required: true,
            errorMessage: '请选择类型',
          }],
        },
        { 
          label: '村域面积（平方公里）', 
          name: 'area', 
          type: 'number', 
          defaultValue: 0,
          params: {
            placeholder: '请输入村域面积',
            min: 0,
            max: 10000,
            step: 1,
          },
          rules:  [{
            required: true,
            errorMessage: '请输入村域面积',
          }] 
        }, 
        { 
          label: '村庄占地面积（亩）', 
          name: 'villageArea', 
          type: 'number', 
          defaultValue: 0,
          params: {
            placeholder: '请输入村庄占地面积',
            min: 0,
            max: 10000,
            step: 1,
          },
          rules:  [{
            required: true,
            errorMessage: '请输入村庄占地面积',
          }] 
        }, 
        { 
          label: '村落类型', 
          name: 'age',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(103))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择类型',
          }],
        },
      ]
    }],
    [3]: [CommonInfoModel, {
      items: [
        { 
          label: '非遗最高级别', 
          name: 'ichLevel', 
          type: 'dynamic-select', 
          defaultValue: null,
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(111))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择非遗最高级别',
          }],
        }, 
        { 
          label: '传统建筑数量', 
          name: 'traditionalBuildings', 
          type: 'number', 
          defaultValue: 0,
          params: {
            min: 0,
            max: 10000,
            step: 1,
          },
          rules:  [{
            required: true,
            errorMessage: '请输入传统建筑数量',
          }] 
        }, 
        { 
          label: '列入历史文化名村级别', 
          name: 'historyLevel',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(151))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择类型',
          }],
        },
        { 
          label: '列入特色景观旅游名村级别', 
          name: 'touristLevel',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(151))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择类型',
          }],
        },
        { 
          label: '列入少数民族特色村寨试点示范', 
          name: 'isFeaturedVillage', 
          type: 'boolint-checkbox', 
          defaultValue: '',
          params: {},
          rules: [{
            required: true,
            errorMessage: '请选择类型',
          }],
        }, 
        { 
          label: '其他认定级别', 
          name: 'other', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '（可选）输入村落其他认定级别',
          },
          rules:  [] 
        }, 
      ]
    }],
    [4]: [CommonInfoModel, {
      items: [
        {
          name: '',
          label: '人口与收入',
          children: {
            type: 'group',
            props: { type: 'block' } as FormGroupProps,
            propNestType: 'nest', 
            items: [
              { 
                label: '主要民族', 
                name: 'nationlity', 
                type: 'text', 
                defaultValue: '',
                params: {
                  placeholder: '请输入主要民族',
                },
                rules: [{
                  required: true,
                  errorMessage: '请输入主要民族',
                }]
              }, 
              ...[
                {
                  label: '户籍人口',
                  name: 'registeredPopulation',
                },
                {
                  label: '常住人口',
                  name: 'permanentPopulation',
                },
                {
                  label: '人均年收入',
                  name: 'personalAnnualIncome',
                },
                {
                  label: '集体年收入',
                  name: 'villageAnnualIncome',
                },
              ].map((it) => ({
                name: '',
                label: it.label,
                children: {
                  type: 'group',
                  props: { type: 'row' } as FormGroupProps,
                  propNestType: 'flat', 
                  items: [
                    { 
                      label: '', 
                      name: it.name + 'Year', 
                      type: 'number', 
                      defaultValue: () => new Date().getFullYear(),
                      params: {
                        min: 1900,
                        max: 2100,
                        step: 10,
                      },
                      itemParams: {
                        labelWidth: '0rpx',
                        labelPosition2: 'left',
                        bottomMargin: false,
                      },
                      rules:  [{
                        required: true,
                        errorMessage: '请输入',
                      }] 
                    },
                    { 
                      label: '', 
                      name: 'aa', 
                      type: 'static-text', 
                      params: { text: '年' },
                      itemParams: {
                        labelWidth: '0rpx',
                        bottomMargin: false,
                      },
                    },
                    { 
                      label: '', 
                      name: it.name, 
                      type: 'number', 
                      defaultValue: 0,
                      params: {
                        min: 0,
                        step: 10,
                      },
                      itemParams: {
                        labelWidth: '0rpx',
                        labelPosition2: 'left',
                        bottomMargin: false,
                      },
                      rules:  [{
                        required: true,
                        errorMessage: '请输入人口',
                      }] 
                    },
                  ]
                }
              } as FormDefineItem)),
            ]
          }
        },
        {
          name: '',
          label: '主要产业',
          children: {
            type: 'group',
            props: { type: 'block' } as FormGroupProps,
            propNestType: 'flat', 
            items: [
              ...[
                {
                  label: '农业',
                  name: 'agriculture',
                  pid: 128,
                },
                {
                  label: '林业',
                  name: 'forestry',
                  pid: 194,
                },
                {
                  label: '畜牧业',
                  name: 'animal',
                  pid: 200,
                },
                {
                  label: '渔业',
                  name: 'fishing',
                  pid: 205,
                },
                {
                  label: '制造业（含手工）',
                  name: 'manufacturing',
                  pid: 208,
                },
                {
                  label: '建筑业',
                  name: 'construction',
                  pid: 227,
                },
                {
                  label: '批发和零售业',
                  name: 'retail',
                  pid: 230,
                },
                {
                  label: '服务业',
                  name: 'service',
                  pid: 233,
                },
                {
                  label: '其他',
                  name: 'otherIndustries',
                  pid: 238,
                },
              ].map((it) => ({
                label: it.label, 
                name: it.name,
                type: 'dynamic-select', 
                params: {
                  loadData: async () => 
                  (await VillageInfoApi.getCategoryChildList(it.pid))
                    .map((p) => ({
                      value: p.id,
                      text: p.title,
                    }))
                  ,
                } as DynamicSelectProps,
                rules: [],
              })),
              { 
                label: '其他服务业', 
                name: 'otherService', 
                type: 'text', 
                defaultValue: '',
                params: {
                  placeholder: '（可选）输入其他服务业',
                },
                rules:  [] 
              }, 
              { 
                label: '其他农业', 
                name: 'otherAgriculture', 
                type: 'text', 
                defaultValue: '',
                params: {
                  placeholder: '（可选）输入其他农业',
                },
                rules:  [] 
              }, 
            ]
          }
        },
      ] 
    }],
    [5]: [CommonInfoModel, {
      items: [
        {
          name: '',
          children: {
            type: 'group',
            props: {
              class: 'form-block',
            },
            propNestType: 'nest', 
            items: [
              {
                label: '概括',
                name: 'overview',
                type: 'textarea',
                defaultValue: '',
                params: {
                  placeholder: '请输入概括',
                },
                rules: [{
                  required: true,
                  errorMessage: '请输入概括',
                }]
              }
            ]
          }
        },
        {
          name: '',
          children: {
            type: 'group',
            props: {
              class: 'form-block',
            },
            propNestType: 'nest', 
            items: [
              {
                label: '突出价值',
                name: 'prominent',
                type: 'textarea', 
                defaultValue: '',
                params: {
                  placeholder: '请输入突出价值',
                },
                rules: [{
                  required: true,
                  errorMessage: '请输入突出价值',
                }]
              },
            ]
          }
        },
      ] 
    }],
  },
  'cultural': {
    [1]: [CommonInfoModel, {
      items: [
        {
          label: '内容',
          name: 'content',
          type: 'textarea',
          defaultValue: '',
          params: {
            placeholder: '请输入内容',
          },
          rules: [{
            required: true,
            errorMessage: '请输入内容',
          }]
        }
      ]
    }],
    [2]: [CommonInfoModel, {
      items: [
        {
          label: '内容',
          name: 'content',
          type: 'textarea',
          defaultValue: '',
          params: {
            placeholder: '请输入内容',
          },
          rules: [{
            required: true,
            errorMessage: '请输入内容',
          }]
        }
      ]
    }],
    [3]: [CommonInfoModel, {
      items: [
        {
          label: '内容',
          name: 'content',
          type: 'textarea',
          defaultValue: '',
          params: {
            placeholder: '请输入内容',
          },
          rules: [{
            required: true,
            errorMessage: '请输入内容',
          }]
        }
      ]
    }],
    [4]: [CommonInfoModel, {
      items: [
        {
          label: '内容',
          name: 'content',
          type: 'textarea',
          defaultValue: '',
          params: {
            placeholder: '请输入内容',
          },
          rules: [{
            required: true,
            errorMessage: '请输入内容',
          }]
        }
      ]
    }],
  },
  'story': {
    [0]: [CommonInfoModel, {
      items: [
        {
          label: '标题',
          name: 'title',
          type: 'text',
          defaultValue: '',
          params: {
            placeholder: '请输入标题',
          },
          rules: [{
            required: true,
            errorMessage: '请输入标题',
          }]
        },
        {
          label: '简介',
          name: 'intro',
          type: 'richtext',
          defaultValue: '',
          params: {
            placeholder: '请输入内容',
          },
          rules: [{
            required: true,
            errorMessage: '请输入内容',
          }]
        },
        {
          label: '内容',
          name: 'content',
          type: 'richtext',
          defaultValue: '',
          params: {
            placeholder: '请输入内容',
          },
          rules: [{
            required: true,
            errorMessage: '请输入内容',
          }]
        }
      ]
    }],
  },
  'figure': {
    [0]: [CommonInfoModel, {
      items: [
        {
          label: '标题',
          name: 'name',
          type: 'text',
          defaultValue: '',
          params: {
            placeholder: '请输入标题',
          },
          rules: [{
            required: true,
            errorMessage: '请输入标题',
          }]
        },
        {
          label: '简介',
          name: 'brief',
          type: 'textarea',
          defaultValue: '',
          params: {
            placeholder: '请输入简介',
          },
          rules: [{
            required: true,
            errorMessage: '请输入简介',
          }]
        },
        {
          label: '内容',
          name: 'intro',
          type: 'richtext',
          defaultValue: '',
          params: {
            placeholder: '请输入内容',
          },
          rules: [{
            required: true,
            errorMessage: '请输入内容',
          }]
        }
      ]
    }],
  },
  'element': {
    [0]: [CommonInfoModel, {
      items: [
        {
          label: '名称', 
          name: 'name', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入名称',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入名称',
          }] 
        }, 
        {
          label: '编号', 
          name: 'code', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入编号',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入编号',
          }] 
        }, 
        {
          label: '位置', 
          name: 'position', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入位置',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入位置',
          }] 
        },
        {
          label: '年代', 
          name: 'age',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(103))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择年代',
          }],
        },
        {
          label: '要素类型', 
          name: 'elementType',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(178))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择	要素类型',
          }],
        },
        {
          label: '环境特点', 
          name: 'environment', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入环境特点',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入环境特点',
          }] 
        },
        {
          label: '文化故事', 
          name: 'story', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入文化故事',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入文化故事',
          }] 
        },
        {
          label: '保存状况', 
          name: 'condition', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入保存状况',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入保存状况',
          }] 
        },
        {
          label: '功能特点', 
          name: 'funcFeatures', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入功能特点',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入功能特点',
          }] 
        },
      ] 
    }]
  },
  'environment': {
    [0]: [CommonInfoModel, {
      items: [
        { 
          label: '名称', 
          name: 'name', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入名称',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入名称',
          }] 
        }, 
        { 
          label: '自然环境', 
          name: 'natural', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入自然环境',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入自然环境',
          }] 
        }, 
        { 
          label: '选址', 
          name: 'siteSelection', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入选址',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入选址',
          }] 
        }, 
        { 
          label: '格局', 
          name: 'structure', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入格局',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入格局',
          }] 
        }, 
        { 
          label: '整体风貌', 
          name: 'overallStyle', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入整体风貌',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入整体风貌',
          }] 
        }, 
        { 
          label: '农业遗产', 
          name: 'agriculturalHeritage', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入农业遗产',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入农业遗产',
          }] 
        }, 
      ] 
    }]
  },
  'building': {
    [1]: villageInfoBuildingForm,
    [2]: villageInfoBuildingForm,
    [3]: villageInfoBuildingForm,
  },
  'distribution': {
    [0]: [CommonInfoModel, {
      items: [
        {
          label: '建筑数量', 
          name: 'num', 
          type: 'nmber', 
          defaultValue: '',
          params: {
            min: 0,
            max: 100,
          },
          rules:  [{
            required: true,
            errorMessage: '请输入建筑数量',
          }] 
        }, 
        {
          label: '分布图', 
          name: 'distribution', 
          type: 'image-uploader', 
          defaultValue: '',
          params: {
          },
          rules:  [{
            required: true,
            errorMessage: '请上传分布图',
          }] 
        }, 
        {
          label: '营造智慧', 
          name: 'wisdom', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入营造智慧',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入营造智慧',
          }] 
        }, 
      ] 
    }],
  },
  'relic': {
    [0]: [CommonInfoModel, {
      items: [
        {
          label: '建筑名称', 
          name: 'name', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入建筑名称',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入建筑名称',
          }] 
        }, 
        {
          label: '文物编码', 
          name: 'code', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入文物编码',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入文物编码',
          }] 
        },
        {
          label: '年代', 
          name: 'age',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(103))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择年代',
          }],
        },
        {
          label: '简介', 
          name: 'intro', 
          type: 'richtext', 
          defaultValue: '',
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请输入简介',
          }] 
        },
        {
          label: '描述', 
          name: 'description', 
          type: 'richtext', 
          defaultValue: '',
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请输入描述',
          }] 
        },
        {
          label: '保护级别', 
          name: 'level',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(158))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择保护级别',
          }],
        },
        {
          label: '文物类型', 
          name: 'crType',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(3))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择文物类型',
          }],
        },
        {
          label: '经纬度', 
          name: 'lonlat', 
          type: 'lonlat-picker', 
          defaultValue: '',
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请输入经纬度',
          }]
        }, 
        {
          name: '',
          label: '平面坐标X',
          children: {
            type: 'group',
            props: { type: 'row' } as FormGroupProps,
            propNestType: 'flat', 
            items: [
              { 
                label: '', 
                name: 'mapX', 
                type: 'number', 
                defaultValue: 0,
                params: {
                  min: -250,
                  max: 250,
                },
                itemParams: {
                  labelWidth: '0rpx',
                  labelPosition2: 'left',
                  bottomMargin: false,
                },
                rules:  [{
                  required: true,
                  errorMessage: '请输入X',
                }] 
              },
              { 
                label: '', 
                name: 'aa', 
                type: 'static-text', 
                params: { text: 'Y' },
                itemParams: {
                  labelWidth: '0rpx',
                  bottomMargin: false,
                },
              },
              { 
                label: '', 
                name: 'mapY', 
                type: 'number', 
                defaultValue: 0,
                params: {
                  min: -250,
                  max: 250,
                },
                itemParams: {
                  labelWidth: '0rpx',
                  labelPosition2: 'left',
                  bottomMargin: false,
                },
                rules:  [{
                  required: true,
                  errorMessage: '请输入Y',
                }] 
              },
            ]
          }
        },
        {
          label: '地址', 
          name: 'address', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入地址',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入地址',
          }] 
        },
        {
          label: '图片', 
          name: 'images', 
          type: 'image-uploader', 
          defaultValue: '',
          params: {
          },
          rules:  [] 
        },
        {
          label: '文化故事', 
          name: 'content', 
          type: 'textarea', 
          defaultValue: '',
          params: { placeholder: '文化故事' },
          rules: []
        },
        {
          label: '方位', 
          name: 'orientation', 
          type: 'text', 
          defaultValue: '',
          params: { placeholder: '方位' },
          rules: []
        },
        {
          label: '相对距离', 
          name: 'distance', 
          type: 'text', 
          defaultValue: '',
          params: { placeholder: '相对距离' },
          rules: []
        },
      ] 
    }],
  },
  'folk_culture': {
    [1]: villageInfoFolkCultureForm,
    [2]: villageInfoFolkCultureForm,
    [3]: villageInfoFolkCultureForm,
    [4]: villageInfoFolkCultureForm,
    [5]: villageInfoFolkCultureForm,
  },
  'ich': {
    [0]: [CommonInfoModel, {
      items: [
        {
          label: '名称及管理编号', 
          name: 'name', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入名称',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入名称',
          }] 
        }, 
        {
          label: '编号', 
          name: 'code', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入编号',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入编号',
          }] 
        },
        {
          label: '文化资源关联内容ID',
          name: 'inheritor',
          type: 'text',
          defaultValue: '',
          params: {
            placeholder: '输入文化资源关联内容ID',
          },
          rules:  []
        }, 
        {
          label: '级别', 
          name: 'ichLevel',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(111))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择级别',
          }],
        },
        {
          label: '类型', 
          name: 'ichType',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(4))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择类型',
          }],
        },
        {
          label: '是否确定传承人', 
          name: 'isInheritor', 
          type: 'boolint-checkbox', 
          defaultValue: 0,
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请选择是否确定传承人',
          }] 
        },
        {
          label: '传承人情况',
          name: 'inheritor',
          type: 'text',
          defaultValue: '',
          params: {
            placeholder: '请输入传承人情况',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入输入传承人情况',
          }]
        }, 
        {
          label: '项目续存情况', 
          name: 'ichExistenceStatus',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(120))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择项目续存情况',
          }],
        },
        {
          label: '与村落依存程度', 
          name: 'ichDependenceDegree',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(124))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择与村落依存程度',
          }],
        },
        {
          label: '活动规模', 
          name: 'activityScale',
          type: 'dynamic-select',
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(142))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择活动规模',
          }],
        },
        {
          label: '传承时间', 
          name: 'inheritanceTime',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(147))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择传承时间',
          }],
        },
        {
          label: '具体传承时间', 
          name: 'otherInheritanceTime',
          type: 'datetime-picker', 
          show: { callback(model, rawModel, parentModel, formGlobalParams, item) {
            return rawModel.inheritanceTime === 150;
          } },
          params: {
            type: 'datetime',
          },
          rules: [{
            required: true,
            errorMessage: '请选择具体传承时间',
          }],
        },
        {
          label: '加入时间', 
          name: 'joinAt',
          type: 'datetime-picker', 
          params: {
            type: 'datetime',
          },
          rules: [{
            required: true,
            errorMessage: '请选择加入时间',
          }],
        },
      ] 
    }],
  },
  'travel_guide': {
    [0]: [CommonInfoModel, {
      items: [
        {
          label: '入村路线', 
          name: 'villageRoute', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入入村路线',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入入村路线',
          }] 
        },
        {
          label: '距离县城（KM）', 
          name: 'county', 
          type: 'number', 
          defaultValue: '',
          params: { min: 0 },
          rules:  [{
            required: true,
            errorMessage: '请输入距离县城',
          }] 
        },
        {
          label: '距离镇区中心（KM）', 
          name: 'town', 
          type: 'number', 
          defaultValue: '',
          params: { min: 0 },
          rules:  [{
            required: true,
            errorMessage: '请输入距离镇区中心',
          }] 
        }, 
        {
          label: '距离市中心（KM）', 
          name: 'city', 
          type: 'number', 
          defaultValue: '',
          params: { min: 0 },
          rules:  [{
            required: true,
            errorMessage: '请输入距离市中心',
          }] 
        },
        {
          label: '最近高速收费站名称', 
          name: 'tollStationName', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入最近高速收费站名称',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入最近高速收费站名称',
          }] 
        },
        //有无公交车
        {
          label: '有无公交车', 
          name: 'isBus', 
          type: 'boolint-checkbox', 
          defaultValue: 0,
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请选择有无公交车',
          }] 
        },
        {
          label: '公交车介绍', 
          name: 'busIntro', 
          type: 'text', 
          show: { callback: (_, rawModel) => rawModel.isBus === 1 },
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '最近高速收费站名称', 
          name: 'tollStation', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '距离最近火车站', 
          name: 'trainStation', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '其他交通方式', 
          name: 'otherBus', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '景区全景图', 
          name: 'panorama', 
          type: 'image-uploader', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '其他图', 
          name: 'otherImage', 
          type: 'image-uploader', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        //解说牌
        {
          label: '有无解说牌', 
          name: 'introBoard', 
          type: 'boolint-checkbox', 
          defaultValue: 0,
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请选择有无解说牌',
          }] 
        },
        {
          label: '其他解说牌', 
          name: 'otherIntroBoard', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '有无解指示牌', 
          name: 'indicateBoard', 
          type: 'boolint-checkbox', 
          defaultValue: 0,
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请选择有无指示牌',
          }] 
        },
        {
          label: '其他指示牌', 
          name: 'otherIndicateBoard', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '有无安全告示牌', 
          name: 'safeBoard', 
          type: 'boolint-checkbox', 
          defaultValue: 0,
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请选择有无安全告示牌',
          }] 
        },
        {
          label: '其他指示牌', 
          name: 'otherSafeBoard', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '有无游客服务中心', 
          name: 'visitorCenter', 
          type: 'boolint-checkbox', 
          defaultValue: 0,
          params: {},
          rules:  [{
            required: true,
            errorMessage: '请选择有有无游客服务中心',
          }] 
        },
        {
          label: '游客服务中心面积', 
          name: 'visitorCenterArea', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        {
          label: '商业设施', 
          name: 'business',
          type: 'dynamic-select', 
          params: {
            loadData: async () => 
            (await VillageInfoApi.getCategoryChildList(282))
              .map((p) => ({
                value: p.id,
                text: p.title,
              }))
            ,
          } as DynamicSelectProps,
          rules: [{
            required: true,
            errorMessage: '请选择商业设施',
          }],
        },
        {
          label: '其他商业设施', 
          name: 'otherBusiness', 
          type: 'text', 
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        //医疗点
        {
          label: '有无医疗点', 
          name: 'medicalPoint', 
          type: 'select', 
          defaultValue: 0,
          params: {
            localdata: [
              { value: 0, text: '无' },
              { value: 1, text: '有' },
              { value: 2, text: '其他' }
            ]
          },
          rules:  [{
            required: true,
            errorMessage: '请选择有无医疗点',
          }] 
        },
        {
          label: '其他医疗点', 
          name: 'otherMedicalPoint', 
          type: 'text', 
          show: { callback: (_, rawModel) => rawModel.medicalPoint === 2 },
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        //医疗点
        {
          label: '有无游览车', 
          name: 'tourBus', 
          type: 'select', 
          defaultValue: 0,
          params: {
            localdata: [
              { value: 0, text: '无' },
              { value: 1, text: '有' },
              { value: 2, text: '其他' }
            ]
          },
          rules:  [{
            required: true,
            errorMessage: '请选择有无游览车',
          }] 
        },
        {
          label: '其他游览车', 
          name: 'otherTourBus', 
          type: 'text', 
          show: { callback: (_, rawModel) => rawModel.tourBus === 2 },
          defaultValue: '',
          params: {},
          rules:  [] 
        },
        //
        {
          label: '机动车停车场（单位：辆）', 
          name: 'parkingLot', 
          type: 'number', 
          defaultValue: 0,
          params: { min: 0 },
          rules:  [] 
        },
        {
          label: '分类垃圾点（单位：处）', 
          name: 'garbagePoint', 
          type: 'number', 
          defaultValue: 0,
          params: { min: 0 },
          rules:  [] 
        },
        {
          label: '公共卫生间(单位：处）', 
          name: 'publicToilets', 
          type: 'number', 
          defaultValue: 0,
          params: { min: 0 },
          rules:  [] 
        },
      ] 
    }] 
  },
  'route': {
    [1]: [CommonInfoModel, {
      items: [
        {
          label: '游览路线', 
          name: 'route', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入游览路线',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入游览路线',
          }] 
        },
        {
          label: '路线名称', 
          name: 'name', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入路线名称',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入路线名称',
          }] 
        },
        {
          label: '描述', 
          name: 'desc', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入描述',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入描述',
          }] 
        },
        {
          label: '起始点', 
          name: 'startPoint', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入起始点',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入起始点',
          }] 
        },
        {
          label: '终止点', 
          name: 'endPoint', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入终止点',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入终止点',
          }] 
        },
        {
          label: '预计时长（分钟）', 
          name: 'estimate', 
          type: 'number', 
          defaultValue: 1,
          params: {
            min: 1,
          },
          rules:  [{
            required: true,
            errorMessage: '请输入预计时长',
          }] 
        },
      ] 
    }],
    [2]: [CommonInfoModel, {
      items: [
        {
          label: '活动标题', 
          name: 'activity', 
          type: 'text', 
          defaultValue: '',
          params: {
            placeholder: '请输入活动标题',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入活动标题',
          }] 
        },
        {
          label: '活动开始时间', 
          name: 'startTime',
          type: 'datetime-picker', 
          defaultValue: '',
          params: {
            type: 'datetime',
          },
          rules: [{
            required: true,
            errorMessage: '请选择活动开始时间',
          }],
        },
        {
          label: '活动结束时间', 
          name: 'endTime',
          type: 'datetime-picker', 
          defaultValue: '',
          params: {
            type: 'datetime',
          },
          rules: [{
            required: true,
            errorMessage: '请选择活动结束时间',
          }],
        },
        {
          label: '活动时长（分钟）', 
          name: 'duration',
          type: 'number', 
          defaultValue: 0,
          params: {
            min: 0,
          },
          rules: [{
            required: true,
            errorMessage: '请选择活动时长',
          }],
        },
      ] 
    }],
    [3]: [CommonInfoModel, {
      items: [
        {
          label: '特色', 
          name: 'advant', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入特色',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入特色',
          }] 
        },
        {
          label: '文化背景', 
          name: 'intro', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入文化背景',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入文化背景',
          }] 
        },
        {
          label: '精彩推荐', 
          name: 'recommend', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入精彩推荐',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入精彩推荐',
          }] 
        },
        {
          label: '推荐描述', 
          name: 'reason', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入推荐描述',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入推荐描述',
          }] 
        },
        {
          label: '活动亮点', 
          name: 'highlight', 
          type: 'textarea', 
          defaultValue: '',
          params: {
            placeholder: '请输入活动亮点',
          },
          rules:  [{
            required: true,
            errorMessage: '请输入活动亮点',
          }] 
        },
        {
          label: '图片视频', 
          name: 'images', 
          type: 'image-uploader', 
          defaultValue: '',
          params: {
          },
          rules:  [] 
        },
      ] 
    }]
  },
  'food_product': {
    [1]: villageInfoFoodProductsForm,
    [2]: villageInfoFoodProductsForm,
    [3]: villageInfoFoodProductsForm,
    [4]: villageInfoFoodProductsForm,
    [5]: villageInfoFoodProductsForm,
    [6]: villageInfoFoodProductsForm,
  },
}

export function getVillageInfoForm(subType: string, subId: number) {
  const group = villageInfoForm[subType];
  if (!group)
    throw new Error('subType ' + subType + ' not found');
  return group[subId];
}