/** certificate证件资料弹出查询配置 */
function setCertificate(object) {
  return [
    // { name: 'consignorid', type: 'input', hidden: true },
    {
      label: '货主选择',
      type: 'searchModal',
      name: 'consignorNameCode',
      remoteUrl: { url: '/api/oms-std-maindata/pubCertificate/pubCertificatePopupQuery/v1.0', method: 'post' },
      rowKey: 'id',
      toolBar: {
        items: [
          {
            type: 'input',
            name: 'consignorcode',
            label: '货主编码',
            value: ''
          },
          {
            type: 'input',
            name: 'consignorname',
            label: '货主名称',
            value: ''
          }
        ]
      },
      tableConfig: {
        columns: [
          {
            dataIndex: 'consignorcode',
            title: '货主编码'
          },
          {
            dataIndex: 'consignorname',
            title: '货主名称'
          }
        ]
      },
      on: {
        searchAfter(value, event, form) {
          console.log(this)
        },
        ok(event, value, rowData, form) {
          form.setFieldsValue({
            consignorNameCode: `${rowData[0].consignorname}[${rowData[0].consignorcode}]`
          })
          if (object && object.on && typeof object.on.ok == 'function') {
            object.on.ok(event, value, rowData, form)
          }
        }
      }
    }
  ]
}

export default setPubConsignor
