| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234 |
- import VillageInfoApi, { CommonInfoModel, VillageBulidingInfo, VillageEnvInfo } from "@/api/inhert/VillageInfoApi";
- import { useAliOssUploadCo } from "@/common/components/upload/AliOssUploadCo";
- import type { IDynamicFormOptions, IDynamicFormItem, IDynamicFormRef, IDynamicFormItemCallbackAdditionalProps } from "@/components/dynamic";
- import type { CheckBoxListProps } from "@/components/dynamic/wrappers/CheckBoxList.vue";
- import type { CheckBoxToIntProps } from "@/components/dynamic/wrappers/CheckBoxToInt";
- import type { PickerIdFieldProps } from "@/components/dynamic/wrappers/PickerIdField";
- import type { RadioIdFieldProps } from "@/components/dynamic/wrappers/RadioIdField";
- import type { FieldProps } from "@/components/form/Field.vue";
- import type { PickerFieldProps } from "@/components/form/PickerField.vue";
- import type { StepperProps } from "@/components/form/Stepper.vue";
- import type { UploaderInstance } from "@/components/form/Uploader.vue";
- import type { UploaderFieldInstance, UploaderFieldProps } from "@/components/form/UploaderField.vue";
- 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 { 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";
- export type SingleForm = [NewDataModel, (formRef: Ref<IDynamicFormRef>) => IDynamicFormOptions]
- export type GroupForm = Record<number, SingleForm>
- //TODO: 关联的文化资源ID
- const villageInfoForm : Record<string, GroupForm> = {
- 'overview': villageInfoOverviewForm,
- 'cultural': villageInfoCulture,
- 'story': {
- [0]: [CommonInfoModel, () => ({
- formItems: [
- {
- label: '标题',
- name: 'title',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入标题',
- },
- rules: [{
- required: true,
- message: '请输入标题',
- }]
- },
- {
- label: '简介',
- name: 'intro',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入内容',
- },
- rules: [{
- required: true,
- message: '请输入内容',
- }]
- },
- {
- label: '内容',
- name: 'content',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入内容',
- },
- rules: [{
- required: true,
- message: '请输入内容',
- }]
- }
- ]
- })],
- },
- 'figure': {
- [0]: [CommonInfoModel, () => ({
- formItems: [
- {
- label: '标题',
- name: 'name',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入标题',
- },
- rules: [{
- required: true,
- message: '请输入标题',
- }]
- },
- {
- label: '简介',
- name: 'brief',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入简介',
- maxLength: 500,
- showWordLimit: true,
- } as FieldProps,
- rules: [{
- required: true,
- message: '请输入简介',
- }]
- },
- {
- label: '内容',
- name: 'intro',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入内容',
- },
- rules: [{
- required: true,
- message: '请输入内容',
- }]
- }
- ]
- })],
- },
- '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: '请输入功能特点',
- }]
- },
- ]
- })]
- },
- 'environment': {
- [0]: villageInfoEnvironmentForm
- },
- 'building': {
- [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: '请输入营造智慧',
- }]
- },
- ]
- })],
- },
- '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: []
- },
- ]
- })],
- },
- 'folk_culture': {
- [1]: villageInfoFolkCultureForm('节庆活动'),
- [2]: villageInfoFolkCultureForm('祭祀崇礼'),
- [3]: villageInfoFolkCultureForm('婚丧嫁娶'),
- [4]: villageInfoFolkCultureForm('地方方言'),
- [5]: villageInfoFolkCultureForm('特色文化'),
- },
- 'ich': {
- [0]: ichFormItems,
- },
- 'travel_guide': {
- [0]: [CommonInfoModel, () => ({
- formItems: [
- {
- label: '入村路线',
- name: 'villageRoute',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入入村路线',
- },
- rules: [{
- required: true,
- message: '请输入入村路线',
- }]
- },
- {
- label: '距离县城(KM)',
- name: 'county',
- type: 'number',
- defaultValue: '',
- additionalProps: { min: 0 },
- rules: [{
- required: true,
- message: '请输入距离县城',
- }]
- },
- {
- label: '距离镇区中心(KM)',
- name: 'town',
- type: 'number',
- defaultValue: '',
- additionalProps: { min: 0 },
- rules: [{
- required: true,
- message: '请输入距离镇区中心',
- }]
- },
- {
- label: '距离市中心(KM)',
- name: 'city',
- type: 'number',
- defaultValue: '',
- additionalProps: { min: 0 },
- rules: [{
- required: true,
- message: '请输入距离市中心',
- }]
- },
- {
- label: '最近高速收费站名称',
- name: 'tollStationName',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入最近高速收费站名称',
- },
- rules: [{
- required: true,
- message: '请输入最近高速收费站名称',
- }]
- },
- //有无公交车
- {
- label: '有无公交车',
- name: 'isBus',
- type: 'check-box-int',
- defaultValue: 0,
- additionalProps: {
- text: '有',
- },
- rules: [{
- required: true,
- message: '请选择有无公交车',
- }]
- },
- {
- label: '公交车介绍',
- name: 'busIntro',
- type: 'text',
- show: { callback: (_, rawModel) => (rawModel.isBus === 1) },
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入公交车介绍',
- },
- rules: []
- },
- {
- label: '最近高速收费站名称',
- name: 'tollStation',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入最近高速收费站名称',
- },
- rules: []
- },
- {
- label: '距离最近火车站',
- name: 'trainStation',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入距离最近火车站',
- },
- rules: []
- },
- {
- label: '其他交通方式',
- name: 'otherBus',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入其他交通方式',
- },
- rules: []
- },
- {
- label: '景区全景图',
- name: 'panorama',
- type: 'uploader',
- defaultValue: '',
- additionalProps: {
- upload: useAliOssUploadCo('xiangyuan/travel/panorama'),
- maxFileSize: 1024 * 1024 * 20,
- single: true,
- } as UploaderFieldProps,
- rules: []
- },
- {
- label: '其他图',
- name: 'otherImage',
- type: 'uploader',
- defaultValue: '',
- additionalProps: {
- upload: useAliOssUploadCo('xiangyuan/travel/guide'),
- maxFileSize: 1024 * 1024 * 20,
- single: true,
- } as UploaderFieldProps,
- rules: []
- },
- //解说牌
- {
- label: '有无解说牌',
- name: 'introBoard',
- type: 'check-box-int',
- defaultValue: 0,
- additionalProps: {
- text: '有',
- },
- rules: [{
- required: true,
- message: '请选择有无解说牌',
- }]
- },
- {
- label: '其他解说牌',
- name: 'otherIntroBoard',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入其他解说牌',
- },
- rules: []
- },
- {
- label: '有无解指示牌',
- name: 'indicateBoard',
- type: 'check-box-int',
- defaultValue: 0,
- additionalProps: {
- text: '有',
- },
- rules: [{
- required: true,
- message: '请选择有无指示牌',
- }]
- },
- {
- label: '其他指示牌',
- name: 'otherIndicateBoard',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入其他指示牌',
- },
- rules: []
- },
- {
- label: '有无安全告示牌',
- name: 'safeBoard',
- type: 'check-box-int',
- defaultValue: 0,
- additionalProps: {
- text: '有',
- },
- rules: [{
- required: true,
- message: '请选择有无安全告示牌',
- }]
- },
- {
- label: '其他指示牌',
- name: 'otherSafeBoard',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入其他安全告示牌',
- },
- rules: []
- },
- {
- label: '有无游客服务中心',
- name: 'visitorCenter',
- type: 'check-box-int',
- defaultValue: 0,
- additionalProps: {
- text: '有',
- },
- rules: [{
- required: true,
- message: '请选择有有无游客服务中心',
- }]
- },
- {
- label: '游客服务中心面积',
- name: 'visitorCenterArea',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入游客服务中心面积',
- },
- rules: []
- },
- {
- label: '商业设施',
- name: 'business',
- type: 'select-id',
- additionalProps: {
- loadData: async () =>
- (await VillageInfoApi.getCategoryChildList(282))
- .map((p) => ({
- value: p.id,
- text: p.title,
- }))
- ,
- } as PickerIdFieldProps,
- formProps: { showRightArrow: true } as FieldProps,
- rules: [{
- required: true,
- message: '请选择商业设施',
- }],
- },
- {
- label: '其他商业设施',
- name: 'otherBusiness',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入其他商业设施',
- },
- rules: []
- },
- //医疗点
- {
- label: '有无医疗点',
- name: 'medicalPoint',
- type: 'select',
- defaultValue: 0,
- additionalProps: {
- columns: [[
- { value: 0, text: '无' },
- { value: 1, text: '有' },
- { value: 2, text: '其他' }
- ]],
- singleValue: true,
- } as PickerFieldProps,
- formProps: {
- showRightArrow: true,
- },
- rules: [{
- required: true,
- message: '请选择有无医疗点',
- }]
- },
- {
- label: '其他医疗点',
- name: 'otherMedicalPoint',
- type: 'text',
- show: { callback: (_, rawModel) => (rawModel.medicalPoint === 2) },
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入其他医疗点',
- },
- rules: []
- },
- //医疗点
- {
- label: '有无游览车',
- name: 'tourBus',
- type: 'select',
- defaultValue: 0,
- additionalProps: {
- columns: [[
- { value: 0, text: '无' },
- { value: 1, text: '有' },
- { value: 2, text: '其他' }
- ]],
- singleValue: true,
- } as PickerFieldProps,
- formProps: {
- showRightArrow: true,
- },
- rules: [{
- required: true,
- message: '请选择有无游览车',
- }]
- },
- {
- label: '其他游览车',
- name: 'otherTourBus',
- type: 'text',
- show: { callback: (_, rawModel) => (rawModel.tourBus === 2) },
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入其他游览车',
- },
- rules: []
- },
- //
- {
- label: '机动车停车场(单位:辆)',
- name: 'parkingLot',
- type: 'number',
- defaultValue: 0,
- additionalProps: { min: 0 },
- rules: []
- },
- {
- label: '分类垃圾点(单位:处)',
- name: 'garbagePoint',
- type: 'number',
- defaultValue: 0,
- additionalProps: { min: 0 },
- rules: []
- },
- {
- label: '公共卫生间(单位:处)',
- name: 'publicToilets',
- type: 'number',
- defaultValue: 0,
- additionalProps: { min: 0 },
- rules: []
- },
- ]
- })],
- },
- 'route': {
- [1]: [CommonInfoModel, () => ({
- formItems: [
- {
- label: '游览路线',
- name: 'route',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入游览路线',
- },
- rules: [{
- required: true,
- message: '请输入游览路线',
- }]
- },
- {
- label: '路线名称',
- name: 'name',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入路线名称',
- },
- rules: [{
- required: true,
- message: '请输入路线名称',
- }]
- },
- {
- label: '描述',
- name: 'desc',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入描述',
- maxLength: 200,
- showWordLimit: true,
- },
- rules: [{
- required: true,
- message: '请输入描述',
- }]
- },
- {
- label: '起始点',
- name: 'startPoint',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入起始点',
- },
- rules: [{
- required: true,
- message: '请输入起始点',
- }]
- },
- {
- label: '终止点',
- name: 'endPoint',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入终止点',
- },
- rules: [{
- required: true,
- message: '请输入终止点',
- }]
- },
- {
- label: '预计时长(小时)',
- name: 'estimate',
- type: 'number',
- defaultValue: 1,
- additionalProps: {
- min: 1,
- },
- rules: [{
- required: true,
- message: '请输入预计时长',
- }]
- },
- ]
- })],
- [2]: [CommonInfoModel, () => ({
- formItems: [
- {
- label: '活动标题',
- name: 'activity',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入活动标题',
- },
- rules: [{
- required: true,
- message: '请输入活动标题',
- }]
- },
- {
- label: '活动开始时间',
- name: 'startTime',
- type: 'datetime',
- defaultValue: '',
- additionalProps: {
- type: 'datetime',
- },
- rules: [{
- required: true,
- message: '请选择活动开始时间',
- }],
- },
- {
- label: '活动结束时间',
- name: 'endTime',
- type: 'datetime',
- defaultValue: '',
- additionalProps: {
- type: 'datetime',
- },
- rules: [{
- required: true,
- message: '请选择活动结束时间',
- }],
- },
- {
- label: '活动时长(分钟)',
- name: 'duration',
- type: 'number',
- defaultValue: 0,
- additionalProps: {
- min: 0,
- },
- rules: [{
- required: true,
- message: '请选择活动时长',
- }],
- },
- ]
- })],
- [3]: [CommonInfoModel, () => ({
- formItems: [
- {
- label: '特色',
- name: 'advant',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入特色',
- maxLength: 300,
- showWordLimit: true,
- } as FieldProps,
- rules: [{
- required: true,
- message: '请输入特色',
- }]
- },
- {
- label: '文化背景',
- name: 'intro',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入文化背景',
- maxLength: 300,
- showWordLimit: true,
- } as FieldProps,
- rules: [{
- required: true,
- message: '请输入文化背景',
- }]
- },
- {
- label: '精彩推荐',
- name: 'recommend',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入精彩推荐',
- maxLength: 300,
- showWordLimit: true,
- } as FieldProps,
- rules: [{
- required: true,
- message: '请输入精彩推荐',
- }]
- },
- {
- label: '推荐描述',
- name: 'reason',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入推荐描述',
- maxLength: 300,
- showWordLimit: true,
- } as FieldProps,
- rules: [{
- required: true,
- message: '请输入推荐描述',
- }]
- },
- {
- label: '活动亮点',
- name: 'highlight',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入活动亮点',
- maxLength: 300,
- showWordLimit: true,
- } as FieldProps,
- rules: [{
- required: true,
- message: '请输入活动亮点',
- }]
- },
- {
- label: '图片视频',
- name: 'images',
- type: 'uploader',
- defaultValue: '',
- additionalProps: {
- upload: useAliOssUploadCo('xiangyuan/activity'),
- maxFileSize: 1024 * 1024 * 20,
- maxUploadCount: 20,
- } as UploaderFieldProps,
- rules: []
- },
- ]
- })]
- },
- 'food_product': {
- [1]: villageInfoFoodProductsForm,
- [2]: villageInfoFoodProductsForm,
- [3]: villageInfoFoodProductsForm,
- [4]: villageInfoFoodProductsForm,
- [5]: villageInfoFoodProductsForm,
- [6]: villageInfoFoodProductsForm,
- },
- 'collect': {
- [1]: [CommonInfoModel, () => ({
- formItems: [
- {
- label: '标题',
- name: 'name',
- type: 'text',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入标题',
- } as FieldProps,
- rules: [{
- required: true,
- message: '请输入标题',
- }]
- },
- {
- 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',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入描述',
- maxLength: 200,
- showWordLimit: true,
- } as FieldProps,
- rules: []
- },
- {
- label: '内容',
- name: 'content',
- type: 'richtext',
- defaultValue: '',
- additionalProps: {
- placeholder: '请输入内容',
- maxLength: 2000,
- showWordLimit: true,
- } as FieldProps,
- rules: []
- }
- ]
- })]
- },
- }
- export function getVillageInfoForm(subType: string, subId: number) {
- const group = villageInfoForm[subType];
- if (!group)
- throw new Error('subType ' + subType + ' not found');
- return group[subId];
- }
|