<!--
@name: 承运商管理-司机信息
@author: 张泽贤
@time: 20223-02-22
@doc:
-->
<template>
  <p-table
    dragle
    bordered
    autoColWidth
    row-key="id"
    :id="$route.meta.menuId + '_driverInfo'"
    :scroll="{ x: true }"
    :columns="mx_columns"
    :data-source.sync="dataSource"
    :remote-url="listRemoteUrl"
    :remoteData="listParams"
    :rowSelectType="false"
    :autoLoad="false"
  ></p-table>
</template>

<script>
import { pageCarrierDriver } from '../js/api.js';
import { setDriverColumns } from '../js/tableConfig.js';

export default {
  props: {
    editCode: {
      type: String,
      default: '',
    },
  },
  data() {
    return {
      // 主表格
      dataSource: [],
      listRemoteUrl: pageCarrierDriver,
      listParams: {},
      mx_columns: setDriverColumns(this, this.tableExtendedField),
      tableExtendedField: [],
    };
  },
  methods: {
    onSearch(nVal) {
      if (nVal) {
        this.listParams = { carrierId: nVal };
      } else {
        this.dataSource = [];
      }
    },
  },
};
</script>