import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE } from '@/config/serviceSettings.js'
const serviceName = UPCLOUD_RDC_TMS_MAINDATA_SERVICE

export const carAttr = {
  label: '车辆',
  placeholder: '请选择车辆',
  targetClick: true,
  targetValueKey: 'code',
  remoteUrl: { url: serviceName + '/vehicle/popup', method: 'post' },
  rowKey: 'id',
  toolBar: {
    items: [
      { type: 'input', name: 'code', label: '车辆编码' },
      { type: 'input', name: 'plateNumber', label: '车牌号' },
    ],
  },
  tableConfig: {
    columns: [
      { dataIndex: 'code', title: '车辆编码' },
      { dataIndex: 'plateNumber', title: '车牌号' },
      { dataIndex: 'typeName', title: '归属' },
      { dataIndex: 'affiliationName', title: '隶属机构' },
    ],
  },
}

export const driverAttr = {
  label: '司机',
  placeholder: '请选择司机',
  targetClick: true,
  targetValueKey: 'code',
  remoteUrl: { url: serviceName + '/driver/popup', method: 'post' },
  rowKey: 'id',
  toolBar: {
    items: [
      { type: 'input', name: 'code', label: '司机编码' },
      { type: 'input', name: 'name', label: '司机名称' },
    ],
  },
  tableConfig: {
    columns: [
      { dataIndex: 'code', title: '司机编码' },
      { dataIndex: 'name', title: '司机姓名' },
      { dataIndex: 'phoneNumber', title: '手机号' },
      { dataIndex: 'typeName', title: '归属' },
      { dataIndex: 'affiliationName', title: '隶属机构' },
    ],
  },
}

export const deliveryAttr = {
  label: '送货员',
  placeholder: '请选择送货员',
  targetClick: true,
  targetValueKey: 'code',
  remoteUrl: { url: serviceName + '/deliveryman/popup', method: 'post' },
  rowKey: 'id',
  toolBar: {
    items: [
      { type: 'input', name: 'code', title: '送货员编码' },
      { type: 'input', name: 'name', title: '送货员名称' },
    ],
  },
  tableConfig: {
    columns: [
      { dataIndex: 'code', title: '送货员编码' },
      { dataIndex: 'name', title: '送货员姓名' },
      { dataIndex: 'phoneNumber', title: '手机号' },
      { dataIndex: 'typeName', title: '归属' },
      { dataIndex: 'affiliationName', title: '隶属机构' },
    ],
  },
}
