<template>
  <div @dblclick="addPersonSelect" class="unit person">
    <el-checkbox v-if="selectType!==1" @change="checkStateChange" v-model="checked"></el-checkbox>
    <span class="unitIcon"><i class="iconfont iconrenyuan"></i></span>
    {{personData.name}}
  </div>
</template>

<script>
  //vuex
  import {mapState, mapGetters, mapMutations, mapActions} from 'vuex'
  //通信总线
  import Bus from 'common/js/bus.js'
  //公共混入
  import commonMixin from 'common/js/commonMixin'
  
  export default {
    name: "personItem",
    mixins: [commonMixin],
    data() {
      return {
        checked: false
      }
    },
    props: ["personData", 'selectType', 'selectWay'],
    computed: {},
    watch: {},
    methods: {
      checkStateChange() {
        Bus.$emit('personListModify', {item: this.personData, type: this.checked})
      },
      addPersonSelect() {
        this.checked = !this.checked
        this.checkStateChange()
        //Bus.$emit('addPersonSelect', this.personData)
      }
    },
    filters: {},
    components: {},
    activated() {
    },
    mounted() {
    }
  }
</script>

<style lang="stylus" scoped>
  @import "./mixPicker.styl"
</style>