<template>
  <div class="content-box">
    <div class="treeV">
      <el-input
        v-model="searchInput.keyWord"
        :clearable="true"
        @clear="searchBtn"
        placeholder="请输入姓名或者学号"
        class="searchTree"
      >
        <template #prefix>
          <el-icon class="el-input__icon"><search /></el-icon>
        </template>
      </el-input>
      <el-tree
        :data="dataSource"
        node-key="id"
        default-expand-all
        :expand-on-click-node="false"
      >
        <template #default="{ node, data }">
          <span class="custom-tree-node">
            <div class="title">
              <img src="@/assets/images/folder.png" alt="" />
              <!-- <img src="@/assets/images/document.png" alt="" /> -->

              <span>{{ node.label }}</span>
            </div>
            <el-dropdown
              @command="handleCommand"
              :hide-on-click="false"
              trigger="click"
            >
              <span class="el-dropdown-link">
                <img src="@/assets/images/edit.png" alt="" />
              </span>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item
                    command="a"
                    @click="amendBMClick(node, data)"
                    >修改部门</el-dropdown-item
                  >
                  <el-dropdown-item command="b" @click="addBMClick(node, data)"
                    >新建子部门</el-dropdown-item
                  >
                  <el-dropdown-item command="c">删除</el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
          </span>
        </template>
      </el-tree>
    </div>
    <!-- 主页面 -->
    <div class="userRight" v-if="homeShow">
      <div class="left">
        <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
        <span>用户管理 </span>
        <span>/ 共有56622人</span>
      </div>
      <div>
        <div class="middle">
          <div class="filter">
            <div class="condition">
              <el-input
                v-model="searchInput.keyWord"
                :clearable="true"
                @clear="searchBtn"
                placeholder="请输入姓名或者学号"
                style="width: 240px"
              >
                <template #prefix>
                  <el-icon class="el-input__icon"><search /></el-icon>
                </template>
              </el-input>
            </div>
            <el-button
              color="rgba(0, 97, 255, 1)"
              type="primary"
              class="search"
              @click="searchBtn"
            >
              <span>查询</span></el-button
            >
          </div>
          <!-- 按钮列表 -->
          <div class="gongneng">
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="addMemberClick"
              plain
              >添加成员</el-button
            >
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="moveMemberClick"
              plain
              >移动成员</el-button
            >

            <el-dropdown>
              <el-button color="rgba(0, 97, 255, 1)" @click="addClick" plain
                >批量操作</el-button
              >
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item @click="addBatchClick"
                    >批量导入</el-dropdown-item
                  >
                  <el-dropdown-item @click="delBatchClick"
                    >批量删除</el-dropdown-item
                  >
                </el-dropdown-menu>
              </template>
            </el-dropdown>
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="closeAccountClick"
              plain
              >注销账号</el-button
            >
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="delDelClick"
              plain
              >勾选删除</el-button
            >
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="addClick"
              plain
              >导出用户</el-button
            >
          </div>
        </div>
        <div class="footer" v-loading="loading">
          <el-table
            :row-class-name="tableRowClassName"
            :data="tableData.list"
            @selection-change="handleSelectionChange"
            style="width: 100%"
            :header-cell-style="{
              background: 'rgba(240, 243, 247, 1)',
              height: '50px',
              border: 0,
            }"
          >
            <el-table-column align="center" type="selection" width="80" />
            <el-table-column align="center" prop="userName" label="姓名" />
            <el-table-column align="center" prop="position" label="学号" />
            <el-table-column align="center" prop="img" label="人脸照片">
              <template #default="{ row }">
                <div class="img">
                  <img @click="imgClick(row)" :src="row.img" alt="" />
                </div>
              </template>
            </el-table-column>
            <el-table-column align="center" label="操作" width="200">
              <template #default="scope">
                <div class="edit">
                  <div class="look" @click="editClick(scope.row)">查看</div>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>

        <!-- 分页组件 -->
        <div class="pageSize">
          <span></span>
          <el-pagination
            background
            :current-page="currentPage"
            :page-size="pageSize"
            layout="total, prev, pager, next, jumper, slot"
            :total="total"
            @update:current-page="handleCurrentChange"
          />
        </div>
      </div>
    </div>
    <!-- 添加成员 -->
    <div class="addMember" v-if="addMemberShow">
      <div class="left">
        <img src="@/assets/images/close.png" alt="" @click="addMemberConcel" />
        <span class="add">添加成员</span>
      </div>
      <div class="content">
        <div class="form">
          <el-form
            ref="addMemberRef"
            :model="addMemberRuleForm"
            :rules="addMemberRules"
            label-width="90px"
            class="demo-ruleForm"
            :size="formSize"
            label-position="right"
            status-icon
          >
            <div class="title">
              <img src="@/assets/images/basicInfo.png" alt="" />
              <span>基本信息</span>
            </div>
            <el-form-item label="编号 :" prop="serialNumber">
              <el-input
                v-model="addMemberRuleForm.serialNumber"
                placeholder="请输入编号"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="姓名 :" prop="name">
              <el-input
                v-model="addMemberRuleForm.name"
                placeholder="请输入姓名"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="身份 :" prop="identity">
              <el-select
                v-model="addMemberRuleForm.identity"
                multiple
                placeholder="请选择身份"
                style="width: 500px"
              >
                <el-option label="教职工" value="1" />
                <el-option label="学生" value="2" />
                <el-option label="门卫" value="3" />
                <el-option label="领导" value="4" />
              </el-select>
            </el-form-item>
            <el-form-item label="身份证号 :" prop="icCard">
              <el-input
                v-model="addMemberRuleForm.icCard"
                placeholder="请输入身份证号"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="性别 :" prop="sex">
              <el-radio-group v-model="addMemberRuleForm.radio">
                <el-radio :label="1">男</el-radio>
                <el-radio :label="2">女</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="部门 :" prop="department">
              <el-select
                v-model="addMemberRuleForm.department"
                multiple
                placeholder="请选择部门"
                style="width: 500px"
              >
                <el-option label="教职工" value="1" />
                <el-option label="学生" value="2" />
                <el-option label="门卫" value="3" />
                <el-option label="领导" value="4" />
              </el-select>
            </el-form-item>
            <el-form-item label="人脸照片 :" prop="facePhoto">
              <div class="facePhoto">
                <div v-if="addMemberRuleForm.facePhoto">
                  <img :src="addMemberRuleForm.facePhoto" alt="facePhotoImg" />
                </div>
                <el-upload
                  class="avatar-uploader"
                  action="#"
                  :on-preview="handlePreview"
                  :on-remove="handleRemove"
                  :on-change="handleChange"
                  :http-request="handleUpload"
                  :before-upload="beforeAvatarUpload"
                >
                  <template #trigger>
                    <el-button :icon="Camera">上传图片</el-button>
                  </template>
                  <template #tip>
                    <div class="el-upload__tip">
                      支持扩展名：.jpg .png，五官清晰无遮挡，名字+后缀
                    </div>
                  </template>
                </el-upload>
              </div>
            </el-form-item>
            <el-form-item label="年级 :" prop="grade">
              <el-select
                v-model="addMemberRuleForm.grade"
                multiple
                placeholder="请选择年级"
                style="width: 500px"
              >
                <el-option label="七年级" value="1" />
              </el-select>
            </el-form-item>
            <el-form-item label="学院 :" prop="institute">
              <el-select
                v-model="addMemberRuleForm.institute"
                multiple
                placeholder="请选择学院"
                style="width: 500px"
              >
                <el-option label="万载三中" value="1" />
              </el-select>
            </el-form-item>
            <el-form-item label="专业 :" prop="specialty">
              <el-select
                v-model="addMemberRuleForm.specialty"
                multiple
                placeholder="请选择专业"
                style="width: 500px"
              >
                <el-option label="计算机" value="1" />
              </el-select>
            </el-form-item>
            <el-form-item label="班级 :" prop="class">
              <el-select
                v-model="addMemberRuleForm.class"
                multiple
                placeholder="请选择班级"
                style="width: 500px"
              >
                <el-option label="(1)班" value="1" />
              </el-select>
            </el-form-item>
            <el-form-item label="校区 :" prop="school">
              <el-select
                v-model="addMemberRuleForm.school"
                multiple
                placeholder="请选择校区"
                style="width: 500px"
              >
                <el-option label="靖安校区" value="1" />
              </el-select>
            </el-form-item>
            <el-form-item label="宿舍号 :" prop="dormitory">
              <el-input
                v-model="addMemberRuleForm.dormitory"
                placeholder="请输入宿舍号"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="手机号 :" prop="phone">
              <el-input
                v-model="addMemberRuleForm.phone"
                placeholder="请输入手机号"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="联系人 :" prop="contact">
              <el-select
                v-model="addMemberRuleForm.contact"
                multiple
                placeholder="请选择联系人"
                style="width: 500px"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
            <div class="title">
              <img src="@/assets/images/basicInfo.png" alt="" />
              <span>其他信息</span>
            </div>
            <el-form-item label="职称 :" prop="jobName">
              <el-input
                v-model="addMemberRuleForm.jobName"
                placeholder="请输入职称"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="家庭地址 :" prop="houseAddress">
              <el-input
                v-model="addMemberRuleForm.houseAddress"
                placeholder="请输入家庭地址"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="民族 :" prop="nation">
              <el-input
                v-model="addMemberRuleForm.nation"
                placeholder="请输入民族"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="生源地 :" prop="originOfStudent">
              <el-input
                v-model="addMemberRuleForm.originOfStudent"
                placeholder="请输入生源地"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="毕业学院 :" prop="graduateCollege">
              <el-input
                v-model="addMemberRuleForm.graduateCollege"
                placeholder="请输入毕业学院"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item label="职务 :" prop="duty">
              <el-input
                v-model="addMemberRuleForm.duty"
                placeholder="请输入职务"
                clearable
                style="width: 500px"
              />
            </el-form-item>
            <el-form-item class="options">
              <el-button
                color="rgba(41, 109, 227, 1)"
                class="queding"
                type="primary"
                @click="confirmEdit(editRef)"
              >
                确认
              </el-button>
              <el-button @click="cancelEdit(editRef)">取消</el-button>
            </el-form-item>
          </el-form>
        </div>
      </div>
    </div>
    <!-- 批量添加 -->
    <div class="addMember" v-if="addBatchShow">
      <div class="left">
        <img src="@/assets/images/close.png" alt="" @click="addBatchConcel" />
        <span class="add">批量添加</span>
      </div>
      <div class="content">
        <div class="form">
          <el-upload
            style="width: 500px"
            class="upload-demo"
            drag
            action="#"
            multiple
            :on-preview="handlePreview2"
            :on-remove="handleRemove2"
            :on-change="handleChange2"
            :http-request="handleUpload2"
            :before-upload="beforeAvatarUpload2"
          >
            <el-icon class="el-icon--upload"><upload-filled /></el-icon>
            <div class="el-upload__text">
              <span style="font-size: 20px">点击上传或拖拽文件</span><br /><em
                >务必按照我们的标准模板填写信息</em
              >
            </div>
            <!-- <template #tip>
              <div class="el-upload__tip">
                jpg/png files with a size less than 500kb
              </div>
            </template> -->
          </el-upload>
          <div class="startImport">
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="addClick"
              plain
              >开始导入</el-button
            >
            <span class="downLoad">下载模板</span>
          </div>
          <div class="tableTitle">导入历史</div>
          <div class="footer">
            <el-table
              :row-class-name="tableRowClassName"
              :data="addBatchData.list"
              @selection-change="handleSelectionChange"
              :header-cell-style="{
                background: 'rgba(240, 243, 247, 1)',
                height: '45px',
                border: 0,
              }"
            >
              <el-table-column
                align="center "
                prop="userName"
                label="操作管理员"
              />
              <el-table-column align="center" prop="time" label="上传时间" />
              <el-table-column align="center" prop="status" label="导入状态" />
              <el-table-column
                align="center"
                prop="userPhone"
                label="导入成功"
              />
              <el-table-column
                align="center"
                prop="userPhone"
                label="导入失败"
              />
              <el-table-column align="center" label="失败列表" width="200">
                <template #default="scope">
                  <div class="edit">
                    <div class="look" @click="lookClick(scope.row)">
                      点击查看
                    </div>
                    <!-- <el-popconfirm
                      width="220"
                      confirm-button-text="确认"
                      cancel-button-text="取消"
                      :icon="InfoFilled"
                      icon-color="#f89626"
                      title="是否删除此房型?"
                      @confirm="del(scope.row)"
                      @cancel="cancelEvent"
                    >
                      <template #reference>
                        <div class="del">删除</div>
                      </template>
                    </el-popconfirm> -->
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div class="pageSize">
              <span></span>
              <el-pagination
                background
                :current-page="addBatch_currentPage"
                :page-size="addBatch_pageSize"
                layout="total, prev, pager, next, jumper, slot"
                :total="addBatch_total"
                @update:current-page="handleAddBatch"
              />
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 批量删除 -->
    <div class="addMember" v-if="delBatchShow">
      <div class="left">
        <img src="@/assets/images/close.png" alt="" @click="delBatchConcel" />
        <span class="add">批量删除</span>
      </div>
      <div class="content">
        <div class="form">
          <el-upload
            style="width: 500px"
            class="upload-demo"
            drag
            action="#"
            multiple
            :on-preview="handlePreview3"
            :on-remove="handleRemove3"
            :on-change="handleChange3"
            :http-request="handleUpload3"
            :before-upload="beforeAvatarUpload3"
          >
            <el-icon class="el-icon--upload"><upload-filled /></el-icon>
            <div class="el-upload__text">
              <span style="font-size: 20px">点击上传或拖拽文件</span><br /><em
                >务必按照我们的标准模板填写信息</em
              >
            </div>
            <!-- <template #tip>
              <div class="el-upload__tip">
                jpg/png files with a size less than 500kb
              </div>
            </template> -->
          </el-upload>
          <div class="startImport">
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="addClick"
              plain
              >开始执行批量删除</el-button
            >
            <span class="downLoad">下载模板</span>
          </div>
          <div class="tableTitle">导入历史</div>
          <div class="footer">
            <el-table
              :row-class-name="tableRowClassName"
              :data="delBatchData.list"
              @selection-change="handleSelectionChange"
              :header-cell-style="{
                background: 'rgba(240, 243, 247, 1)',
                height: '45px',
                border: 0,
              }"
            >
              <el-table-column
                align="center "
                prop="userName"
                label="操作管理员"
              />
              <el-table-column align="center" prop="time" label="上传时间" />
              <el-table-column align="center" prop="status" label="导入状态" />
              <el-table-column
                align="center"
                prop="userPhone"
                label="导入成功"
              />
              <el-table-column
                align="center"
                prop="userPhone"
                label="导入失败"
              />
              <el-table-column align="center" label="失败列表" width="200">
                <template #default="scope">
                  <div class="edit">
                    <div class="look" @click="lookClick(scope.row)">
                      点击查看
                    </div>
                    <!-- <el-popconfirm
                      width="220"
                      confirm-button-text="确认"
                      cancel-button-text="取消"
                      :icon="InfoFilled"
                      icon-color="#f89626"
                      title="是否删除此房型?"
                      @confirm="del(scope.row)"
                      @cancel="cancelEvent"
                    >
                      <template #reference>
                        <div class="del">删除</div>
                      </template>
                    </el-popconfirm> -->
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div class="pageSize">
              <span></span>
              <el-pagination
                background
                :current-page="delBatch_currentPage"
                :page-size="delBatch_pageSize"
                layout="total, prev, pager, next, jumper, slot"
                :total="delBatch_total"
                @update:current-page="handleDelBatch"
              />
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 修改部门 -->
    <el-dialog
      class="amendBMDialog"
      v-model="amendBMVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="修改部门"
      align-center
      width="500"
      :before-close="cancelAmendBM"
    >
      <el-form
        ref="amendBMRef"
        :model="amendBMRuleForm"
        :rules="amendBMRules"
        label-width="90px"
        class="demo-ruleForm"
        :size="formSize"
        label-position="left"
        status-icon
      >
        <el-form-item label="部门名称 :" prop="department">
          <el-input
            v-model="amendBMRuleForm.department"
            placeholder="请输入部门名称"
            clearable
            style="width: 340px"
          />
        </el-form-item>
        <div class="option">
          <el-button
            color="rgba(41, 109, 227, 1)"
            class="queding"
            type="primary"
            @click="confirmAmendBM(amendBMRef)"
          >
            确认
          </el-button>
          <el-button @click="cancelAmendBM(amendBMRef)">取消</el-button>
        </div>
      </el-form>
    </el-dialog>
    <!-- 新建子部门 -->
    <el-dialog
      class="amendBMDialog"
      v-model="addBMVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="新建子部门"
      align-center
      width="500"
      :before-close="cancelAddBM"
    >
      <el-form
        ref="addBMRef"
        :model="addBMRuleForm"
        :rules="addBMRules"
        label-width="90px"
        class="demo-ruleForm"
        :size="formSize"
        label-position="left"
        status-icon
      >
        <el-form-item label="部门名称 :" prop="department">
          <el-input
            v-model="addBMRuleForm.department"
            placeholder="请输入部门名称"
            clearable
            style="width: 340px"
          />
        </el-form-item>
        <div class="option">
          <el-button
            color="rgba(41, 109, 227, 1)"
            class="queding"
            type="primary"
            @click="confirmAddBM(addBMRef)"
          >
            确认
          </el-button>
          <el-button @click="cancelAddBM(addBMRef)">取消</el-button>
        </div>
      </el-form>
    </el-dialog>
    <!-- 移动成员 -->
    <el-dialog
      class="moveMemberDialog"
      v-model="moveMemberVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="移动选择用户至"
      align-center
      width="650"
      :before-close="cancelMoveMember"
    >
      <div class="move">
        <div class="moveLeft">
          <el-input
            v-model="moveSearchInput"
            :clearable="true"
            @clear="searchBtn"
            placeholder="请输入部门"
            class="searchTree"
            style="width: 260px"
          >
            <template #prefix>
              <el-icon class="el-input__icon"><search /></el-icon>
            </template>
          </el-input>
          <el-tree
            ref="moveTree"
            :data="dataSource"
            node-key="id"
            default-expand-all
            :expand-on-click-node="false"
            show-checkbox
            check-strictly
            @check-change="moveCheckChange"
          >
            <template #default="{ node, data }">
              <span class="custom-tree-node">
                <div class="title">
                  <img src="@/assets/images/folder.png" alt="" />
                  <!-- <img src="@/assets/images/document.png" alt="" /> -->
                  <span>{{ node.label }}</span>
                </div>
              </span>
            </template>
          </el-tree>
        </div>
        <div class="moveRight">
          <div class="sel">已选择 :</div>
          <ul
            class="infinite-list"
            style="overflow: auto"
            infinite-scroll-immediate="false"
          >
            <li
              v-for="(i, index) in treeSelData.list"
              :key="index"
              class="infinite-list-item"
            >
              <span style="margin-left: 19px">{{ i.label }}</span>
              <el-icon @click="cancelTreeSel(i)">
                <Close />
              </el-icon>
              <!-- <i class="el-icon-close" @click="cancelCheck(i)"></i> -->
            </li>
          </ul>
        </div>
      </div>
      <div class="options">
        <el-button
          color="rgba(41, 109, 227, 1)"
          class="queding"
          type="primary"
          @click="confirmMoveMember"
        >
          确认
        </el-button>
        <el-button @click="cancelMoveMember">取消</el-button>
      </div>
    </el-dialog>
    <!-- 注销账号 -->
    <el-dialog
      class="closeAccount"
      v-model="closeAccountVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="注销账号"
      align-center
      width="500"
      :before-close="cancelCloseAccount"
    >
      <div class="content">
        <img src="@/assets/images/warning.png" alt="" />
        <span
          >选中的用户将会被注销账号，注销后相应的功能将无法使用，确定要操作吗？</span
        >
      </div>
      <div class="option">
        <el-button
          color="rgba(41, 109, 227, 1)"
          class="queding"
          type="primary"
          @click="confirmCloseAccount"
        >
          确认
        </el-button>
        <el-button @click="cancelCloseAccount">取消</el-button>
      </div>
    </el-dialog>
    <!-- 勾选删除 -->
    <el-dialog
      class="closeAccount"
      v-model="selDelVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="勾选删除"
      align-center
      width="500"
      :before-close="cancelSelDel"
    >
      <div class="content">
        <img src="@/assets/images/warning.png" alt="" />
        <span>是否删除勾选的用户？</span>
      </div>
      <div class="option">
        <el-button
          color="rgba(41, 109, 227, 1)"
          class="queding"
          type="primary"
          @click="confirmSelDel"
        >
          确认
        </el-button>
        <el-button @click="cancelSelDel">取消</el-button>
      </div>
    </el-dialog>

    <div class="bgImg" v-if="bgImg">
      <el-carousel
        @click="bgImg = false"
        ref="bgImgs"
        indicator-position
        arrow="always"
        :autoplay="false"
        trigger
      >
        <el-carousel-item>
          <img :src="showImg" alt="" />
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script setup>
import {
  ref,
  reactive,
  watch,
  nextTick,
  onBeforeMount,
  onUnmounted,
} from "vue";
import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { Camera } from "@element-plus/icons-vue";
import { dayjs } from "element-plus";
import lodash from "lodash";
import axios from "axios";
import { useStore } from "vuex";
const store = useStore();
const api = ref("");
const router = useRouter();

