<template>
  <div
    class="pb_content"
    style="
      background: unset;
      overflow: auto;
      padding: 20px;
      margin: 0;
      box-sizing: border-box;
    "
  >
    <div>
      <div
        class="pb_content_body"
        style="
          background: #fff;
          padding: 0px 25px;
          box-sizing: border-box;
          border-radius: 5px;
        "
      >
        <div class="pb_head top">
          <span>目标管理设置</span>
          <div class="student_button">
            <el-button type="primary" class="bgColor" @click="addED"
              >添加目标管理</el-button
            >
          </div>
        </div>
        <div class="student_head">
          <div class="student_search">
            <el-input placeholder="请输入名称" v-model="sn"></el-input>
            <el-button type="primary" class="btn" @click="search"
              >查询</el-button
            >
          </div>
        </div>
      </div>
      <div class="pb_content_body" style="height: 100%">
        <div class="e_box">
          <div class="e_card" v-for="(item, index) in dataArray" :key="index">
            <div class="e_card_picture">
              <img src="../../assets/e_picture.png" />
            </div>
            <div class="e_card_name">
              <span>{{ item.title }}</span>
            </div>
            <div class="e_card_time">
              <span>{{ item.time }}</span>
            </div>
            <div class="e_card_btn">
              <span @click="checkE(item)">查看</span>
              <span @click="deleteE(item.id)">删除</span>
            </div>
          </div>
          <div
            v-if="dataArray.length === 0"
            style="margin: 0 auto; color: #6e6e6e"
          >
            暂无数据
          </div>
        </div>
        <div class="student_page">
          <el-pagination
            v-if="dataArray.length"
            background
            layout="prev, pager, next"
            :page-size="10"
            :total="total"
            style="padding-bottom: 20px"
            @current-change="handleCurrentChange"
          ></el-pagination>
        </div>
      </div>
    </div>
    <el-dialog
      title="添加目标管理"
      :visible.sync="dialogVisible"
      :append-to-body="true"
      width="100%"
      :before-close="handleClose1"
      class="dialog_diy mubiao_diy"
    >
      <div>
        <div class="e_add_top">
          <div class="e_add_title">
            <span>目标管理名称</span>
            <el-input
              v-model="eTitle"
              placeholder="请输入名称"
              @change="setMindData"
            ></el-input>
          </div>
          <el-button @click="addEJson" type="primary" v-if="!update"
            >保存</el-button
          >
          <el-button @click="updateEJson" type="primary" v-else>保存</el-button>
        </div>
        <div class="e_add_content">
          <div class="e_add_list">
            <div class="e_add_list_title">
              <span>一级目标</span>
              <img src="../../assets/add.png" @click="addE(1)" alt />
            </div>
            <div class="e_add_list_body">
              <div
                class="e_add_list_child"
                v-for="(item, index) in eJson"
                :key="index"
              >
                <span
                  :class="{ active: item.id == fid }"
                  v-if="item.name.length < 8"
                  @click="checkF(item.id)"
                  >{{ item.name }}</span
                >
                <el-tooltip
                  v-else
                  class="item"
                  effect="dark"
                  :content="item.name"
                  placement="top-start"
                >
                  <span
                    :class="{ active: item.id == fid }"
                    @click="checkF(item.id)"
                    >{{ item.name }}</span
                  >
                </el-tooltip>
                <img
                  style="right: 40px"
                  src="../../assets/autorUp.png"
                  @click="updateF(item.id, item.name, 1)"
                  alt
                />
                <img
                  src="../../assets/delete.png"
                  @click="deleteF(item.id)"
                  alt
                />
              </div>
            </div>
            <div class="e_add_list_detail" v-if="fid">
              <textarea
                placeholder="添加目标描述"
                v-model="eJson[fid].detail"
              ></textarea>
            </div>
            <!-- <div class="e_add_list_btn">添加二级标题</div> -->
          </div>
          <div class="e_add_list">
            <div class="e_add_list_title">
              <span>二级目标</span>
              <img
                src="../../assets/add.png"
                @click="addE(2)"
                v-if="fid != ''"
                alt
              />
            </div>
            <div class="e_add_list_body">
              <div
                class="e_add_list_child"
                v-for="(item, index) in fid && eJson[fid].child"
                :key="index"
              >
                <span
                  :class="{ active: item.id == sid }"
                  v-if="item.name.length < 8"
                  @click="checkS(item.id)"
                  >{{ item.name }}</span
                >
                <el-tooltip
                  v-else
                  class="item"
                  effect="dark"
                  :content="item.name"
                  placement="top-start"
                >
                  <span
                    :class="{ active: item.id == sid }"
                    @click="checkS(item.id)"
                    >{{ item.name }}</span
                  >
                </el-tooltip>
                <img
                  style="right: 40px"
                  src="../../assets/autorUp.png"
                  @click="updateF(item.id, item.name, 2)"
                  alt
                />
                <img
                  src="../../assets/delete.png"
                  @click="deleteS(item.id)"
                  alt
                />
              </div>
            </div>
            <div class="e_add_list_detail" v-if="sid">
              <textarea
                placeholder="添加目标描述"
                v-model="eJson[fid].child[sid].detail"
              ></textarea>
            </div>
            <!-- <div class="e_add_list_btn">添加二级标题</div> -->
          </div>
          <div class="e_add_list">
            <div class="e_add_list_title">
              <span>三级目标</span>
              <img
                src="../../assets/add.png"
                @click="addE(3)"
                v-if="sid != ''"
                alt
              />
            </div>
            <div class="e_add_list_body">
              <div
                class="e_add_list_child"
                v-for="(item, index) in fid &&
                sid &&
                eJson[fid].child[sid].child"
                :key="index"
              >
                <span
                  :class="{ active: item.id == tid }"
                  v-if="item.name.length < 8"
                  @click="checkT(item.id)"
                  >{{ item.name }}</span
                >
                <el-tooltip
                  v-else
                  class="item"
                  effect="dark"
                  :content="item.name"
                  placement="top-start"
                >
                  <span
                    :class="{ active: item.id == tid }"
                    @click="checkT(item.id)"
                    >{{ item.name }}</span
                  >
                </el-tooltip>
                <img
                  style="right: 40px"
                  src="../../assets/autorUp.png"
                  @click="updateF(item.id, item.name, 3)"
                  alt
                />
                <img
                  src="../../assets/delete.png"
                  @click="deleteT(item.id)"
                  alt
                />
              </div>
            </div>
            <div class="e_add_list_detail" v-if="tid">
              <textarea
                placeholder="添加目标描述"
                v-model="eJson[fid].child[sid].child[tid].detail"
              ></textarea>
            </div>
            <!-- <div class="e_add_list_btn">添加二级标题</div> -->
          </div>
          <div class="e_add_list_pbox">
            <div class="e_add_list_pbox_title">
              <span class="type_title">切换模式</span>
              <div class="type_content">
                <span :class="{ active: typeMode == 1 }" @click="typeMode = 1"
                  >目标树</span
                >
                <span :class="{ active: typeMode == 2 }" @click="typeMode = 2"
                  >目标罗盘</span
                >
                <span :class="{ active: typeMode == 3 }" @click="typeMode = 3"
                  >目标看板</span
                >
              </div>
            </div>
            <div class="e_add_list_pbox_content">
              <Mind
                :showBar="false"
                :mindData="data"
                v-show="typeMode == 1"
              ></Mind>
              <Sunburst
                :Josn="eJson"
                :num="eJSONNum"
                v-if="typeMode == 2"
              ></Sunburst>
              <SeeBoard
                :Josn="eJson"
                :num="eJSONNum"
                :ename="eTitle"
                v-if="typeMode == 3"
              ></SeeBoard>
            </div>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <!-- <el-button @click="dialogVisible = false">关 闭</el-button>
        <el-button @click="addEJson" type="primary" v-if="!update"
          >确 定</el-button
        >
        <el-button @click="updateEJson" type="primary" v-else>修 改</el-button> -->
        <!-- <el-button @click="dialogVisible = false">关 闭</el-button> -->
      </span>
    </el-dialog>
    <el-dialog
      title="添加子级"
      :visible.sync="dialogVisible3"
      :append-to-body="true"
      width="400px"
      :before-close="handleClose"
      class="dialog_diy tips_diy"
    >
      <div>
        <div class="e_add_title2">
          <span>名称</span>
          <el-input v-model="eName" placeholder="请输入名称"></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible3 = false">关 闭</el-button>
        <el-button @click="addEName" type="primary">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="修改子级"
      :visible.sync="dialogVisible4"
      :append-to-body="true"
      width="400px"
      :before-close="handleClose"
      class="dialog_diy tips_diy"
    >
      <div>
        <div class="e_add_title2">
          <span>名称</span>
          <el-input v-model="eName1" placeholder="请输入名称"></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible4 = false">关 闭</el-button>
        <el-button @click="addEName1" type="primary">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import Mind from "../tools/jsmind";
