import { reactive } from 'vue'
import { NOTICE_SOURCE, ADVERTISING_STATUS } from '@/utils/dictionary.js'

export const form = reactive({
  noticeForm: {
    image: null,
    title: null,
    source: 1,
    status: 1,
    url: null,
    guide: null,
    content: null
  },
  noticeRules: {
    title: [{ required: true, message: '请输入广告标题', trigger: 'blur' }]
  },
  formItem: [
    { type: 'oss', refIndex: 0, key: 'imageStatus', file: 'image', label: '公告图片' },

    { type: 'input', key: 'title', label: '通知标题', props: { maxlength: '20', placeholder: '请输入通知标题', clearable: true }},
    { type: 'select', key: 'source', label: '通知来源', props: { options: NOTICE_SOURCE, placeholder: '请选择通知来源' }},

    { type: 'radio', key: 'status', label: '通知状态', options: ADVERTISING_STATUS },
    { type: 'input', key: 'url', label: '外部地址', props: { maxlength: '20', placeholder: '请输入外部地址', clearable: true }},

    { type: 'input', key: 'guide', label: '公告摘要', props: { maxlength: '20', placeholder: '请输入公告摘要', clearable: true }},

    { type: 'editor', key: 'content', label: '通知内容', props: { height: 350 }}
  ]
})

