/** pubConsignor货主弹出查询配置 */
function setPubConsignor(obj = {}) {
  let vName = '货主'
  let code = 'consignor'
  let baseObject = { itemcode: true, label: '选择货主', remoteData: {}, required: false, disabled: false, ...obj }
  const { name, targetValueKey, consignor, label, remoteData, search, ok, change, required, disabled } = baseObject

  return [
    {
      label,
      type: 'searchModal',
      targetClick: true,
      name: name || code + 'name',
      required,
      disabled,
      remoteData,
      targetValueKey: targetValueKey || code + 'name',
      remoteUrl: { url: '/api/oms-std-maindata/pubConsignor/pubConsignorPopupQuery/v1.0', method: 'post' },
      rowKey: code + 'id',
      toolBar: {
        items: [
          {
            type: 'input',
            name: code + 'code',
            label: vName + '编码',
            value: ''
          },
          {
            type: 'input',
            name: code + 'name',
            label: vName + '名称',
            value: ''
          }
        ]
      },
      tableConfig: {
        columns: [
          {
            dataIndex: code + 'code',
            title: vName + '编码'
          },
          {
            dataIndex: code + 'name',
            title: vName + '名称'
          }
        ]
      },
      on: {
        search,
        change,
        ok
      }
    }
    // { name: 'consignorcode', type: 'input', hidden: !consignor },
    // { name: 'consignorid', type: 'input', hidden: true }
  ]
}
export default setPubConsignor
