/**
 * @desc 预警设置
 */


// 基本信息内容
const formRow = [
  {
    elCol: [
      {
        label: '消息模版',
        prop: 'messageTemplateId',
        tag: 'elSelect',
        options: [],
        optionValue: 'id',
        optionLabel: 'templateName',
      },
      {
        label: '应用',
        prop: 'appIdList',
        tag: 'elMultiple',
        options: [],
        optionValue: 'id',
        optionLabel: 'name',
      }
    ]
  },
  {
    elCol: [
      {
        label: '接收人',
        prop: 'recipientNameList',
        tag: "elDialog",
      },
      {
        label: '推送方式',
        prop: 'warningAppId',
        tag: 'elMultiple',
        options: [],
        optionValue: 'id',
        optionLabel: 'name',
      }
    ]
  },
  {
    elCol: [
      {
        label: '消息API',
        prop: 'acceptMessageApiCode',
        tag: 'elInput',
        disabled:true,
        placeholder:"选择推送方式自动带出",
        span: 24,
      }
    ]
  },
  {
    elCol: [
      {
        label: '备注',
        prop: 'remark',
        tag: 'elInput',
        type: 'textarea',
        span: 24,
      }
    ]
  }
]
const formRowShow = [
  {
    elCol: [
      {
        label: '消息模版',
        prop: 'templateName',
        tag: 'elInput',
        disabled:true
      },
      {
        label: '应用',
        prop: 'appNameList',
        tag: 'elInput',
        disabled:true
      }
    ]
  },
  {
    elCol: [
      {
        label: '接收人',
        prop: 'recipientNameList',
        tag: "elInput",
        disabled:true
      },
      {
        label: '推送方式',
        prop: 'warningAppNameList',
        tag: 'elInput',
        disabled:true
      }
    ]
  },
  {
    elCol: [
      {
        label: '消息API',
        prop: 'acceptMessageApiCode',
        tag: 'elInput',
        disabled:true,
        span: 24,
      }
    ]
  },
  {
    elCol: [
      {
        label: '备注',
        prop: 'remark',
        tag: 'elInput',
        type: 'textarea',
        span: 24,
        disabled:true
      }
    ]
  }
]

const basicsRules = {
  messageTemplateId: [{
    required: true,
    message: '请选择消息模板',
    trigger: 'blur'
  }],
  appIdList: [{
    required: true,
    message: '请选择应用',
    trigger: 'blur'
  }],
  recipientNameList: [{
    required: true,
    message: '请选择接收人',
    trigger: 'blur'
  }],
  warningAppId: [{
    required: true,
    message: '请选择推送方式',
    trigger: 'blur'
  }],
}

const tableChildColumn = [
  {
    label: "应用名称",
    prop: "appName",
    tooltip: true,
  },
  {
    label: "API名称",
    prop: "apiName",
    tooltip: true,
  },
  {
    label: "API编码",
    prop: "apiCode",
    tooltip: true,
  },
  {
    label: "推送方式",
    prop: "pushMethod",
    tooltip: true,
  },
  {
    label: "状态",
    prop: "status",
    tooltip: true,
  },
]
export default {
  formRow,
  basicsRules,
  tableChildColumn,
  formRowShow
}