/**
 * @desc 消息管理日志
 * @date 2023-08-31
 */
// 表头
const tableColumnData = [
  {
    label: '发送者应用',
    prop: 'sendAppName',
    tooltip: true,
  },
  {
    label: '源数据',
    prop: 'sourceData',
    tooltip: true,
  },
  {
    label: '目标数据',
    prop: 'targetData',
    tooltip: true,
  },
  {
    label: '状态',
    prop: 'status',
    tooltip: true,
  },
  {
    label: '错误状态',
    prop: 'errorStatus',
    tooltip: true,
  },
  {
    label: '返回信息',
    prop: 'returnData',
    tooltip: true,
  }, {
    label: '创建时间',
    prop: 'createTime',
    tooltip: true,
  },
]
const tableVersionColumn = [
  {
    label: '接收者名称',
    prop: 'receiveName',
  },
  {
    label: '接收者编码',
    prop: 'receiveCode',
  },
  {
    label: '接收者应用',
    prop: 'receiveApp',
  },
  {
    label: '接收者',
    prop: 'receiveApi',
  },
  {
    label: '数据类型',
    prop: 'dataType',
  },
  {
    label: '备注',
    prop: 'remark',
  },
]

// 基本信息内容
const formRow = [
  {
    elCol: [{
      label: '消息管理名称',
      prop: 'theme',
      tag: 'elInput',
      disabled: true,
      span: 24
    }]
  },
  {
    elCol: [{
      label: '发送者应用',
      prop: 'sendApp',
      tag: 'elSelect',
      disabled: true,
      options: [],
      optionValue: 'id',
      optionLabel: 'name',
    }, {
      label: '发送者',
      prop: 'sendApi',
      tag: 'elSelect',
      disabled: true,
      options: [],
      optionValue: 'id',
      optionLabel: 'apiName',
    }]
  },
  {
    elCol: [{
      label: '接收者应用',
      prop: 'receiveApp',
      tag: 'elSelect',
      disabled: true,
      options: [],
      optionValue: 'id',
      optionLabel: 'name',
    }, {
      label: '接收者',
      prop: 'receiveApi',
      tag: 'elSelect',
      disabled: true,
      options: [],
      optionValue: 'id',
      optionLabel: 'apiName',
    }]
  },
  {
    elCol: [{
      label: '源数据',
      prop: 'sourceData',
      tag: 'elSlot',
      slotName: "sourceData",
      span: 24,
    }]
  },
  {
    elCol: [{
      label: '目标数据',
      prop: 'targetData',
      tag: 'elSlot',
      slotName: "targetData",
      span: 24,
    }]
  },
  {
    elCol: [{
      label: '状态',
      prop: 'status',
      tag: 'elRadio',
      disabled: true,
      span: 24,
      options: [
        {value: "1", label: "待发送"},
        {value: "2", label: "发送中"},
        {value: "3", label: "发送成功"},
        {value: "4", label: "发送失败"},
      ],
    },]
  },
  {
    elCol: [{
      label: '错误状态',
      prop: 'error_status',
      tag: 'elRadio',
      disabled: true,
      span: 24,
      options: [
        {value: "1", label: "需要重新发送"},
        {value: "2", label: "不需要重新发送"},
      ],
    },]
  },
  {
    elCol: [{
      label: '返回信息',
      prop: 'returnData',
      tag: 'elInput',
      type: 'textarea',
      disabled: true,
      span: 24,
    }]
  },
]

const basicsRules = {
  sourceData: [{
    required: true,
    message: '请输入源数据',
    trigger: 'blur'
  }],
  targetData: [{
    required: true,
    message: '请输入目标数据',
    trigger: 'blur'
  }],
}

// 查看
const formRowShow = [
  {
    elCol: [{
      label: '发送者应用',
      prop: 'sendApp',
      tag: 'elSelect',
      disabled: true,
      options: [],
      optionValue: 'id',
      optionLabel: 'name',
    },]
  },
  {
    elCol: [{
      label: '源数据',
      prop: 'sourceData',
      tag: 'elInput',
      disabled: true,
      type: 'textarea',
      span: 24,
    }]
  },
  {
    elCol: [{
      label: '目标数据',
      prop: 'targetData',
      tag: 'elInput',
      disabled: true,
      type: 'textarea',
      span: 24,
    }]
  },
  {
    elCol: [{
      label: '状态',
      prop: 'status',
      tag: 'elRadio',
      disabled: true,
      span: 24,
      options: [
        {value: "1", label: "待发送"},
        {value: "2", label: "发送中"},
        {value: "3", label: "发送成功"},
        {value: "4", label: "发送失败"},
      ],
    },]
  },
  {
    elCol: [{
      label: '错误状态',
      prop: 'errorStatus',
      tag: 'elRadio',
      disabled: true,
      span: 24,
      options: [
        {value: "1", label: "需要重新发送"},
        {value: "2", label: "不需要重新发送"},
      ],
    },]
  },
  {
    elCol: [{
      label: '返回信息',
      prop: 'returnData',
      tag: 'elInput',
      type: 'textarea',
      disabled: true,
      span: 24,
    }]
  },
]
export default {
  tableColumnData,
  formRow,
  basicsRules,
  formRowShow,
  tableVersionColumn
}
