<template>
  <base-form slot="content" ref="ruleForm" :data="searchData">
    <div slot="footer">
      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
      <el-button :loading="listLoading" icon="el-icon-plus" class="xl-form-btn bgc2" @click="addHandle">添加</el-button>
      <el-button :loading="listLoading" class="xl-form-btn bgc3" @click="linkMap">地图</el-button>
    </div>
  </base-form>
</template>
<script>
export default {
  props: {
    listLoading: Boolean
  },
  inject: ['parentData'],
  mixins,
  data() {
    return {
      searchData: []
    }
  },
  mounted () {
    this.getDef()
  },
  methods: {
    linkMap () {
      this.$router.push('/shop/map')
    },
    addHandle () {
      this.parentData.isDtlShow = true
      this.parentData.curObj = {}
    },
    getDef (str) {
      this.searchData = [
        { label: '是否签约', key: 'signing', type: 'select', options: this.$dictData.sys_yesno},
        { label: '所属区域', key: 'area_type', type: 'select', options: this.$dictData.area_type},
        { label: '门店名称', key: 'store_name' },
        { label: '店长', key: 'store_manager' },
        { label: '店长电话', key: 'manager_phone' },
      ]
      // this.setDefaultValue(params, 'searchData')
    },
    searchHandle() {
      const oldform = this.$refs.ruleForm.baseForm
      const newForm = { ...oldform }
      this.$emit('change', newForm)
    }
  }
}
</script>
