<template>
  <div>
    <el-input v-model="names" v-bind="$attrs" v-on="$listeners" @focus="isPop=true"></el-input>
    <el-dialog title="请选择部门或者人员" :visible.sync="isPop" width='700px' center append-to-body>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="date" label="日期" width="180">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="address" label="地址">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="100">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">选择</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!--       <span slot="footer" class="dialog-footer">
        <el-button @click="isPop = false">取 消</el-button>
        <el-button type="primary" @click="onSubmit">确 定</el-button>
      </span> -->
    </el-dialog>
  </div>

</template>

<script>
//列如：import <<组件名称>> from '《组件路径》';
export default {
  components: {},
  props: {
    item: {
      type: Object,
      required: true,
    },
    faNode: {
      type: Object,
      required: true,
    },
    nodeKey: {
      type: String,
      required: true,
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      names: "",
      isPop: false,
      tableData: [
        {
          date: "2016-05-02",
          name: "王大狗",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王白花",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王巨鹿",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
    };
  },
  watch: {},
  computed: {},
  //方法集合
  methods: {
    handleClick(data) {
      this.$set(this.faNode, this.nodeKey, data.name);
      this.names = data.name;
      this.isPop = false;
    },
  },
  //生命周期，创建完成（可以访问当前this实例）
  created() {},
  //生命周期，挂载完成（可以访问dom元素）
  mounted() {},
};
</script>
<style scoped>
</style>