
/**模板
 *
 */
export default {
  data() {
    return {
      addressAnalysisShow: 0,
      addressType: 'consignor',
      addressData: {}, // 新增修改时带过去的经纬度、地址信息
      addressSearchData: {}, // 列表点击地址解析时的查询传参


    };
  },
  methods: {
    mapPase(type, selectedRowKeys) {
      this.addressData = {}

      if (selectedRowKeys.length > 0) {
          let cargoOwnerIds = selectedRowKeys.map((str) => {
            return {
              cargoOwnerId: str,
            }
          })
          this.addressSearchData = { cargoOwnerIds, search: '' }
        this.addressType = type

      }
      this.addressAnalysisShow = 2
    },
    addressBack() {
      let formName = ''
      this.addressAnalysisShow = 0
      this.addressData = {}
      formName = 'main'
      this.$nextTick(() => {
        this.$refs[formName + 'Table'].reload().then(() => {})
      })
    },
    onShowMap(form) {
      this.addressSearchData = {}
      this.addressData = {}
      this.addressAnalysisShow = 1
      let obj = form.getFieldsValue(['address', 'longitude', 'latitude'])
      if (obj.address) {
        this.addressData = obj
      } else {
        this.addressData = {}
      }

    },
    onMapReturnData(data) {
      let form = this.$refs.formDetails.form()
      form.setFieldsValue(data)
      this.addressAnalysisShow = 0
      this.addressData = {}
    },

  }
};
