import { rules } from './account-config'

export const modalConfig = {
  formItems: [
    {
      required : true ,
      field: 'source',
      prop: 'source',
      type: 'select',
      label: '来源',
      placeholder: '请选择来源',
      options : []
    },
    {
      required : true ,
      field: 'callnum',
      prop: 'callnum',
      type: 'input',
      label: '来电号码',
      placeholder: '请输入来电号码',
      rules:[{validator:(rule,value,callback)=>{
          const reg = /^[0-9]{6,11}$/
            
          if(reg.test(value)) {
            callback()
          }else{
            callback(new Error('请输入正确的格式'))
          }
        }
      }]

    },
    {
      required : true ,
      field: 'caller',
      type: 'input',
      label: '来电人',
      placeholder: '请输入来电人'
    },
    {
      required : true ,
      field: 'project',
      type: 'select',
      label: '项目',
      placeholder: '请选择项目',
      options : []
    },
    {
      required : true,
      field: 'workordercate',
      type: 'elCascader',
      label: '工单类型',
      placeholder: '请选择工单类型',
      props: {
        value: 'id',
        children: 'children',
      },
    },
    {
      required : true ,
      field: 'content',
      prop: 'content',
      type: 'textarea',
      label: '工单内容',
      placeholder: '请输入工单内容'
    },
    { 	
      field: 'isend',
      type: 'switch',
      label: '是否办结',
      placeholder: '请输入是否办结',
      activeValue : 1,
      inactiveValue : 0 
    },
    // {
    //   required : true ,
    //   field: 'result',
    //   type: 'textarea',
    //   label: '办理结果',
    //   placeholder: '请输入办理结果'
    // } 
  ],
  colLayout: { span: 24 },
  itemStyle: {},
  rules:rules
  
}
