| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566 |
- 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 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: '请输入其他建筑类型',
- }]
- },
- ]
- },
- {
- label: '简介和故事',
- name: 'extraInfo',
- type: 'flat-group',
- childrenColProps: { span: 24 },
- children: [
- {
- label: '建筑中的故事',
- name: 'story',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入建筑中的故事',
- maxLength: 5000,
- showWordLimit: true,
- },
- rules: [{
- required: true,
- message: '请输入建筑中的故事',
- }]
- },
- {
- label: '功能特点',
- name: 'funcFeatures',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入功能特点',
- maxLength: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- ...villageCommonContent(r, {
- title: title,
- showContent: false,
- showTitle: false,
- }).formItems
- ]
- },
- {
- 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: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- {
- label: '建筑风貌',
- name: 'architecturalStyle',
- type: 'textarea',
- defaultValue: '',
- additionalProps: {
- placeholder: '建筑风貌',
- maxLength: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- {
- label: '院落布局',
- name: 'layout',
- type: 'textarea',
- defaultValue: '',
- additionalProps: {
- placeholder: '院落布局',
- maxLength: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- ]
- },
-
- {
- 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: 5000,
- 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: 5000,
- 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: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- {
- label: '特殊工艺做法',
- name: 'specialProcess',
- type: 'text',
- defaultValue: '',
- additionalProps: { placeholder: '特殊工艺做法' },
- rules: []
- },
- ]
- },
- {
- label: '建筑用途',
- name: 'detailsInfo',
- type: 'flat-group',
- childrenColProps: { span: 24 },
- children: [
- {
- label: '历史功能',
- name: 'funcHistory',
- type: 'textarea',
- defaultValue: '',
- additionalProps: {
- placeholder: '历史功能',
- maxLength: 5000,
- 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: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- {
- label: '改扩建情况及维修状况',
- name: 'repair',
- type: 'textarea',
- defaultValue: '',
- additionalProps: {
- placeholder: '改扩建情况及维修状况',
- maxLength: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- {
- label: '改扩建情况及维修状况说明',
- name: 'repairDescribe',
- type: 'textarea',
- defaultValue: '',
- additionalProps: {
- placeholder: '改扩建情况及维修状况说明',
- maxLength: 5000,
- showWordLimit: true,
- },
- rules: []
- },
- ]
- },
- ]
- }), { title: title, typeName: 'nature' }]
- }
- export const villageInfoDistributionForm : SingleForm = [CommonInfoModel, (r) => ({
- 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: 5000,
- showWordLimit: true,
- },
- rules: [{
- required: true,
- message: '请输入营造智慧',
- }]
- },
- ...villageCommonContent(r, {
- title: '建筑分布',
- showContent: false,
- showTitle: false,
- }).formItems
- ]
- }), { title: '建筑分布', typeName: '', }]
|