<template>
  <div class='auto' id="adjustTree">
    <tree :model="model" v-ref:tree id='defaultTreeOpen'>
      <span partial>{{row.data.name}}
      </span>
    </tree>
    <button type="button" name="button" class="btn btn-primary auto" @click="save()">保存</button>
  </div>
</template>

<script>
import * as Util from "../Util"

export default {
  title: "调整资源位置",
  props: [
    'data' // 要调整的资源
  ],
  data () {
    return {
      model: Util.f,  // 资源树的内容
    }
  },
  methods: {
    // 保存调整结果
    save () {
      console.log("进入保存函数")
      return this.$resetpost(`rs/data/adjust/${this.$refs.tree.selected.id}/${this.data.id}`, {})
    }
  }
}
</script>
<style>
  .all-checked {
    vertical-align: text-top;
    margin-left: 10px !important;
  }
  td > .glyphicon {
    cursor: pointer;
  }
  th > input[type="checkbox"], td > input[type="checkbox"] {
    cursor: pointer;
  }
  #adjustTree div{
    margin-left: 0px;
    color: #000;
  }
  #adjustTree span {
    color: #000;
  }
  #adjustTree .list-group-item {
    background-color: #fff;
    border: none;
  }
  #adjustTree .list-group-item.active,
  #adjustTree  .list-group-item.active:hover,
  #adjustTree  .list-group-item.active:focus {
    background-color: #fff;
  }

  #adjustTree .active {
    background-color: #5cb85c !important;
  }
</style>
