<!--
 * @Author: your name
 * @Date: 2021-11-29 09:27:43
 * @LastEditTime: 2022-03-02 17:01:27
 * @LastEditors: Please set LastEditors
 * @Description: 权限管理
 * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\home.vue
-->
<template>
  <div class="authority-home">
    <!--状态和搜索-->
    <div class="authority-head flex">
      <div class="status flex-wrap">
        <div class="manageTitle">权限项管理</div>
        <div class="status0"><span class="icon"></span>交互权限</div>
        <div class="status1"><span class="icon"></span>API接口</div>
        <div class="status2"><span class="icon"></span>数据读写</div>
      </div>
      <Search @getSearchData="getSearchData" :isTitle="false" @clearSearchData="clearSearchData" />
    </div>
    <!--权限树-->
    <!-- <div class="authority-content">
      <OrgTree :dataList="dataList" :renderContent="renderContent" />
    </div> -->
    <div class="authority-content">
      <!-- <OrgTree :dataList="dataList" :renderContent="renderContent" /> -->
      <el-row :gutter="24" class="bodyContent">
        <el-col :span="6" class="bodyPart">
          <div class="grid-content">
            <div class="manageTitle">权限树</div>
            <div class="contentTree">
              <el-tree ref="tree" :data="dataListTree" :props="defaultProps" node-key="AuthId" :filter-node-method="filterNode" highlight-current :default-expanded-keys="[currentKey]" @node-click="handleNodeClick">
              </el-tree>
            </div>
          </div>
        </el-col>
        <el-col :span="18" class="bodyPart">
          <!-- <div class="grid-contentTop">
            <div class="manageTitle">当前</div>
            <div class="content">
              <template v-if="currDataArr.length">
                <el-row>
                  <el-col :span="6" v-for="(data, index) in currDataArr" :key="data.AuthId">
                    <div class="account-left-content-teams">
                      <div class="team">
                        <div class="bg" :class="
                            data.Type == 1 || data.Type == 0
                              ? 'status1'
                              : 'status2'
                          "></div>
                        <div class="list" :class="data.QueryTarget == 1 ? 'activeStatus' : ''">
                          <div class="flex info">
                            <div :title="data.AuthName" class="name">
                              {{ data.AuthName }}
                            </div>
                            <div class="icon">
                              <el-tooltip effect="dark" content="新增应用" placement="bottom">
                                <span v-if="data.Type === 0" title="新增应用" @click="renderAdd()" class="cap cap-plus"></span>
                              </el-tooltip>
                              <el-tooltip effect="dark" content="修改应用" placement="bottom">
                                <span v-if="data.Type === 1" title="修改应用" @click="renderEdit(data)" class="cap cap-edit"></span>
                              </el-tooltip>
                              <el-tooltip v-is="['authtree_btn_add_auth']" effect="dark" content="新增权限项" placement="bottom">
                                <span v-if="data.Type === 2" title="新增权限项" @click="renderSub(data)" class="cap cap-sub"></span>
                              </el-tooltip>
                              <el-tooltip v-is="['authtree_btn_update_auth']" effect="dark" content="编辑权限项" placement="bottom">
                                <span v-if="data.Type > 2" title="编辑权限项" @click="renderEdit(data)" class="cap cap-edit"></span>
                              </el-tooltip>
                              <el-tooltip v-is="['authtree_btn_add_auth']" effect="dark" content="新增权限项" placement="bottom">
                                <span v-if="data.Type > 2" title="新增权限项" @click="renderSub(data)" class="cap cap-sub"></span>
                              </el-tooltip>
                            </div>
                          </div>
                          <div v-if="data.Type > 0" class="flex details">
                            <div class="details-msg">
                              状态：<span :class="data.Status === 1 ? 'success' : 'error'">{{ data.Status === 1 ? "启用" : "禁用" }}</span>
                            </div>
                            <div v-is="['authtree_btn_state_swatch']" class="details-info">
                              <el-switch v-model="data.flag" @change="renderChange(data, index)" active-color="#2D67E3">
                              </el-switch>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div v-is="['authtree_btn_del_auth']">
                        <div v-if="data.Type !== 0 && data.Type !== 2" @click.stop="onNodeClick(data)" class="info-close">
                          <i class="icon el-icon-close" :class="
                              data.Type === 1
                                ? 'close1'
                                : data.Type > 2
                                ? 'close2'
                                : ''
                            "></i>
                        </div>
                      </div>
                    </div>
                  </el-col>
                </el-row>
              </template>
              <template v-else>
                <NoData :imageWidth="180" :imageHeight="130" />
              </template>
            </div>
          </div> -->
          <div class="grid-contentBottom">
            <div class="capTitle flex">
              <div class="manageTitle">下级权限</div>
              <div class="btn-create">
                <el-button size="small" type="primary" @click="addAuth" class="btn-white">新增</el-button>
              </div>
            </div>
            <div class="content">
              <template v-if="childrenData.length">
                <el-row :gutter="24">
                  <el-col :span="6" v-for="(data, index) in childrenData" :key="data.AuthId">
                    <div @click.stop="childrenClick(data)" class="account-left-content-teams">
                      <div class="team">
                        <div class="bg" :class="data.Type == 1 ? 'status0' : data.Type == 2 ? 'status1' : 'status2'"></div>
                        <div class="list" :class="data.QueryTarget == 1 ? 'activeStatus' : ''">
                          <div class="flex info">
                            <div :title="data.AuthName" class="name">
                              {{ data.AuthName }}
                            </div>
                            <div class="icon">
                              <el-tooltip effect="dark" content="新增应用" placement="bottom">
                                <span v-if="data.Type === 0" title="新增应用" @click="renderAdd()" class="cap cap-plus"></span>
                              </el-tooltip>
                              <el-tooltip effect="dark" content="修改应用" placement="bottom">
                                <span v-if="data.Type === 1" title="修改应用" @click="renderEdit(data)" class="cap cap-edit"></span>
                              </el-tooltip>
                              <!-- <el-tooltip v-is="['authtree_btn_add_auth']" effect="dark" content="新增权限项" placement="bottom">
                                <span v-if="data.Type === 2" title="新增权限项" @click="renderSub(data)" class="cap cap-sub"></span>
                              </el-tooltip> -->
                              <el-tooltip v-is="['authtree_btn_add_auth']" effect="dark" content="编辑权限项" placement="bottom">
                                <span v-if="data.Type === 2" title="编辑权限项" @click="renderEdit(data)" class="cap cap-edit"></span>
                              </el-tooltip>
                              <el-tooltip v-is="['authtree_btn_update_auth']" effect="dark" content="编辑权限项" placement="bottom">
                                <span v-if="data.Type > 2" title="编辑权限项" @click="renderEdit(data)" class="cap cap-edit"></span>
                              </el-tooltip>
                              <!-- <el-tooltip v-is="['authtree_btn_add_auth']" effect="dark" content="新增权限项" placement="bottom">
                                <span v-if="data.Type > 2" title="新增权限项" @click="renderSub(data)" class="cap cap-sub"></span>
                              </el-tooltip> -->
                            </div>
                          </div>
                          <div v-if="data.Type > 0" class="flex details">
                            <div class="details-msg">
                              状态：<span :class="data.Status === 1 ? 'success' : 'error'">{{ data.Status === 1 ? "启用" : "禁用" }}</span>
                            </div>
                            <div v-is="['authtree_btn_state_swatch']" class="details-info">
                              <el-switch v-model="data.flag" @click.stop.native @change="renderChange(data, index)" active-color="#2D67E3">
                              </el-switch>
                            </div>
                          </div>
                        </div>
                      </div>
                      <!-- <div v-if="data.Type !== 0 && data.Type !== 2" @click.stop="onNodeClick(data)" class="info-close">
                        <i class="icon el-icon-close" :class="data.Type === 1 ? 'close1' : data.Type > 2 ? 'close2' : ''"></i>
                      </div> -->
                      <div v-is="['authtree_btn_del_auth']">
                        <div v-if="data.Type !== 0 && data.Type !== 2" @click.stop="onNodeClick(data)" class="info-close">
                          <i class="icon el-icon-close" :class="
                              data.Type === 1
                                ? 'close1'
                                : data.Type > 2
                                ? 'close2'
                                : ''
                            "></i>
                        </div>
                      </div>
                    </div>
                  </el-col>
                </el-row>
              </template>
              <template v-else>
                <NoData :imageWidth="280" :imageHeight="230" />
              </template>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
    <!--删除弹框-->
    <Dialog :flag="flag">
      <div class="airportInfoDialog">
        <div class="title del-title">删除{{ title }}</div>
        <div class="content del-content">
          <span class="el-icon-error error r10"></span>是否确认删除<span class="error l10">{{ title }}</span>？
        </div>
        <div class="foot Delfoot right t30">
          <el-button size="medium" class="r24" @click="remove" type="danger">删除</el-button>
          <el-button size="medium" @click="flag = false">取消</el-button>
        </div>
      </div>
    </Dialog>
    <!--新增/编辑-->
    <Dialog :flag="editDialogVisible" width="628px" :show-flag="true">
      <div class="airportInfoDialog dialog-public-background">
        <div class="title">{{ editDialogTitle }}</div>
        <div class="content">
          <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="110px" class="demo-ruleForm">
            <el-form-item label="权限名称" prop="authName">
              <el-input v-model="ruleForm.authName" size="medium" placeholder="请输入权限名称" />
            </el-form-item>
            <div class="flex">
              <el-form-item label="权限类型" prop="authType">
                <el-select size="medium" v-model="ruleForm.authType" placeholder="请选择">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="父级权限" prop="authParent">
                <el-select size="medium" v-model="ruleForm.authParent" placeholder="请选择">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="flex">
              <el-form-item label="数据来源类型" prop="authData">
                <el-select size="medium" v-model="ruleForm.authData" placeholder="请选择">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="所属应用" prop="authApp">
                <el-select size="medium" v-model="ruleForm.authApp" placeholder="请选择">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
            </div>
            <el-form-item label="权限标识符" prop="authPoint">
              <el-input v-model="ruleForm.authPoint" size="medium" type="textarea" :rows="3" placeholder="请输入权限标识符" />
            </el-form-item>
            <el-form-item label="数据项描述" prop="authDesc">
              <el-input v-model="ruleForm.authDesc" size="medium" type="textarea" :rows="3" placeholder="请输入数据项描述" />
            </el-form-item>
          </el-form>
        </div>
        <div class="foot center t30">
          <el-button size="medium" type="primary" class="r25 r26" @click="submitClickHandler()">提交</el-button>
          <el-button size="medium" class="r26" @click="resetForm('ruleForm')">取消</el-button>
        </div>
      </div>
    </Dialog>
  </div>