import Sunburst from "../tools/sunburst";
import SeeBoard from "../tools/seeBoard";
export default {
  components: {
    Mind,
    Sunburst,
    SeeBoard,
  },
  data() {
    return {
      data: {
        meta: {
          name: "example",
          author: "dd@163.com",
          version: "0.2",
        },
        format: "node_array",
        data: [
          { id: "root", isroot: true, topic: "" },
          // { id: "easy", parentid: "root", topic: "Easy" },
          // { id: "easy1", parentid: "easy", topic: "Easy to show" },
          // { id: "easy2", parentid: "easy", topic: "Easy to edit" },
          // { id: "easy3", parentid: "easy", topic: "Easy to store" },
          // { id: "easy4", parentid: "easy", topic: "Easy to embed" },
          // { id: "open", parentid: "root", topic: "Open Source" },
          // { id: "open1", parentid: "open", topic: "on GitHub" },
          // { id: "open2", parentid: "open", topic: "BSD License" },
          // { id: "powerful", parentid: "root", topic: "Powerful" },
          // {
          //   id: "powerful1",
          //   parentid: "powerful",
          //   topic: "Base on Javascript",
          // },
          // { id: "powerful2", parentid: "powerful", topic: "Base on HTML5" },
          // { id: "powerful3", parentid: "powerful", topic: "Depends on you" },
        ],
      },
      page: 1,
      total: 0,
      dialogVisible: false,
      dialogVisible2: false,
      dialogVisible3: false,
      dialogVisible4: false,
      userid: this.$route.query.userid,
      oid: this.$route.query.oid,
      eTitle: "",
      eName: "",
      eName1: "",
      mid: "",
      eJson: {},
      fid: "", //一级
      sid: "", //二级
      tid: "", //二级
      type: 1,
      sn: "",
      dataArray: [],
      update: false,
      eid: "",
      typeMode: 1,
      eJSONNum: 0,
    };
  },
  methods: {
    guid() {
      var _num,
        i,
        _guid = "";
      for (i = 0; i < 32; i++) {
        _guid += Math.floor(Math.random() * 16).toString(16); //随机0  - 16 的数字 转变为16进制的字符串
        _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
        if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
          //会使guid中间加 "-"   形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
          _guid += "-";
        }
      }
      return _guid;
    },
    handleCurrentChange(val) {
      this.page = val;
      this.getData();
    },
    handleClose(done) {
      done();
    },
    handleClose1(done) {
      this.$confirm("是否保存该目标？", "提示", {
        confirmButtonText: "保存并关闭",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          if (!this.update) {
            this.addEJson();
          } else {
            this.updateEJson();
          }
          done();
        })
        .catch(() => {});
    },
    addE(type) {
      this.type = type;
      this.dialogVisible3 = true;
    },
    addEName() {
      if (this.eName == "") {
        this.$message.error("请输入目标");
        return;
      }
      let _id = this.guid();
      if (this.type == 1) {
        this.eJson[_id] = {
          id: _id,
          name: this.eName,
          detail: "",
          child: {},
        };
        this.dialogVisible3 = false;
        this.eName = "";
      } else if (this.type == 2) {
        this.eJson[this.fid].child[_id] = {
          id: _id,
          name: this.eName,
          detail: "",
          child: {},
        };
        this.dialogVisible3 = false;
        this.eName = "";
      } else if (this.type == 3) {
        this.eJson[this.fid].child[this.sid].child[_id] = {
          id: _id,
          name: this.eName,
          detail: "",
          child: [],
        };
        this.dialogVisible3 = false;
        this.eName = "";
      }
      this.eJSONNum++;
      this.setMindData();
    },
    addEName1() {
      if (this.eName1 == "") {
        this.$message.error("请输入目标");
        return;
      }
      if (this.type == 1) {
        this.eJson[this.mid].name = this.eName1;
        this.dialogVisible4 = false;
        this.eName1 = "";
        this.mid = "";
      } else if (this.type == 2) {
        this.eJson[this.fid].child[this.mid].name = this.eName1;
        this.dialogVisible4 = false;
        this.eName1 = "";
        this.mid = "";
      } else if (this.type == 3) {
        this.eJson[this.fid].child[this.sid].child[this.mid].name = this.eName1;
        this.dialogVisible4 = false;
        this.eName1 = "";
        this.mid = "";
      }
      this.eJSONNum++;
      this.setMindData();
    },
    checkF(id) {
      if (this.fid == id) {
        this.fid = "";
      } else {
        this.fid = id;
      }
      this.sid = "";
      this.tid = "";
    },
    checkS(id) {
      if (this.sid == id) {
        this.sid = "";
      } else {
        this.sid = id;
      }
      this.tid = "";
    },
    checkT(id) {
      if (this.tid == id) {
        this.tid = "";
      } else {
        this.tid = id;
      }
    },
    updateF(id, n, t) {
      this.eName1 = n;
      this.mid = id;
      this.type = t;
      this.dialogVisible4 = true;
    },
    deleteF(id) {
      console.log(this.eJson);
      if (JSON.stringify(this.eJson[id].child) != "{}") {
        this.$message.error("请把所有子集删完才可以删除");
        return;
      }
      if (this.fid == id) {
        this.fid = "";
      }
      delete this.eJson[id];
      this.eJSONNum++;
      this.$forceUpdate();
      this.setMindData();
    },
    deleteS(id) {
      if (JSON.stringify(this.eJson[this.fid].child[id].child) != "{}") {
        this.$message.error("请把所有子集删完才可以删除");
        return;
      }
      if (this.sid == id) {
        this.sid = "";
      }
      delete this.eJson[this.fid].child[id];
      this.eJSONNum++;
      this.$forceUpdate();
      this.setMindData();
    },
    deleteT(id) {
      if (this.tid == id) {
        this.tid = "";
      }
      delete this.eJson[this.fid].child[this.sid].child[id];
      this.eJSONNum++;
      this.$forceUpdate();
      this.setMindData();
    },
    addEJson() {
      if (this.eTitle == "") {
        this.$message.error("请填写目标管理标题");
        return;
      }
      let params = [
        {
          uid: this.$route.query.userid,
          t: this.eTitle,
          c: JSON.stringify(this.eJson),
        },
      ];
      this.ajax
        .post(this.$store.state.api + "addEvaluation", params)
        .then((res) => {
          this.$message.success("保存成功");
          this.init();
          this.dialogVisible = false;
          this.getData();
        })
        .catch((err) => {
          this.$message.success("添加失败");
          console.error(err);
        });
    },
    updateEJson() {
      if (this.eTitle == "") {
        this.$message.error("请填写目标管理标题");
        return;
      }
      let params = [
        {
          c: JSON.stringify(this.eJson),
          t: this.eTitle,
          id: this.eid,
        },
      ];
      this.ajax
        .post(this.$store.state.api + "updateEvaluation", params)
        .then((res) => {
          this.$message.success("修改成功");
          this.init();
          this.dialogVisible = false;
          this.getData();
        })
        .catch((err) => {
          this.$message.success("修改失败");
          console.error(err);
        });
    },
    search() {
      this.page = 1;
      this.getData();
    },
    getData() {
      let params = {
        oid: this.oid,
        n: this.sn,
        page: this.page,
      };
      this.ajax
        .get(this.$store.state.api + "getEvaluation", params)
        .then((res) => {
          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
          this.dataArray = res.data[0];
        })
        .catch((err) => {
          console.error(err);
        });
    },
    deleteE(id) {
      this.$confirm("确定删除吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let params = [
            {
              id: id,
            },
          ];
          this.ajax
            .post(this.$store.state.api + "deleteEvaluation", params)
            .then((res) => {
              this.$message.success("删除成功");
              if (this.page != 1 && this.tableData.length == 1) {
                this.page--;
              }
              this.getData();
            })
            .catch((err) => {
              this.$message.success("添加失败");
              console.error(err);
            });
        })
        .catch(() => {});
    },
    init() {
      this.eJson = {};
      this.fid = "";
      this.sid = "";
      this.tid = "";
      this.eTitle = "";
    },
    addED() {
      this.update = false;
      this.init();
      this.setMindData();
      this.typeMode = 1;
      this.dialogVisible = true;
    },
    checkE(res) {
      this.init();
      this.eJson = JSON.parse(res.content);
      this.eTitle = res.title;
      this.eid = res.id;
      this.update = true;
      this.typeMode = 1;
      this.dialogVisible = true;
      this.$forceUpdate();
      setTimeout(() => {
        this.setMindData();
      }, 0);
    },
    setMindData() {
      this.data.data = [];
      this.data.data.push({ id: "root", isroot: true, topic: this.eTitle });
      let _eJson = Object.keys(this.eJson);
      let _e = this.eJson;
      for (let i = 0; i < _eJson.length; i++) {
        let element = _e[_eJson[i]];
        this.data.data.push({
          id: element.id,
          parentid: "root",
          topic: element.name,
        });
        let _eJsonc = Object.keys(element.child);
        let _e2 = element.child;
        for (let j = 0; j < _eJsonc.length; j++) {
          let _ec = _e2[_eJsonc[j]];
          this.data.data.push({
            id: _ec.id,
            parentid: element.id,
            topic: _ec.name,
          });
          let _eJsonz = Object.keys(_ec.child);
          let _e3 = _ec.child;
          for (let z = 0; z < _eJsonz.length; z++) {
            let _ez = _e3[_eJsonz[z]];
            this.data.data.push({
              id: _ez.id,
              parentid: _ec.id,
              topic: _ez.name,
            });
          }
        }
      }
      this.$forceUpdate();
    },
  },
  created() {
    this.getData();
  },
};
</script>