// 树形结构
const dataSource = ref([
  {
    id: 1,
    label: "万载三中",
    children: [
      {
        id: 2,
        label: "教职工",
        children: [
          {
            id: 121,
            label: "院领导",
          },
          {
            id: 122,
            label: "董事会办公室",
          },
          {
            id: 123,
            label: "团委",
          },
          {
            id: 124,
            label: "科技园",
          },
        ],
      },
      {
        id: 3,
        label: "学生",
        children: [
          {
            id: 131,
            label: "设计与技术学院",
          },
          {
            id: 132,
            label: "商学院",
          },
        ],
      },
      {
        id: 4,
        label: "临时人员",
        children: [
          {
            id: 141,
            label: "维修",
          },
          {
            id: 142,
            label: "商品",
          },
        ],
      },
      {
        id: 5,
        label: "司机",
      },
      {
        id: 6,
        label: "食堂",
        children: [
          {
            id: 9,
            label: "一食堂",
          },
          {
            id: 10,
            label: "二食堂",
          },
        ],
      },
    ],
  },
]);

// 主页面数据（----------------------------------------------）
// 表格数据
const loading = ref(false);
const tableData = reactive({
  list: [
    {
      userName: "张三",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "王卿",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "李明",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "涂涂",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "小红",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "小明",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "例子",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
  ],
});
const searchInput = reactive({
  keyWord: "",
  createTime: "",
}); // 搜索按钮数据
const homeShow = ref(true);
const currentPage = ref(1); // 当前页
const pageSize = ref(10);
const total = ref(8); // 当前总数

// 修改部门 (----------------------------------------------)
const amendBMVisible = ref(false);
const amendBMRef = ref();
const amendBMRuleForm = reactive({
  department: "", // 部门
  id: "",
});
// 表单验证
const amendBMRules = reactive({
  department: [
    { required: true, message: "部门名称不能为空", trigger: "blur" },
  ],
});
// 新建子部门 (----------------------------------------------)
const addBMVisible = ref(false);
const addBMRef = ref();
const addBMRuleForm = reactive({
  department: "", // 部门
  id: "",
});
// 表单验证
const addBMRules = reactive({
  department: [
    { required: true, message: "部门名称不能为空", trigger: "blur" },
  ],
});
// 添加成员页面 (---------------------------------------------)
const addMemberShow = ref(false);
const addMemberRef = ref();
const addMemberRuleForm = reactive({
  serialNumber: "", // 编号
  name: "", // 姓名
  identity: "", // 身份
  icCard: "", // 身份证号
  sex: "", // 性别
  department: "", // 部门
  facePhoto: "", // 人脸照片
  grade: "", // 年级
  institute: "", // 学院
  specialty: "", // 专业
  class: "", // 班级
  school: "", // 校区
  dormitory: "", // 宿舍号
  phone: "", // 手机号
  contact: "", // 联系人
  // 其他信息
  jobName: "", // 职称
  houseAddress: "", // 家庭地址
  nation: "", // 民族
  originOfStudent: "", // 生源地
  graduateCollege: "", // 毕业学院
  duty: "", // 职务
  id: "",
});
// 表单验证
const addMemberRules = reactive({
  serialNumber: [{ required: true, message: "编号不能为空", trigger: "blur" }],
  name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
  identity: [{ required: true, message: "身份不能为空", trigger: "blur" }],
  icCard: [{ required: true, message: "身份证号不能为空", trigger: "blur" }],
  sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
  department: [{ required: true, message: "部门不能为空", trigger: "blur" }],
  facePhoto: [{ required: true, message: "人脸照片不能为空", trigger: "blur" }],
  grade: [{ required: true, message: "年级不能为空", trigger: "blur" }],
  institute: [{ required: true, message: "学院不能为空", trigger: "blur" }],
  specialty: [{ required: true, message: "专业不能为空", trigger: "blur" }],
  class: [{ required: true, message: "班级不能为空", trigger: "blur" }],
  school: [{ required: true, message: "校区不能为空", trigger: "blur" }],
  dormitory: [{ required: true, message: "宿舍号不能为空", trigger: "blur" }],
  phone: [{ required: true, message: "手机号不能为空", trigger: "blur" }],
  contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
  jobName: [{ required: true, message: "职称不能为空", trigger: "blur" }],
  houseAddress: [
    { required: true, message: "家庭地址不能为空", trigger: "blur" },
  ],
  nation: [{ required: true, message: "民族不能为空", trigger: "blur" }],
  originOfStudent: [
    { required: true, message: "生源地不能为空", trigger: "blur" },
  ],
  graduateCollege: [
    { required: true, message: "毕业学院不能为空", trigger: "blur" },
  ],
  duty: [{ required: true, message: "职务不能为空", trigger: "blur" }],
});
// 批量添加 （-----------------------------------------）
const addBatchShow = ref(false);
const addBatchData = reactive({
  list: [
    {
      userName: "张三",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "王卿",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "李明",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "涂涂",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "小红",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "小明",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "例子",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
  ],
});
const addBatch_currentPage = ref(1); // 当前页
const addBatch_pageSize = ref(7);
const addBatch_total = ref(8); // 当前总数

// 批量删除（--------------------------------------------）
const delBatchShow = ref(false);
const delBatchData = reactive({
  list: [
    {
      userName: "张三",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "王卿",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "李明",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "涂涂",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "小红",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "小明",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
    {
      userName: "例子",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
  ],
});
const delBatch_currentPage = ref(1); // 当前页
const delBatch_pageSize = ref(7);
const delBatch_total = ref(8); // 当前总数

// 移动成员（-----------------------------------------------）
const selectData = reactive({ list: [] });
const moveMemberVisible = ref(false);
const moveTree = ref();
const moveSearchInput = ref();
const treeSelData = reactive({ list: [] });

// 注销账号
const closeAccountVisible = ref(false);

// 勾选删除
const selDelVisible = ref(false);

// 查看表格图片 (----------------------------------------------)
const bgImg = ref(false);
const showImg = ref();
const imgClick = (row) => {
  bgImg.value = true;
  showImg.value = row.img;
};

// 查看房型列表
const getList = async () => {
  //   loading.value = true;
  //   let data = {
  //     page: currentPage.value,
  //     rows: pageSize.value,
  //     hName: searchInput.keyWord, // 房型名称
  //     managerId: sessionStorage.getItem("token"),
  //   };
  //   let res = await axios({
  //     method: "post",
  //     url: api.value + "/mhotel/housequeryPage.action",
  //     headers: {
  //       // token: sessionStorage.getItem("token"),
  //       // user_head: sessionStorage.getItem("userhead"),
  //     },
  //     params: data,
  //   });
  //   console.log(res, "房型管理");
  //   if (res.data.code == 200) {
  //     loading.value = false;
  //     tableData.list = res.data.data.pageList;
  //     total.value = res.data.data.total;
  //     // ElMessage({
  //     //   type: "success",
  //     //   showClose: true,
  //     //   message: res.data.message,
  //     //   center: true,
  //     // });
  //   } else {
  //     loading.value = false;
  //     ElMessage({
  //       type: "error",
  //       showClose: true,
  //       message: res.data.message,
  //       center: true,
  //     });
  //   }
};

// 搜索功能
const searchBtn = lodash.debounce(async () => {
  getList();
}, 300);

// 修改部门（------------------------------------------------）
const amendBMClick = (node, data) => {
  amendBMRuleForm.department = data.label;
  amendBMVisible.value = true;
  console.log(node, data, "修改部门");
};
const confirmAmendBM = async (formEl) => {
  if (!formEl) return;
  await formEl.validate((valid, fields) => {
    if (valid) {
      console.log("submit!");
    } else {
      console.log("error submit!", fields);
    }
  });
};
const cancelAmendBM = () => {
  amendBMVisible.value = false;
};

// 新建子部门（------------------------------------------------）
const addBMClick = (node, data) => {
  addBMVisible.value = true;
  console.log(node, data, "修改部门");
};
const cancelAddBM = () => {
  addBMVisible.value = false;
};

//删除按钮（---------------------------------------------------）
const del = async (row) => {
  let data = {
    id: row.id,
  };
  //   let res = await axios({
  //     method: "post",
  //     url: api.value + "/mhotel/housedelHouser.action",
  //     headers: {
  //       // token: sessionStorage.getItem("token"),
  //       // user_head: sessionStorage.getItem("userhead"),
  //     },
  //     params: data,
  //   });
  //   if (res.data.code == 200) {
  //     if (tableData.list.length == 1 && currentPage.value != 1) {
  //       currentPage.value = currentPage.value - 1;
  //     }
  //     getList();
  //     ElMessage({
  //       type: "success",
  //       showClose: true,
  //       message: res.data.message,
  //       center: true,
  //     });
  //   } else {
  //     ElMessage({
  //       type: "error",
  //       showClose: true,
  //       message: res.data.message,
  //       center: true,
  //     });
  //   }
  // console.log(res);
};

// 添加成员(---------------------------------------------------)
const addMemberClick = () => {
  homeShow.value = false;
  addMemberShow.value = true;
};
const addMemberConcel = () => {
  addMemberShow.value = false;
  homeShow.value = true;
};
// 移出照片
const handleRemove = (uploadFile, uploadFiles) => {
  console.log(uploadFile.uid, uploadFiles);
  // fileList.list = fileList.list.filter((item) => {
  //   return item.uid != uploadFile.uid;
  // });
  // ruleForm.fileListJson = fileList.list;
};
// 点击图片的查看按钮
const handlePreview = (file) => {
  // imgUrl.value = file.url;
  // imgVisible.value = true;
  // console.log(file, "00000000");
};
// 限制上传图片的大小
const beforeAvatarUpload = (rawFile) => {
  // console.log(rawFile, 33333);
  if (rawFile.type !== "image/jpeg" && rawFile.type !== "image/png") {
    ElMessage.error("图片格式必须为JPG/PNG格式!");
    return false;
  } else if (rawFile.size / 1024 / 1024 > 10) {
    ElMessage.error("图片的大小不能超过10MB!");
    return false;
  }
  return true;
};
// 添加照片时往fileList列表中添加图片信息
const handleChange = async (file, fileLists) => {
  console.log(file, "1111");
  // fileList.list.push(file);
};
// 可以获取图片参数
const handleUpload = async (file) => {
  // if (fileList.list.length >= 6) {
  //   ElMessage.error("最多可上传6张图片!");
  //   return false;
  // }
  console.log(file, "22222222");
  addMemberRuleForm.facePhoto = file.file;
  // let data = new FormData();
  // data.set("files", file.file);
  // let res = await axios({
  //   method: "post",
  //   url: api.value + "/file/cos/upload",
  //   headers: {},
  //   data: data,
  // });
  // console.log(res, "图片上传成功详情图");
  // if (res.data.code == 1) {
  //   // res.data.data.uid = file.file.uid;
  //   // console.log([res.data.data]);
  //   let arr = {
  //     uid: file.file.uid,
  //     url: res.data.data,
  //   };
  //   fileList.list = fileList.list.concat([arr]);
  //   ruleForm.fileListJson = fileList.list;
  // }
};

// 确定编辑
const confirmEdit = (formEl) => {
  if (!formEl) return;
  formEl.validate(async (valid, fields) => {
    if (valid) {
    }
  });
};

// 批量添加 (------------------------------------------------------)
const addBatchClick = () => {
  addBatchShow.value = true;
  homeShow.value = false;
};
const addBatchConcel = () => {
  homeShow.value = true;
  addBatchShow.value = false;
};
// 移出照片
const handleRemove2 = (uploadFile, uploadFiles) => {
  // console.log(uploadFile.uid, uploadFiles);
  // fileList.list = fileList.list.filter((item) => {
  //   return item.uid != uploadFile.uid;
  // });
  // ruleForm.fileListJson = fileList.list;
};
// 点击图片的查看按钮
const handlePreview2 = (file) => {
  // imgUrl.value = file.url;
  // imgVisible.value = true;
  console.log(file);
};
// 限制上传图片的大小
const beforeAvatarUpload2 = (rawFile) => {
  console.log(rawFile.type, "文件类型");
  if (
    rawFile.type !==
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  ) {
    ElMessage.error("文件格式必须为xlsx格式!");
    return false;
  } else if (rawFile.size / 1024 / 1024 > 100) {
    ElMessage.error("图片的大小不能超过100MB!");
    return false;
  }
  return true;
};
// 添加照片时往fileList列表中添加图片信息
const handleChange2 = async (file, fileLists) => {
  console.log(file, "1111");
  // fileList.list.push(file);
};
// 可以获取图片参数
const handleUpload2 = async (file) => {
  // if (fileList.list.length >= 6) {
  //   ElMessage.error("最多可上传6张图片!");
  //   return false;
  // }
  console.log(file, "22222222");
  // let data = new FormData();
  // data.set("files", file.file);
  // let res = await axios({
  //   method: "post",
  //   url: api.value + "/file/cos/upload",
  //   headers: {},
  //   data: data,
  // });
  // console.log(res, "图片上传成功详情图");
  // if (res.data.code == 1) {
  //   // res.data.data.uid = file.file.uid;
  //   // console.log([res.data.data]);
  //   let arr = {
  //     uid: file.file.uid,
  //     url: res.data.data,
  //   };

  //   fileList.list = fileList.list.concat([arr]);
  //   ruleForm.fileListJson = fileList.list;
  // }
};
// 分页
const handleAddBatch = (value) => {
  // console.log(value);
  addBatch_currentPage.value = value;
};

// 批量删除 (------------------------------------------------------)
const delBatchClick = () => {
  delBatchShow.value = true;
  homeShow.value = false;
};
const delBatchConcel = () => {
  homeShow.value = true;
  delBatchShow.value = false;
};
// 移出照片
const handleRemove3 = (uploadFile, uploadFiles) => {
  // console.log(uploadFile.uid, uploadFiles);
  // fileList.list = fileList.list.filter((item) => {
  //   return item.uid != uploadFile.uid;
  // });
  // ruleForm.fileListJson = fileList.list;
};
// 点击图片的查看按钮
const handlePreview3 = (file) => {
  // imgUrl.value = file.url;
  // imgVisible.value = true;
  console.log(file);
};
// 限制上传图片的大小
const beforeAvatarUpload3 = (rawFile) => {
  console.log(rawFile.type, "文件类型");
  if (
    rawFile.type !==
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  ) {
    ElMessage.error("文件格式必须为xlsx格式!");
    return false;
  } else if (rawFile.size / 1024 / 1024 > 100) {
    ElMessage.error("图片的大小不能超过100MB!");
    return false;
  }
  return true;
};
// 添加照片时往fileList列表中添加图片信息
const handleChange3 = async (file, fileLists) => {
  console.log(file, "1111");
  // fileList.list.push(file);
};
// 可以获取图片参数
const handleUpload3 = async (file) => {
  // if (fileList.list.length >= 6) {
  //   ElMessage.error("最多可上传6张图片!");
  //   return false;
  // }
  console.log(file, "22222222");
  // let data = new FormData();
  // data.set("files", file.file);
  // let res = await axios({
  //   method: "post",
  //   url: api.value + "/file/cos/upload",
  //   headers: {},
  //   data: data,
  // });
  // console.log(res, "图片上传成功详情图");
  // if (res.data.code == 1) {
  //   // res.data.data.uid = file.file.uid;
  //   // console.log([res.data.data]);
  //   let arr = {
  //     uid: file.file.uid,
  //     url: res.data.data,
  //   };

  //   fileList.list = fileList.list.concat([arr]);
  //   ruleForm.fileListJson = fileList.list;
  // }
};
// 分页
const handleDelBatch = (value) => {
  // console.log(value);
  delBatch_currentPage.value = value;
};

// 移动成员 (----------------------------------------------------------------)
// 首页表格多选框功能
const handleSelectionChange = (val) => {
  console.log(val);
  selectData.list = val;
};
const moveMemberClick = () => {
  if (selectData.list.length) {
    moveMemberVisible.value = true;
  } else {
    ElMessage({
      type: "warning",
      showClose: true,
      message: "请先选择需要移动的用户",
      center: true,
    });
  }
};
const cancelMoveMember = () => {
  moveMemberVisible.value = false;
  moveTree.value.setCheckedKeys([]);
  treeSelData.list = [];
};
// 移动成员里面勾选的
const moveCheckChange = (data, checked, indeterminate) => {
  console.log(data, checked, indeterminate, "移动成员勾选");
  // console.log(moveTree.value.getCheckedKeys());
  if (checked) {
    let arr = {
      id: data.id,
      label: data.label,
    };
    treeSelData.list.push(arr);
    console.log(treeSelData.list);
  }
};
// 移动取消勾选
const cancelTreeSel = (i) => {
  console.log(i);
  treeSelData.list = treeSelData.list.filter((item) => {
    return item.id != i.id;
  });
  let arr = [];
  treeSelData.list.forEach((item) => {
    arr.push(item.id);
  });
  moveTree.value.setCheckedKeys(arr);
};

// 注销账号 (--------------------------------------------------------------------)
const closeAccountClick = () => {
  if (selectData.list.length) {
    closeAccountVisible.value = true;
  } else {
    ElMessage({
      type: "warning",
      showClose: true,
      message: "请先选择需要注销的用户",
      center: true,
    });
  }
};
const cancelCloseAccount = () => {
  closeAccountVisible.value = false;
};

// 勾选删除 (--------------------------------------------------------------------)
const delDelClick = () => {
  if (selectData.list.length) {
    selDelVisible.value = true;
  } else {
    ElMessage({
      type: "warning",
      showClose: true,
      message: "请先选择需要删除的用户",
      center: true,
    });
  }
};
const cancelSelDel = () => {
  selDelVisible.value = false;
};

//导出功能
// const importExcel = async () => {
//   if (searchInput.createTime == null) {
//     searchInput.createTime = "";
//   }
//   let data = new FormData();
//   data.set("car_number", searchInput.carnumber);
//   data.set("create_time", searchInput.createTime);
//   let res = await axios({
//     method: "post",
//     url: api.value + "/carBook/cinfotoExcel.action",
//     headers: {
//       token: sessionStorage.getItem("token"),
//     },
//     data: data,
//   });
//   // console.log(res, "导出账号");
//   if (res.data.code == 200) {
//     // const elt = document.createElement("a");
//     // elt.setAttribute(
//     //   "href",
//     //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
//     // );
//     // elt.setAttribute("download", "file.png");
//     // elt.style.display = "none";
//     // document.body.appendChild(elt);
//     // elt.click();
//     var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
//     console.log("获得地址数据:", downloadPath);
//     var downloadLink = document.createElement("a");
//     downloadLink.style.display = "none"; // 使其隐藏
//     downloadLink.href = downloadPath;
//     downloadLink.download = "";
//     downloadLink.click();
//     document.body.appendChild(downloadLink);
//     document.body.removeChild(downloadLink);
//     ElMessage({
//       type: "success",
//       showClose: true,
//       message: res.data.message,
//       center: true,
//     });
//   } else {
//     ElMessage({
//       type: "error",
//       showClose: true,
//       message: res.data.message,
//       center: true,
//     });
//   }
// };
// 表格斑马纹颜色修改
const tableRowClassName = ({ row, rowIndex }) => {
  if (rowIndex % 2 === 0) {
    return "even";
  } else if (rowIndex % 2 !== 0) {
    return "odd";
  }
  return "";
};
// 分页
const handleCurrentChange = (value) => {
  // console.log(value);
  currentPage.value = value;
  getList();
};

onBeforeMount(async () => {
  api.value = store.state.user.api;
  getList();
});
onUnmounted(() => {
  // document.removeEventListener("keyup", Enters);
});
</script>

<style scoped lang="scss">
.content-box {
  width: 100%;
  height: calc(100vh - 65px);
  // margin: 20px auto;
  background-color: #fff;
  // color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
  .searchTree {
    width: 220px;
    margin: 20px 12px;
    :deep(.el-input__wrapper) {
      background-color: rgba(230, 230, 230, 1);
    }
  }
  .treeV {
    width: 247px;
    height: 96%;
    margin-right: 20px;
    border-radius: 8px;
    box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
    .el-tree-node__content {
      .custom-tree-node {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 14px;
        padding-right: 8px;
        .title {
          display: flex;
          align-items: center;
        }
        img {
          width: 1.2em;
          height: 1.2em;
          margin: 0 5px 0 0;
        }
      }
    }
  }
  // 主页面
  .userRight {
    flex: 1;
    height: 96%;
    margin-right: 20px;
    border-radius: 8px;
    box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
    .left {
      // width: calc(100wh - 40px);
      display: flex;
      align-items: center;
      height: 60px;
      padding: 0 30px;
      border-bottom: 1px solid #ccc;
      color: rgb(0, 0, 0);
      font-size: 20px;
      font-weight: 600;

      span:nth-child(2) {
        margin-left: 20px;
        font-size: 14px;
        color: rgba(128, 128, 128, 1);
      }
    }

    .middle {
      width: 96%;
      margin: 0 auto;

      color: #000;

      // border-bottom: 1px solid rgb(231, 231, 231);
      .filter {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        margin: 10px 0 0 0;

        .search {
          color: #fff;
        }

        .condition {
          display: flex;
          align-items: center;
          margin: 10px 30px 10px 0;

          :deep(.el-input .el-input__inner) {
            font-size: 14px;
          }

          span {
            margin: 0 10px 0 0;
          }
        }
      }

      .gongneng {
        margin: 10px 0 20px 0;

        span {
          color: #fff;
        }
        .el-button {
          margin-right: 10px;
        }
        .el-dropdown {
          margin: 0 10px;
        }
      }

      :deep(.cont) {
        width: 60%;
        margin: 20px auto;
      }

      :deep(.download) {
        display: flex;
        align-items: center;
        margin: 10px;
      }

      :deep(.download span) {
        font-size: 16px;
        margin-left: 20px;
      }

      :deep(.cont .el-button) {
        margin-left: 60px;
        margin-bottom: 30px;
      }

      :deep(.cont .accomplish) {
        width: 100%;
        display: flex;
        justify-content: center;
      }

      :deep(.cont .accomplish .el-button) {
        width: 50%;
        margin: 0;
      }
    }

    .footer {
      width: 96%;
      height: 550px;
      margin: 10px auto 30px;

      .el-table--fit {
        height: 100%;

        :deep(.el-table__header-wrapper) {
          background-color: #000;
          font-size: 14px;

          tr {
            // color: #000;
          }
        }

        :deep(.el-table__row) {
          height: 50px;
          font-size: 14px;
          // color: #000;
          &:hover {
            td {
              background-color: rgba(223, 236, 254, 1);
            }
          }
        }

        :deep(.el-table__row):nth-child(2n) {
          .el-table-fixed-column--right {
            background-color: rgba(240, 243, 247, 1);
          }
        }

        :deep(.el-table__row td) {
          padding: 0;
          border: 0;
          .img {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 5px 0;
            img {
              width: 60px;
              height: 60px;
              cursor: pointer;
            }
          }
        }

        .el-button--primary {
          margin-left: 5px;
        }

        :deep(.el-table__body .even) {
          background-color: #fff;
        }

        :deep(.el-table__body .odd) {
          background-color: rgba(240, 243, 247, 1);
        }

        :deep(.edit) {
          display: flex;
          align-items: center;
          justify-content: center;
          color: rgba(111, 182, 184, 1);
        }

        :deep(.look) {
          padding: 0 10px;
          cursor: pointer;
          color: rgba(30, 125, 251, 1);
        }

        .del {
          padding: 0 10px;
          color: rgba(212, 48, 48, 1);
          cursor: pointer;
        }

        // :deep(.look):hover {
        //   color: red;
        // }
        // :deep(.del):hover {
        //   color: red;
        // }
      }
    }
  }
  // 批量导入
  .addMember {
    flex: 1;
    height: 96%;
    margin-right: 20px;
    border-radius: 8px;
    box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
    .left {
      // width: calc(100wh - 40px);
      display: flex;
      align-items: center;
      height: 60px;
      padding: 0 30px;
      border-bottom: 1px solid #ccc;
      color: rgb(0, 0, 0);
      font-size: 20px;
      font-weight: 600;
      img {
        width: 18px;
        height: 18px;
        cursor: pointer;
      }
      .add {
        margin-left: 20px !important;
        font-size: 20px !important;
        color: rgba(0, 0, 0, 1) !important;
      }
    }
    .content {
      padding: 0 30px;
      height: calc(100% - 71px);
      margin: 10px 0 0 0;
      .form {
        height: 98%;
        overflow: auto;
        .startImport {
          .el-button {
            width: 500px;
            height: 45px;
          }
          .downLoad {
            color: rgba(0, 97, 255, 1);
            font-size: 14px;
            margin-left: 15px;
            cursor: pointer;
          }
        }
        .tableTitle {
          font-size: 14px;
          margin-top: 10px;
        }
        .footer {
          width: 99%;
          height: 360px;
          margin: 10px auto 30px;

          .el-table--fit {
            height: 100%;

            :deep(.el-table__header-wrapper) {
              background-color: #000;
              font-size: 14px;

              tr {
                color: #000;
              }
            }

            :deep(.el-table__row) {
              height: 45px;
              font-size: 14px;
              color: #000;
              &:hover {
                td {
                  background-color: rgba(223, 236, 254, 1);
                }
              }
            }

            :deep(.el-table__row):nth-child(2n) {
              .el-table-fixed-column--right {
                background-color: rgba(240, 243, 247, 1);
              }
            }

            :deep(.el-table__row td) {
              padding: 0;
              border: 0;
            }

            .el-button--primary {
              margin-left: 5px;
            }

            :deep(.el-table__body .even) {
              background-color: #fff;
            }

            :deep(.el-table__body .odd) {
              background-color: rgba(240, 243, 247, 1);
            }

            :deep(.edit) {
              display: flex;
              align-items: center;
              justify-content: center;
              color: rgba(111, 182, 184, 1);
            }

            :deep(.look) {
              padding: 0 10px;
              cursor: pointer;
              color: rgba(30, 125, 251, 1);
            }

            .del {
              padding: 0 10px;
              color: rgba(212, 48, 48, 1);
              cursor: pointer;
            }

            // :deep(.look):hover {
            //   color: red;
            // }
            // :deep(.del):hover {
            //   color: red;
            // }
          }
          .pageSize {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 20px 30px 0;

            span {
              color: #000;
            }

            .el-pagination {
              // width: 1600px;
              :deep(.el-pagination__total) {
                color: #000;
              }

              :deep(.el-pagination__goto) {
                color: #000;
              }

              :deep(.el-pagination__classifier) {
                color: #000;
              }

              :deep(.el-input__wrapper) {
                border: 1px solid rgba(0, 0, 0, 1);
                border-radius: 5px;
                box-shadow: none;
              }

              :deep(.el-pager li) {
                margin: 0 5px;
                border: 1px solid rgba(0, 0, 0, 1);
                border-radius: 5px;
                background-color: transparent;
              }

              :deep(.el-pager li.is-active) {
                // background-color: rgba(0, 97, 255, 0.8);
                border: 1px solid rgba(0, 97, 255, 1);
                color: rgba(0, 97, 255, 1);
              }

              :deep(.btn-prev) {
                margin-right: 5px;
                border: 1px solid rgba(0, 0, 0, 1);
                border-radius: 5px;
                background-color: transparent;
              }

              :deep(.btn-next) {
                margin-left: 5px;
                border: 1px solid rgba(0, 0, 0, 1);
                border-radius: 5px;
                background-color: transparent;
              }
            }
          }
        }
      }
      // 整个滚动条
      .form::-webkit-scrollbar-track {
        background-color: #daeeff;
      }
      // 滚动条的滚动区域（轨道）
      .form::-webkit-scrollbar {
        background-color: #0888f8;
        height: 3px;
        width: 4px;
      }
      // 滚动条的可拖拽部分（滑块）
      // .form::-webkit-scrollbar-thumb {
      //   background: #57b2ff;
      //   border-radius: 4px;
      //   height: 3px;
      //   width: 4px;
      // }
    }
  }
  .bgImg {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 99999999;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);

    // border-radius: 50px;
    :deep(.el-carousel__container) {
      width: 100%;
      height: calc(100vh);

      .el-carousel__item {
        display: flex;
        justify-content: center;

        img {
          height: 100%;
        }
      }
    }
  }
  // 修改部门
  :deep(.amendBMDialog) {
    // height: 600px;
    overflow: hidden;
    border-radius: 11px;

    .el-dialog__header {
      border-radius: 11px 11px 0 0;
      background: rgba(245, 249, 255, 1);
      font-weight: 600;
      height: 60px;
      padding: 0 20px;
      line-height: 60px;
      margin: 0;
      border-bottom: 1px solid rgba(230, 230, 230, 1);

      .el-dialog__headerbtn {
        outline: none;
      }
    }

    .el-dialog__body {
      padding: 0px 20px 20px 20px;
      // height: 200px;
      // display: flex;
      // flex-direction: column-reverse;
      .el-form-item {
        margin: 40px 0;
      }
      .option {
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        margin: 10px 0;

        .queding {
          margin-left: 20px;
        }
      }
    }
  }
  // 移动成员
  :deep(.moveMemberDialog) {
    // height: 600px;
    overflow: hidden;
    border-radius: 11px;

    .el-dialog__header {
      border-radius: 11px 11px 0 0;
      background: rgba(245, 249, 255, 1);
      font-weight: 600;
      height: 60px;
      padding: 0 20px;
      line-height: 60px;
      margin: 0;
      border-bottom: 1px solid rgba(230, 230, 230, 1);

      .el-dialog__headerbtn {
        outline: none;
      }
    }

    .el-dialog__body {
      padding: 0px 20px 20px 20px;
      height: 550px;
      // display: flex;
      // flex-direction: column-reverse;
      .move {
        display: flex;
        .moveLeft {
          width: 280px;
          height: 96%;
          margin-right: 20px;
          border-radius: 8px;
          // box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
          .el-tree {
            height: 430px;
            // border: 1px solid red;
            overflow: auto;
          }
          .el-tree-node__content {
            .custom-tree-node {
              flex: 1;
              display: flex;
              align-items: center;
              justify-content: space-between;
              font-size: 14px;
              padding-right: 8px;
              .title {
                display: flex;
                align-items: center;
              }
              img {
                width: 1.2em;
                height: 1.2em;
                margin: 0 5px 0 0;
              }
            }
          }
        }
        .moveRight {
          margin: 20px 0 0 0;
          flex: 1;
          .sel {
            margin-bottom: 10px;
          }
          ul {
            // width: 316px;
            height: 95%;
            list-style: none;
            padding: 0;
            margin: 0;
            border-left: 1px solid rgba(230, 230, 230, 1);
            box-sizing: border-box;
            overflow: auto;

            li {
              display: flex;
              justify-content: space-between;
              padding-right: 17px;
              align-items: center;
              margin-top: 5px;

              .el-icon-close {
                cursor: pointer;
                width: 10px;
                height: 10px;
              }
            }
          }
        }
      }
      .options {
        margin: 15px 0;
        display: flex;
        flex-direction: row-reverse;
        .queding {
          margin-left: 20px;
        }
      }

      .option {
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        margin: 10px 0;

        .queding {
          margin-left: 20px;
        }
      }
    }
  }
  // 注销账号
  :deep(.closeAccount) {
    // height: 600px;
    overflow: hidden;
    border-radius: 11px;

    .el-dialog__header {
      border-radius: 11px 11px 0 0;
      background: rgba(245, 249, 255, 1);
      font-weight: 600;
      height: 60px;
      padding: 0 20px;
      line-height: 60px;
      margin: 0;
      border-bottom: 1px solid rgba(230, 230, 230, 1);

      .el-dialog__headerbtn {
        outline: none;
      }
    }

    .el-dialog__body {
      padding: 0px 20px 20px 20px;
      // height: 200px;
      // display: flex;
      // flex-direction: column-reverse;
      .content {
        height: 80px;
        font-size: 16px;
        padding: 20px 30px;
        display: flex;
        img {
          width: 25px;
          height: 25px;
          margin: 0 8px 0 0;
        }
      }
      .option {
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        margin: 10px 0;

        .queding {
          margin-left: 20px;
        }
      }
    }
  }

  .pageSize {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 30px;

    span {
      color: #000;
    }

    .el-pagination {
      // width: 1600px;
      :deep(.el-pagination__total) {
        color: #000;
      }

      :deep(.el-pagination__goto) {
        color: #000;
      }

      :deep(.el-pagination__classifier) {
        color: #000;
      }

      :deep(.el-input__wrapper) {
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        box-shadow: none;
      }

      :deep(.el-pager li) {
        margin: 0 5px;
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        background-color: transparent;
      }

      :deep(.el-pager li.is-active) {
        // background-color: rgba(0, 97, 255, 0.8);
        border: 1px solid rgba(0, 97, 255, 1);
        color: rgba(0, 97, 255, 1);
      }

      :deep(.btn-prev) {
        margin-right: 5px;
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        background-color: transparent;
      }

      :deep(.btn-next) {
        margin-left: 5px;
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        background-color: transparent;
      }
    }
  }
}

.el-input {
  width: 192px;
}
</style>