</template>

<script>
import OrgTree from "@/layout/components/OrgTree";
import Search from "@/layout/components/Search";
import Dialog from "@/layout/components/Dialog";
import NoData from "@/components/nodata";
import {
  UpdateAppStatus,
  UpdateAuthStatus,
  DeleteApp,
  DeleteAuth,
} from "@/api/apiAuthority";
import treeData from "../minixs/treeData";
export default {
  name: "Authority",
  components: { OrgTree, Search, Dialog, NoData },
  mixins: [treeData],
  data () {
    return {
      dataIndex: 1,
      dataNum: 0,
      dataArr: [],
      type: null,
      title: "", //弹框title
      flag: false, //弹框开关
      dataId: null, //tree数据id
      currDataArr: [],
      currDataArrId: 0,
      childrenData: [],
      dataListTree: [],
      currentKey: -1,
      defaultProps: {
        children: "children",
        label: "AuthName",
      },
      options: [],
      editDialogVisible: false,
      editDialogTitle: '新增下级权限',
      editType: 'add',
      ruleForm: {
        // 协议信息表单
        authName: "",
        authType: "",
        authDesc: "",
        authPoint: "",
        authApp: "",
        authParent: "",
        authData: ""
      },
      rules: {
        // 协议信息表单验证
        authName: [
          { required: true, message: "请输入权限名称", trigger: "blur" },
        ],
      },
    };
  },
  created: function () {
    let keyWords = "";
    if (this.$route.query.keyWords) {
      keyWords = this.$route.query.keyWords;
    }
    this.getAuthTree(keyWords);
  },
  watch: {
    dataList: {
      handler (val) {
        this.dataListTree = [];
        this.dataListTree.push(_.cloneDeep(val));
      },
      deep: true,
    },
  },
  methods: {
    // 新增
    addAuth () {
      this.editDialogTitle = '新增下级权限'
      this.editDialogVisible = true
      this.editType = 'add'
    },
    // 重置
    resetForm (formName) {
      this.$refs[formName].resetFields()
      this.editDialogVisible = false
    },
    // 新增/编辑-确认
    submitClickHandler () {
      this.$refs["ruleForm"].validate((valid) => {
        if (valid) {
          if (this.editType == 'add') {
            console.log('新增')
          } else {
            console.log('编辑')
          }
        } else {
          return false
        }
      });
    },
    //树点击
    handleNodeClick (data) {
      const dataNew = _.cloneDeep(data);
      this.currDataArrId = dataNew.AuthId;
      this.currDataArr = [];
      this.childrenData = [];
      this.currDataArr = this.decompose(this.dataArr, "AuthId", dataNew.AuthId);
      this.childrenData = this.decompose(
        this.dataArr,
        "UpAuthId",
        dataNew.AuthId
      );
    },
    //下级卡片点击
    childrenClick (data) {
      const dataNew = _.cloneDeep(data);
      this.currDataArrId = dataNew.AuthId;
      this.currDataArr = [];
      this.childrenData = [];
      this.currDataArr = this.decompose(this.dataArr, "AuthId", dataNew.AuthId);
      this.childrenData = this.decompose(
        this.dataArr,
        "UpAuthId",
        dataNew.AuthId
      );
      this.$refs.tree.setCurrentKey(dataNew.AuthId);
      this.currentKey = dataNew.AuthId;
    },
    //下级关闭
    childrenRenderChange (data, index) {
      try {
        const { OrganId, flag } = data;
        const Status = flag ? 1 : 0;
        tissueTreeStart({
          OrganId: OrganId,
          Status: Status,
        }).then((res) => {
          if (res.code === 0) {
            this.$message.success(res.message);
            this.childrenData[index].Status = Status;
            // this.getOrganTree();
          } else {
            this.$message.error(res.message);
            this.childrenData[index].flag = !flag;
          }
        });
      } catch (error) {
        console.log("出错了", error);
        this.childrenData[index].flag = !flag;
      }
    },
    filterNode (value, data) {
      if (!value) return true;
      return data.AuthName.indexOf(value) !== -1;
    },
    // 添加应用
    renderAdd () {
      this.$router.push("/authority/appAdd");
    },
    // 修改权限
    renderEdit (data) {
      this.editDialogVisible = true;
      this.editDialogTitle = '编辑下级权限';
      this.editType = 'edit';
      // if (data.Type === 1) {
      //   this.$router.push({
      //     path: "/authority/appEdit",
      //     query: {
      //       AuthId: data.AuthId,
      //       Status: data.Status,
      //       UpAuthId: data.UpAuthId,
      //     },
      //   });
      // } else if (data.Type > 2) {
      //   this.$router.push({
      //     path: "/authority/editPower",
      //     query: {
      //       AuthId: data.AuthId,
      //       Status: data.Status,
      //       UpAuthId: data.UpAuthId,
      //     },
      //   });
      // }
    },
    // 权限树
    renderSub (data) {
      this.$router.push({
        path: "/authority/addPower",
        query: {
          AuthId: data.AuthId,
          Status: data.Status,
          UpAuthId: data.UpAuthId,
        },
      });
    },
    // 关闭开启
    renderChange (data, index) {
      const { AuthId, flag, Type } = data;
      const Status = flag ? 1 : 0;
      this.handleChange(AuthId, Status, Type, index);
    },
    //删除
    remove () {
      if (this.type === 1) {
        this.deleteApp(this.dataId);
      } else {
        this.deleteAuth(this.dataId);
      }
    },
    //查询
    getSearchData (val) {
      this.$refs.tree.filter(val);
      // this.getAuthTree(val)
    },
    //清除查询
    clearSearchData () {
      this.getAuthTree();
    },
    //节点关闭按钮点击
    onNodeClick (data) {
      this.flag = true;
      this.dataId = data.AuthId;
      this.title = data.AuthName;
      this.type = data.Type;
    },
    //获取指定数据
    decompose (value, key, id) {
      let data = _.cloneDeep(value);
      let arr = [];
      for (let i = 0; i < data.length; i++) {
        if (data[i][key] == id) {
          arr.push(data[i]);
        }
      }
      return arr;
    },
    //渲染节点
    renderContent (h, data) {
      return (
        <div class="account-left-content-teams">
          <div class="team">
            <div class={[data.Type <= 1 ? "status1" : "status2", "bg"]}></div>
            <div class={[data.QueryTarget == 1 ? "activeStatus" : "", "list"]}>
              <div class="flex info">
                <div class="name">{data.AuthName}</div>
                <div class="icon">
                  <span
                    v-show={data.Type === 0}
                    onClick={() => this.renderAdd()}
                    class="cap cap-plus"
                  ></span>
                  <span
                    v-show={data.Type === 1}
                    onClick={() => this.renderEdit(data)}
                    class="cap cap-edit"
                  ></span>
                  <span
                    v-show={data.Type === 2}
                    onClick={() => this.renderSub(data)}
                    class="cap cap-sub"
                  ></span>
                  <span
                    v-show={data.Type > 2}
                    onClick={() => this.renderEdit(data)}
                    class="cap cap-edit"
                  ></span>
                  <span
                    v-show={data.Type > 2}
                    onClick={() => this.renderSub(data)}
                    class="cap cap-sub"
                  ></span>
                </div>
              </div>
              <div v-show={data.Type > 0} class="flex details">
                <div class="details-msg">
                  状态：
                  <span class={[data.Status === 1 ? "success" : "error"]}>
                    {data.Status === 1 ? "启用" : "禁用"}
                  </span>
                </div>
                <div class="details-info">
                  <el-switch
                    v-model={data.flag}
                    onChange={() => this.renderChange(data)}
                    active-color="#6F81BC"
                  ></el-switch>
                </div>
              </div>
            </div>
          </div>
          <div
            v-show={data.Type !== 0 && data.Type !== 2}
            onClick={() => this.onNodeClick(data)}
            class="info-close"
          >
            <i
              class={[
                data.Type === 1 ? "close1" : data.Type > 2 ? "close2" : "",
                "icon",
                "el-icon-close",
              ]}
            ></i>
          </div>
        </div>
      );
    },
    //-----------获取数据------------
    //应用状态变更
    async handleChange (id, val, type, index) {
      try {
        let res = null;
        if (type === 1) {
          res = await UpdateAppStatus({
            AppId: id,
            Status: val,
          });
        } else {
          res = await UpdateAuthStatus({
            AuthId: id,
            AuthStatus: val,
          });
        }
        if (res.code === 0) {
          this.$message.success(res.message);
          if (type === 1) {
            this.currDataArr[0].Status = val;
          } else {
            this.childrenData[index].Status = val;
          }
          //this.getAuthTree()
        } else {
          this.$message.error(res.message);
          if (type === 1) {
            this.currDataArr[0].flag = !flag;
          } else {
            this.childrenData[index].flag = !flag;
          }
        }
      } catch (error) {
        console.log("出错了", error);
        if (type === 1) {
          this.currDataArr[0].flag = !flag;
        } else {
          this.childrenData[index].flag = !flag;
        }
      }
    },
    //应用删除
    async deleteApp (id) {
      try {
        const res = await DeleteApp({
          AppId: id,
        });
        if (res.code === 0) {
          this.$message.success(res.message);
          this.flag = false;
          this.getAuthTree();
        } else {
          this.flag = false;
          this.$message.error(res.message);
        }
      } catch (error) {
        this.flag = false;
      }
    },
    //权限项删除
    async deleteAuth (id) {
      try {
        const res = await DeleteAuth({
          AuthId: id,
        });
        if (res.code === 0) {
          this.$message.success(res.message);
          this.flag = false;
          this.getAuthTree();
        } else {
          this.flag = false;
          this.$message.error(res.message);
        }
      } catch (error) {
        this.flag = false;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.authority-home {
  padding: 16px 32px 32px 32px;
  .authority-head {
    line-height: 32px;
    font-size: 14px;
    .status {
      .icon {
        width: 14px;
        height: 14px;
        background: #58c274;
        border-radius: 2px;
        display: inline-block;
        vertical-align: middle;
        margin-right: 10px;
        position: relative;
        top: -2px;
      }
      &:last-child {
        margin-right: 0;
      }

      .status2 {
        margin-left: 28px;
        .icon {
          background: #2d67e3;
        }
      }
      .status0 {
        margin-right: 28px;
        .icon {
          background: #d8b53b;
        }
      }
    }
  }
  .authority-content {
    // margin-top: 34px;
    ::v-deep .orgTreeContent {
      padding-top: 110px;
      .account-left-content-teams {
        .status0 {
          background: #d8b53b;
        }
        .status1 {
          background: #58c274;
        }
        .status2 {
          background: #2d67e3;
        }
        .activeStatus {
          background: #464960;
          .name,
          .details-msg,
          .success,
          .error {
            color: #fff;
          }
        }
        .list {
          .info {
            .name {
              max-width: 100px;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            }
          }
        }
      }
    }
  }
  .authority-content {
    padding-top: 30px;
    height: calc(100vh - 166px);
    box-sizing: border-box;
    .bodyContent {
      height: 100%;
      .bodyPart {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
      }
    }
    .capTitle {
      line-height: 32px;
    }
    .account-left-content-teams {
      position: relative;
      margin-top: 24px;
      .info-close {
        position: absolute;
        width: 24px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        background: #000000;
        border-radius: 50%;
        top: -12px;
        right: -12px;
        z-index: 5;
        cursor: pointer;
        .icon {
          color: #fff;
          font-weight: 600;
        }
      }
      .list {
        background-color: #f5f7fa;
        .info {
          line-height: normal;
          margin-bottom: 37px;
          .name {
            font-size: 16px;
            font-weight: bold;
            max-width: 120px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
          .cap {
            width: 16px;
            height: 16px;
            display: inline-block;
            background-repeat: no-repeat;
            background-size: 100%;
            transition: all 0.3s;
            margin-left: 16px;
            &:first-child {
              margin-right: 0;
            }
          }
          .cap-plus {
            background-image: url("../../../assets/status/ic_plus.png");
            &:hover {
              background-image: url("../../../assets/status/ic_plus_hovar.png");
            }
          }
          .cap-edit {
            background-image: url("../../../assets/status/ic_edit_default.png");
            &:hover {
              background-image: url("../../../assets/status/ic_edit_hovar.png");
            }
          }
          .cap-sub {
            background-image: url("../../../assets/status/ic_permissions_add_default.png");
            &:hover {
              background-image: url("../../../assets/status/ic_permissions_add_hoavr.png");
            }
          }
          .cap-job {
            background-image: url("../../../assets/status/ic_jobs.png");
            &:hover {
              background-image: url("../../../assets/status/ic_jobs_hovar.png");
            }
          }
          .cap-member {
            background-image: url("../../../assets/status/ic_member.png");
            &:hover {
              background-image: url("../../../assets/status/ic_member_hovar.png");
            }
          }
        }
      }
      .team {
        background: #fff;
        border-radius: 4px;
        box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        .bg {
          height: 4px;
          background: #6f81bc;
        }
        .status0 {
          background: #d8b53b;
        }
        .status1 {
          background: #58c274;
        }
        .status2 {
          background: #2d67e3;
        }
      }
      .list {
        padding: 23px 24px;
        position: relative;
        min-width: 240px;
        min-height: 118px;
        .info {
          margin-bottom: 20px;
          .info-avoutr {
            display: flex;
            .avoutr {
              width: 40px;
              height: 40px;
              border-radius: 50%;
              background: #303133;
              img {
                max-width: 100%;
              }
            }
            .msg {
              margin-left: 20px;
              p {
                margin: 0;
                padding: 0;
                height: 20px;
                line-height: 20px;
              }
              .name {
                font-weight: bold;
                color: #303133;
                font-size: 18px;
                margin-bottom: 8px;
              }
              .group {
                font-size: 14px;
                font-family: Microsoft YaHei;
                font-weight: 400;
                color: #303133;
              }
            }
          }
          .icon {
            font-size: 16px;
            cursor: pointer;
          }
        }
        .time,
        .ip {
          height: 16px;
          line-height: 16px;
          font-size: 16px;
          .glr {
            color: #909399;
          }
        }
        .ip {
          margin-top: 23px;
          margin-bottom: 38px;
        }
        .details {
          height: 24px;
          line-height: 24px;
          font-size: 14px;
          .success {
            color: #2d67e3;
          }
          .error {
            color: #909399;
          }
        }
      }
    }
    .grid-content {
      width: 100%;
      height: 100%;
      background: #ffffff;
      padding: 27px 24px;
      border-radius: 4px;
      // .title {
      //   font-size: 18px;
      //   font-family: Microsoft YaHei;
      //   font-weight: bold;
      //   color: #303133;
      //   height: 40px;
      //   padding: 30px;
      // }
      ::v-deep .contentTree {
        margin-top: 30px;
        height: calc(100% - 60px);
        overflow: auto;
        .el-tree-node.is-expanded > .el-tree-node__children {
          display: block;
        }
      }
    }
    .grid-contentTop {
      width: 100%;
      height: 240px;
      background: #ffffff;
      border-radius: 4px;
      padding: 27px 24px;
      .title {
        font-size: 18px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        color: #303133;
        height: 40px;
        padding: 30px;
      }
      .content {
        width: 100%;
        height: calc(100% - 60px);
        padding: 0 20px;
        margin-left: 0;
      }
    }

    .grid-contentBottom {
      width: 100%;
      height: 100%;
      background: #ffffff;
      border-radius: 4px;
      padding: 27px 24px;
      .title {
        font-size: 18px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        color: #303133;
        height: 40px;
        padding: 30px;
      }
      .content {
        width: 100%;
        height: calc(100% - 20px);
        padding: 0 20px;
        overflow-y: auto;
        margin-left: 0;
      }
    }
  }
}
::-webkit-scrollbar-track-piece {
  background: #d3dce6;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: #99a9bf;
  border-radius: 2px;
}
</style>
