<template>
  <div
    class="pb_content"
    style="
      background: unset;
      overflow: auto;
      padding: 20px;
      margin: 0;
      box-sizing: border-box;
    "
  >
    <div
      style="
        position: absolute;
        width: 95%;
        top: 0;
        height: 100%;
        left: 50%;
        transform: translateX(-50%);
      "
    >
      <div
        class="pb_content_body"
        style="
          background: #fff;
          padding: 0px 25px;
          box-sizing: border-box;
          border-top-left-radius: 5px;
          border-top-right-radius: 5px;
          margin: 10px auto 0;
        "
      >
        <div class="pb_head pb_head_top">
          <div>
            <span :class="{ sub_head: type == 0 }" @click="type = 0"
              >模型库</span
            >
            <span :class="{ sub_head: type == 1 }" @click="type = 1"
              >行为数据库</span
            >
          </div>
          <div class="student_button" v-if="type == 0">
            <el-button type="primary" class="bgColor" @click="isNoJump"
              >创建模型</el-button
            >
          </div>
        </div>
      </div>
      <div style="height: calc(100% - 80px)">
        <ModelBase v-if="type == 0"></ModelBase>
        <BeDataBase v-else :uuid="userid" :ooid="oid"></BeDataBase>
      </div>
    </div>
  </div>
</template>

<script>
import ModelBase from "./components/modelBase";
import BeDataBase from "./components/beDataBase";
export default {
  components: {
    ModelBase,
    BeDataBase,
  },
  data() {
    return {
      type: 0,
      userid: this.$route.query.userid,
      org: this.$route.query.org,
      oid: this.$route.query.oid,
    };
  },
  methods: {
    goTo(path) {
      this.$router.push(path);
    },
    isNoJump() {
      this.$message.warning("暂未开放此功能！");
    },
  },
};
</script>

<style scoped>
.pb_head > div:nth-child(1) > span:nth-child(1),
.pb_head > div:nth-child(1) > span:nth-child(2) {
  font-size: 26px;
  cursor: pointer;
  color: #999;
}
.pb_head > div:nth-child(1) > span:nth-child(2) {
  margin: 0 10px;
}
.pb_head > div:nth-child(1) > span:nth-child(1):hover,
.pb_head > div:nth-child(1) > span:nth-child(2):hover {
  color: #000;
}
.pb_head {
  margin: 0 !important;
  width: 100% !important;
}
.student_page {
  margin-top: 10px;
}
.sub_head {
  position: relative;
  color: #000 !important;
}
.sub_head::after {
  content: "";
  width: 100%;
  background: #5a9cea;
  height: 2px;
  position: absolute;
  left: 0;
  bottom: -12px;
}
.student_button {
  display: flex;
  overflow: hidden;
  height: 40px;
}
.pb_head_top {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 10px 5px 10px 0 !important;
}
.bgColor {
  background: #466b99;
}
</style>