import { CommonInfoModel } from '@/api/inhert/VillageInfoApi';
import type { FieldProps } from '@/components/form/Field.vue';
import type { SingleForm } from '../forms';
import { villageCommonContent } from './common';

export const villageInfoGoodsFormItems: SingleForm = [
  CommonInfoModel,
  (r) => ({
    formItems: [
      {
        label: '标题',
        name: 'name',
        type: 'text',
        defaultValue: '',
        additionalProps: {
          placeholder: '请输入标题',
        },
        rules: [{
          required: true,
          message: '请输入标题',
        }],
      },
      {
        label: '价格',
        name: 'price',
        type: 'text',
        defaultValue: '',
        additionalProps: {
          placeholder: '请输入价格',
        },
        rules: [{
          required: true,
          message: '请输入价格',
        }],
      },
      {
        label: '购买渠道',
        name: 'channel',
        type: 'text',
        defaultValue: '',
        additionalProps: {
          placeholder: '请输入购买渠道',
        },
      },
      {
        label: '联系人',
        name: 'contact',
        type: 'text',
        defaultValue: '',
        additionalProps: {
          placeholder: '请输入联系人',
        },
      },
      {
        label: '联系电话',
        name: 'contact_number',
        type: 'text',
        defaultValue: '',
        additionalProps: {
          placeholder: '请输入联系电话',
        },
      },
      ...villageCommonContent(r, {
        title: '记录',
        showTitle: false,
      }).formItems,
    ],
  }),
  { title: '乡源好物', typeName: '' },
];