<template>
  <!-- 选择地点 -->
  <!-- 内容 -->
  <div class="py-2 px-4 border-b ">
    <div class="flex items-center text-sm" @click="clickShow()">
      <app-icon
        icon-name="avator"
        class-name="w-8 h-8 flex items-center"
      />
      <div class="px-4">{{ people }}</div>
    </div>
    <div v-if="show" class="mx-10">
      <div v-for="(object,index) in objects" :key="index" class=" rounded">
        <div class="border-b pl-2.5 pr-1 w-full  flex items-center text-sm" :class="classBorder(index)" @click="clickIcon(index)">
          <app-icon
            slot="icon"
            :icon-name="checked === index+'' ? 'radio-checked': 'radio'"
            class-name="w-6 h-6 mr-2 flex items-center"
          />
          <div class="w-screen text-text-secondary">{{ object }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
  name: 'OObjective',
  components: {
    'app-icon': () => import('@/components/common/Icon.vue')
  },
  data() {
    return {
      show: false,
      currentKey: 'leader',
      people: '点击展开 再次点击姓名 收起',
      objects: [
        '部门日常任务',
        '美的金融',
        '提高公司知名度'
      ],
      checked: '',
      radio: ''
    }
  },
  computed: {

  },
  created() {
    // console.log(Mock, 'mock')
  },
  methods: {
    clickShow() {
      this.show = !this.show
    },
    clickIcon(index:number) {
      this.checked = index + ''
    },
    classBorder(index:number) {
      if (index === this.objects.length - 1) {
        return 'border-none pb-0'
      }
      if (index === 0) {
        return 'mt-3'
      }
    }
  }
})
</script>

<style lang="less" scoped>

</style>
