<template>
  <div class="collection">
    <el-tree
      :data="tableData"
      :props="collectProps"
      node-key="id"
      default-expand-all
      :expand-on-click-node="false"
    >
      <span slot-scope="{ node, data }" class="custom-tree-node" :name="node.id">
        <span style="display: inline-block;min-width: 100px">{{ node.label }}</span>
        <span :class="[currentNumber == node.id ? 'active' : 'dis']">
          <span class="ml15" @click="delMenu(data)">
            <!--            <a-icon type="minus-circle" />-->
          </span>
          <span class="mr30" @click="addMenu(1,data)">
            <!--            <a-icon type="plus-circle" />-->
          </span>
          <span>
            <el-button
              type="text"
              size="mini"
              @click="() => addMenu(2,data)"
            >
              新增子级
            </el-button>
            <el-button
              type="text"
              size="mini"
              @click="() => editMenu(node, data)"
            >
              配置
            </el-button>
          </span>
        </span>
      </span>
    </el-tree>

    <div v-if="collectData.length">
      <div style="text-align: center;padding-top: 32px">
        <el-input v-model="remark" type="textarea" style="width: 180px;" size="small" clearable placeholder="请输入备注" />
      </div>
      <div style="text-align: center;padding-top: 16px">
        <el-button style="width: 180px" type="primary" size="small" @click="handleAddPatient">保存</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import dialogjs from '@/mixins/dialog'
import infoDetail from './infoDetail'

export default {
  components: {
    infoDetail
  },
  mixins: [dialogjs],
  props: {
    patientIdNumber: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      remark: '',
      currentNumber: '',
      collectProps: {
        // children: 'childs',
        // label: 'name'
      },
      collectData: [],
      tableData: [{
        id: 1,
        label: '一级 1',
        children: [{
          id: 4,
          label: '二级 1-1',
          children: [{
            id: 9,
            label: '三级 1-1-1'
          }, {
            id: 10,
            label: '三级 1-1-2'
          }]
        }]
      }, {
        id: 2,
        label: '一级 2',
        children: [{
          id: 5,
          label: '二级 2-1'
        }, {
          id: 6,
          label: '二级 2-2'
        }]
      }, {
        id: 3,
        label: '一级 3',
        children: [{
          id: 7,
          label: '二级 3-1'
        }, {
          id: 8,
          label: '二级 3-2'
        }]
      }],
      setPlanList: [],
      addFollowList: [],
      patientInfoHeadHeight: '',
      crfSelectVisible: false
    }
  },
  watch: {

  },
  created() {

  },
  mounted() {

  },
  methods: {
    searchRemark(data) {
      // this.treeId = data.id
      // this.remark = data.hisManagePatientEntity ? data.hisManagePatientEntity.remark : ''
      // this.remarkId = data.hisManagePatientEntity ? data.hisManagePatientEntity.id : ''
    },
    async handleAddPatient() {

    }
  }
}
</script>

<style lang="scss" scoped>
.collection {
  width: 600px;
  .cell-cursor {
    cursor: pointer;
    color: #1e79ff;
  }
  .table-column-disable {
    color: #dddd;
  }
}
</style>
