<template>
  <div>
    <swtich-tab @swtichClick="swtichClick" :swtichText="swtichText"></swtich-tab>
    <view-title :titleText="'地址管理'" @addAddress="addAddress"></view-title>
    <ctable :data="tableData"
            :headArr="headArr"
            :StyleWidth="StyleWidth"
            :controlArray="controlArray"
            @deteleItem="deteleItem"
            @updateItem="updateItem"
            @setAutoFn="setAutoFn"
            @clickTwo="clickTwo"
            :totalElements="totalElements"
            @handleCurrentChange="handleCurrentChange"
            :currentPage="currentPage"
    >
    </ctable>
    <address-alert
      :IslookOrUpdate="IslookOrUpdate"
      @closeAlert="closeAlert"
      :AlertTitle="AlertTitle"
      ref="addressAlert"
      :chooseItem="chooseItem"
    >

    </address-alert>
  </div>
</template>

<script>
  import { Ctable } from '@/components/base/table'
  import { CtableClass } from '@/utils/CtableClass'
  import { swtichTab, viewTitle } from '@/components/base/switchTab'
  import { addressAlert } from '@/components/clientPage'
  import { AddressMode } from '@/utils/mixin'
  export default {
    name: 'AddressView',
    fetch ({store}) {
      return Promise.all([
        store.dispatch('address/getAddressList', {page: 1, count: 10, type: 101})
      ])
    },
    components: {
      Ctable,
      swtichTab,
      viewTitle,
      addressAlert
    },
    mixins: [AddressMode],
    computed: {
      swtichText() {
        return ['公司地址', '收货地址']
      }
    }
  }
</script>

<style scoped type="text/scss" lang="scss">

</style>
