const setQueryFormItmes = (self) => {
  let options= [
    { label: "小程序", value: "wechat" },
    { label: "设备", value: "device" },
  ]
  if (self.$auth('deviceLink')) {
    options.push({ label: "设备直连", value: "deviceLink" })
  }
  return [
    {
      name: 'shipBillNo', label: '运单号', type: 'input', required: true,
      value:process.env.NODE_ENV === 'development'?'YD1000059880':''
    },
    {
      type: "radio",
      name: "urlType",
      label: "",
      value: "device",
      options
    },
  ]
}

import { getLocationMapData,getPathMapData } from '../js/api.js'
import { UPCLOUD_RDC_TMS_BUSINESS_SERVICE } from '@/config/serviceSettings.js'

export default {
  data() {
    return {
      mx_queryFromItems: setQueryFormItmes(this),

      mx_pathLineData:null,//轨迹点

    }
  },
  methods: {
    getFieldsValue() {
      return this.$refs.searchBar.getFieldsValue()
    },
    searchSubmit(data) {


      this.mapData = null
      this.$refs.mainTable.dataSource = []
      this.mainId=null

      if (this.type == 'path') {
        this.mode = 2
        this.mainId=null
        return this.$nextTick(() => {
          this.$refs.mainTable.reload({ data }).then(() => {

            this.dataList = {
              2:this.$refs.mainTable.dataSource,
              3:[],
              4:[]
            }
          })
        })
      } else if (this.type == 'location') {
        this.$refs.mainTable.reload({ data });

      }



    },
  }
}