<style scoped>
.dialog_diy >>> .el-dialog__header {
  padding: 9px 20px 10px;
  background: #32455b !important;
}
.dialog_diy >>> .el-dialog__title {
  color: #fff;
  font-size: 15px;
}
.dialog_diy >>> .el-dialog__headerbtn {
  top: 14px;
}
.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
  color: #fff;
}
.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
  color: #fff;
}
.dialog_diy >>> .el-dialog__body {
  padding: 15px 20px 0;
}
.dialog_diy >>> .el-dialog__body,
.dialog_diy >>> .el-dialog__footer {
  background: #e6eaf0;
}

.tips_diy >>> .el-dialog__body,
.tips_diy >>> .el-dialog__footer {
  background: #fff;
}

.mubiao_diy >>> .el-dialog {
  max-width: 1200px;
}

.pb_head > span:nth-child(2) {
  font-size: 16px;
  margin-left: 80px;
  color: #ab582f;
}
.pb_head {
  margin: 0 !important;
  width: 100% !important;
}
.student_head {
  margin-top: 10px;
  padding-bottom: 15px;
  display: flex;
  justify-content: flex-end;
}
.student_search {
  display: flex;
}
.student_search > div:nth-child(1) {
  line-height: 35px;
  font-size: 14px;
  min-width: 60px;
}
.student_search >>> .el-input__inner {
  width: 190px;
  /* height: 35px; */
  margin-right: 10px;
}
.student_search .btn {
  background: rgb(34, 104, 189);
  border: none;
}
.student_button {
  display: flex;
  overflow: hidden;
  height: 40px;
}
.top {
  display: flex;
  justify-content: space-between;
}
.bgColor {
  background: #466b99;
  border: none;
}
.e_box {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  min-height: 502px;
}
.e_card {
  background: #fff;
  margin-right: 20px;
  width: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 5px;
  margin-top: 10px;
  text-align: center;
}
.e_card_picture {
  margin: 20px 0;
}
.e_card_name {
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.e_card_time {
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  font-size: 15px;
  color: #c3c3c3;
  margin-bottom: 10px;
}
.e_card_btn {
  height: 40px;
  display: flex;
  align-items: center;
  width: 100%;
  background: rgb(244, 244, 244);
}
.e_card_btn span {
  flex: 1 1 auto;
  text-align: center;
  cursor: pointer;
}
.student_page {
  margin-top: 10px;
}

.e_add_top {
  display: flex;
  justify-content: space-between;
  padding: 20px 20px;
  border-radius: 3px;
  background: #fff;
}
.e_add_title2 {
  display: flex;
  align-items: center;
}

.e_add_title2 span {
  width: 40px;
}

.e_add_title {
  display: flex;
  align-items: center;
}
.e_add_title span {
  width: 135px;
}
.e_add_title .el_input {
  width: 300px;
}
.e_add_title >>> .el-input__inner {
  width: 400px;
}

.e_add_btn {
}
.e_add_content {
  display: flex;
  width: 100%;
  overflow: auto;
  height: 530px;
}
.e_add_list {
  background: #fff;
  height: 500px;
  width: 210px;
  position: relative;
  margin: 15px 10px 0 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.e_add_list_title {
  font-size: 20px;
  width: 100%;
  box-sizing: border-box;
  padding: 15px 40px;
  text-align: center;
  border-bottom: 1px solid #eaeaea;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 57px;
  background: #f6f6f6;
}
.e_add_list_title span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.e_add_list_title img {
  position: absolute;
  right: 15px;
  width: 25px;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
}
.e_add_list_body {
  height: calc(100% - 187px);
  overflow: auto;
}
.e_add_list_child {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  padding: 15px 62px 15px 30px;
  text-align: center;
}
.e_add_list_child span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.e_add_list_child img {
  position: absolute;
  right: 10px;
  width: 21px;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
}
.e_add_list_child + .e_add_list_child {
  border-top: 1px solid #eaeaea;
}
.e_add_list_child .active {
  color: #409eff;
}
.e_add_list_btn {
  position: absolute;
  bottom: 0;
  height: 50px;
  background: rgb(120, 120, 254);
  width: 100%;
  color: #fff;
  font-size: 16px;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
}
.e_add_list_detail {
  position: absolute;
  bottom: 0;
  height: 130px;
  background: rgb(120, 120, 254);
  width: 100%;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.e_add_list_detail textarea {
  height: 90%;
  width: 95%;
  border: none;
  resize: none;
  outline: none;
  padding: 5px;
  box-sizing: border-box;
}

.e_add_list_pbox {
  margin: 15px 0 0 0;
  width: 500px;
  min-width: 500px;
  height: 500px;
}
.e_add_list_pbox_title {
  height: 50px;
  background: #fff;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px;
}

.type_title {
  font-size: 18px;
  font-weight: 700;
}
.type_content {
  font-size: 16px;
  margin-left: 30px;
}
.type_content span + span {
  margin-left: 20px;
}
.type_content span {
  cursor: pointer;
  padding-bottom: 5px;
  box-sizing: border-box;
}

.type_content .active {
  color: #409eff;
  border-bottom: 2px solid #409eff;
}

.e_add_list_pbox_content {
  height: calc(100% - 50px);
  display: flex;
  align-items: center;
  width: 100%;
  background: #fff;
}
</style>