<template>
  <div class="warrper">
    <div class="pt32l24">
      <div class="gotoButton pb24" @click="gotoCLick"><i class="gotoIcon"></i>返回</div>
      <div class="gjhqTitle pb24 mb0"><span class="gjhqbtn rf"><el-button class="gjhqprimarybtn" @click="addCYHandle"><i class="gjhqicon gjhqmr4 gjhqaddIconT"></i>添加成员</el-button></span>角色管理</div>
    </div>
    <div class="roleMain">
      <div class="roleleft">
        <div class="roleleftBox">
          <div class="roleTile">角色身份 <i class="roleMoreIcon" @click="weakupPopup"></i>
            <div class="roleMoreDownBox roleMoreDowmClass" v-if="roleMoreDowmShows == true" id="showBoxId">
              <div class="roleMoreDownTil">内置角色权限说明</div>
              <div class="roleMoreDownMain">
                <div v-for="(item, i) in roleMoreDatas" :key="i" class="roleMoreBox">
                  <div class="roleMoreTils" @click="downCLick(item)" v-if="item.shows == false"><i class="downIconRole"></i>{{ item.title }}</div>
                  <div class="roleMoreTils" @click="upCLick(item)" v-else><i class="upIconRole"></i>{{ item.title }}</div>
                  <div v-if="item.shows == true">
                    <div class="roleMoreLi" v-for="(subItem, indx) in item.liDatas" :key="indx">{{ subItem.name }}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="roleNav">
            <div class="roleLi" v-for="(item, i) in roleListDatas" :key="i" :class="leftNavnum == i?'current':''" @click="roleNavHandle(i, item)">{{ item.name }}</div>
          </div>
          <div class="addRoleBtn" @click="addRoleHandle"><i class="addIcon"></i>新建角色</div>
        </div>
      </div>
      <div class="roleright">
        <div class="roleTile">{{rightDatas.name}}</div>
        <div class="elementUiTable">
          <el-table header-cell-class-name="my-header-class"
            :data="roleTableData"
            style="width: 100%">
            <el-table-column
              label="姓名"
              prop="username">
            </el-table-column>
            <el-table-column
              label="角色">
              <template slot-scope="scope">
                <span v-if="scope.row.role != null">{{ scope.row.role.name}}</span>
                <span v-else>-</span>
              </template>
            </el-table-column>
            <el-table-column
              label="状态"
              sortable
              >
              <template slot-scope="scope">
                <span v-if="scope.row.shows">
                  <span v-if="scope.row.lock == 'unlock'">开启</span>
                  <span v-else>关闭</span>
                </span>
                <span v-else>
                  <el-switch v-model="scope.row.delivery"></el-switch>
                </span>
              </template>
            </el-table-column>
            <el-table-column
              label="操作">
              <template slot-scope="scope">
                <div class="gjhqbtn">
                  <el-button class="gjhqformbtn" v-if="scope.row.shows" @click="editHandle(scope.row)">编辑</el-button>
                  <el-button class="gjhqformbtn" v-else @click="saveHandle(scope.row)">保存</el-button>
                  <el-button class="gjhqformbtn" @click.native.prevent="deleteRow(scope.row)">删除</el-button>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>
    <!-- 弹框新建角色 -->
    <div class="dialogPopRigth" v-if="addRolePopShow">
      <div class="dialogBox dialogPopRigthMain">
        <div class="diologBoxTile">新建角色</div>
        <div class="padd24">
          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="demo-ruleForm">
            <el-form-item label="角色名称" prop="name">
              <span class="gjhqIpt"><el-input class="w320" v-model="ruleForm.name" placeholder="请输入"></el-input></span>
            </el-form-item>
            <el-form-item label="权限管理">
              <div class="roleForm qxSl" :style="{height:navRoleHeight+'px'}">
                <el-tree
                  :data="meuns"
                  :show-checkbox="true"
                  :default-checked-keys="treeList"
                  node-key="name"
                  ref="tree"
                  @check-change="handleCheckChange"
                  :default-expanded-keys="[]"
                  :props="defaultProps">
                </el-tree>
              </div>
            </el-form-item>
          </el-form>
        </div>
        <div class="buttonDialog">
          <div class="gjhqbtn">
            <el-button class="gjhqmorenbtn" @click="resetForm">取 消</el-button>
            <el-button class="gjhqprimarybtn" @click="submitForm('ruleForm')">确 定</el-button>
          </div>
        </div>
      </div>
    </div>

    <!-- 弹框添加成员 -->
    <div class="dialogPopRigth" v-if="addChenyuanPopShow">
      <div class="dialogBox dialogPopRigthMain">
        <div class="diologBoxTile">添加成员</div>
        <div class="padd24">
          <el-form :model="ruleFormCy" :rules="rulesCy" ref="ruleFormCy" label-width="80px" class="demo-ruleForm">
            <el-form-item label="选择用户" prop="userName">
              <div class="usellistPop">
                <span class="gjhqIpt">
                  <el-select
                    v-model="ruleFormCy.userName"
                    placeholder="请选择"
                    style="width:320px;"
                    @change="userChanges"
                    value-key="id">
                    <el-option
                      v-for="item in userListData"
                      :key="item.id"
                      :label="item.username"
                      :value="item">
                    </el-option>
                  </el-select>
                </span>
                <div class="userListpopInfo" v-if="addUserShow == true" @click="addUserClickHandle">
                  <i class="icon">+</i>新增用户
                </div>
              </div>
              <div class="addUserListPop" v-if="addUserShow == false">
                <div class="addRoleUserTitle">用户信息</div>
                <el-form :model="addUserForm" :rules="addUserRle" ref="addUserForm"  label-width="70px" class="demo-ruleForm">
                  <el-form-item label="姓名" class="mb20Role" prop="username">
                    <span class="gjhqIpt"><el-input v-model="addUserForm.username" placeholder="请输入"></el-input></span>
                  </el-form-item>
                  <el-form-item label="性别" class="mb20Role">
                    <span class="gjhqIpt">
                      <el-select v-model="addUserForm.gender" placeholder="请选择" style="width:100%" name="gender">
                        <el-option
                          v-for="item in popsexOptions"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                        </el-option>
                      </el-select>
                    </span>
                  </el-form-item>
                  <el-form-item label="手机" class="mb20Role" prop="name">
                    <span class="gjhqIpt"><el-input v-model="addUserForm.name" maxlength="11" placeholder="请输入"></el-input></span>
                  </el-form-item>
                  <el-form-item label="职位" class="mb20Role" prop="zhiweiArr">
                    <el-select v-model="addUserForm.zhiweiArr" placeholder="请选择" class="elselectUi" multiple name="zhiweiArr" style="width:100%;" @change="zhiweiAddHandle">
                      <el-option
                        v-for="item in pooptions"
                          :key="item.id"
                          :label="item.name"
                          :value="item.id">
                      </el-option>
                      <div class="eloption">
                        <div class="gjhqiconBtnT" style="width:80px;" v-if="addUserForm.popPosiShow == true" @click="popAddHandle"><i class="gjhqicon gjhqmr4 gjhqaddIconT"></i>添加职位</div>
                        <div class="gjhqIpt" v-else>
                          <el-input style="width:130px;" v-model="addUserForm.posiVals" placeholder="输入新内容"></el-input>
                          <span class="eloptionbtn">
                            <span class="elbtn" @click="closePopHandle">取消</span>
                            <span class="elbtn" @click="popSaveHandle">保存</span>
                          </span>
                        </div>
                      </div>
                    </el-select>
                  </el-form-item>
                </el-form>
                <div class="addRoleUserTitle">用户信息</div>
                <el-form label-width="92px" class="demo-ruleForm">
                  <el-form-item label="用户名">
                    <div class="roleInfoPostxt" v-if="addUserForm.name == ''">-</div>
                    <div class="roleInfoPostxt" v-else>
                      <p>{{ addUserForm.name }}</p>
                      <p class="txtLine">用户名默认为用户手机号</p>
                      <p class="txtLine">如需更改用户名，请修改用户手机号</p>
                    </div>
                  </el-form-item>
                  <el-form-item label="初始密码" v-if="addUserForm.name != ''">
                    <span v-if="addUserForm.name != ''">123@Abc</span>
                  </el-form-item>
                </el-form>
                <div class="gjhqbtn" style="text-align:right;">
                  <el-button class="gjhqmorenbtn" @click="resetUserForm">取 消</el-button>
                  <el-button class="gjhqprimarybtn" @click="submitUserForm('addUserForm')">确 定</el-button>
                </div>
              </div>
            </el-form-item>
            <el-form-item label="职位">
              <span v-if="ruleFormCy.zhiwei.length > 0">
                <span v-for="(item, i) in ruleFormCy.zhiwei" :key="i">
                  {{ item.name }}
                </span>
              </span>
              <span v-else>-</span>
            </el-form-item>
            <el-form-item label="分配角色" prop="role_id">
              <span class="gjhqIpt">
                <el-select
                  v-model="ruleFormCy.role_id"
                  placeholder="请选择"
                  style="width:320px;"
                  value-key="id">
                  <el-option
                    v-for="item in roleListDatasTwe"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                  </el-option>
                </el-select>
              </span>
            </el-form-item>
            <el-form-item label="状态">
              <el-switch v-model="ruleFormCy.delivery"></el-switch>
            </el-form-item>
          </el-form>
        </div>
        <div class="buttonDialog">
          <div class="gjhqbtn">
            <el-button class="gjhqmorenbtn" @click="resetCyForm">取 消</el-button>
            <el-button class="gjhqprimarybtn" @click="submitCyForm">确 定</el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { adminRole, adminAdminRoleAddPost, adminAdminsRoleGetTwe, adminZhiwei, adminZhiweiPost, adminAdminRolePermission, adminAdmins, adminAdminRoleDelPost, adminAdminsPut } from '../../axios/api'
export default {
  name: 'role',
  data () {
    var checkPhone = (rule, value, callback) => {
      if (value === '') {
        return callback(new Error('手机号不能为空！'))
      } else if (!this.phoneRegex.test(value)) {
        callback(new Error('请输入11位正确手机号！'))
      } else {
        callback()
      }
    }
    return {
      addRolePopShow: false,
      addChenyuanPopShow: false,
      addUserShow: true,
      addRolePopHeight: '',
      roleHeight: '',
      navRoleHeight: '',
      ruleForm: {
        name: ''
      },
      rules: {
        name: [
          { required: true, message: '角色名称不能为空！', trigger: 'blur' }
        ]
      },
      ruleFormCy: {
        userName: '',
        userId: '',
        zhiwei: '-',
        role_id: '',
        stuart: 1,
        delivery: true,
        lock: ''
      },
      rulesCy: {
        userName: [
          { required: true, message: '成员不能为空！', trigger: 'change' }
        ],
        role_id: [
          { required: true, message: '角色不能为空！', trigger: 'change' }
        ]
      },
      meuns: [
        {
          url: null,
          route: '',
          path: '',
          title: '基础信息采集（必选其一）',
          type: '主菜单',
          name: 'basicinfocoll',
          role: [],
          meun: false,
          more: false,
          children: [
            {
              url: 'schoolscale',
              route: 'schoolscale',
              path: 'schoolscale',
              name: 'admin:school',
              stype: '二级菜单',
              title: '1.1 学校基础信息采集量表',
              role: [],
              meun: false
            },
            {
              url: null,
              route: '',
              path: '',
              name: 'admin:school-equipment',
              stype: '二级菜单',
              title: '1.2 学校设备信息采集量表',
              role: [],
              meun: false,
              more: false,
              children: [
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:monitor_equipment_collection',
                  stype: '三级菜单',
                  title: '1.2.1 监控设备采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:fql_equipment_collection',
                  stype: '三级菜单',
                  title: '1.2.2 防欺凌设备信息采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:emotion_equipment_collection',
                  stype: '三级菜单',
                  title: '1.2.3 情绪识别设备采集量表',
                  role: [],
                  meun: false
                }
              ]
            },
            {
              url: 'schoolscale',
              route: 'schoolscale',
              path: 'schoolscale',
              name: 'admin:school_people_info',
              stype: '二级菜单',
              title: '1.3 学校人员基础信息采集量表',
              role: [],
              meun: false
            },
            {
              url: 'schoolscale',
              route: 'schoolscale',
              path: 'schoolscale',
              name: 'admin:ql_committee_collection',
              stype: '二级菜单',
              title: '1.4 学生欺凌委员会信息采集量表',
              role: [],
              meun: false
            },
            {
              url: 'schoolscale',
              route: 'schoolscale',
              path: 'schoolscale',
              name: 'admin:regulations_system_collection',
              stype: '二级菜单',
              title: '1.5 学校规章制度采集量表',
              role: [],
              meun: false
            },
            {
              url: null,
              route: '',
              path: '',
              name: 'admin:preventive-work-advance',
              stype: '二级菜单',
              title: '1.6 常态工作-事前预防工作统计表',
              role: [],
              meun: false,
              more: false,
              children: [
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:beforehand_prevention_collection',
                  stype: '三级菜单',
                  title: '1.6.1 日常管制刀具工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:fql_training_collection',
                  stype: '三级菜单',
                  title: '1.6.2 反欺凌相关培训工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:health_education_topic',
                  stype: '三级菜单',
                  title: '1.6.3 德育教育工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:legal_safety_education',
                  stype: '三级菜单',
                  title: '1.6.4 法治安全教育工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:safety_health_education',
                  stype: '三级菜单',
                  title: '1.6.5 生命安全健康教育工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:psychology_tutoring_education',
                  stype: '三级菜单',
                  title: '1.6.6 心理辅导教育工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:student_file_collection',
                  stype: '三级菜单',
                  title: '1.6.7 学生档案工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:activity_work_collection',
                  stype: '三级菜单',
                  title: '1.6.8 学生组织团体活动工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:jk_xj_collection',
                  stype: '三级菜单',
                  title: '1.6.9 监控室巡检工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:parents_communication_collection',
                  stype: '三级菜单',
                  title: '1.6.10 家长沟通工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:prevention_work_count',
                  stype: '三级菜单',
                  title: '1.6.11 学生促进学校欺凌防治工作采集量表',
                  role: [],
                  meun: false
                }
              ]
            },
            {
              url: null,
              route: '',
              path: '',
              name: 'admin:discover-work-statistics',
              stype: '二级菜单',
              title: '1.7 常态工作-事中发现工作统计表',
              role: [],
              meun: false,
              more: false,
              children: [
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:feedback_frequency_work',
                  stype: '三级菜单',
                  title: '1.7.1 举报信箱工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:student_communication_work',
                  stype: '三级菜单',
                  title: '1.7.2 学生沟通工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:inspection_work_collection',
                  stype: '三级菜单',
                  title: '1.7.3 区域巡检工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:electronic_equipment_work',
                  stype: '三级菜单',
                  title: '1.7.4 校园反欺凌电子设备工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:action_evaluation_collection',
                  stype: '三级菜单',
                  title: '1.7.5 操行评价工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:stop_action_collection',
                  stype: '三级菜单',
                  title: '1.7.6 学生制止欺凌行为工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:equipment_inspection_work',
                  stype: '三级菜单',
                  title: '1.7.7 反欺凌设备日常巡检相关的工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:appearance_work_collection',
                  stype: '三级菜单',
                  title: '1.7.8 日常仪容仪检查工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:emotion_screen_collection',
                  stype: '三级菜单',
                  title: '1.7.9 学生异常情绪筛查预警工作采集量表',
                  role: [],
                  meun: false
                }
              ]
            },
            {
              url: null,
              route: '',
              path: '',
              name: 'admin:handle-work-statistics',
              stype: '二级菜单',
              title: '1.8 常态工作-事后处理工作统计表',
              role: [],
              meun: false,
              more: false,
              children: [
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:conflict_log_work',
                  stype: '三级菜单',
                  title: '1.8.1 冲突记录工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:psychological_counseling_collection',
                  stype: '三级菜单',
                  title: '1.8.2 心理辅导工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:action_correction_collection',
                  stype: '三级菜单',
                  title: '1.8.3 行为矫正工作采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:gqt_adjustment_collection',
                  stype: '三级菜单',
                  title: '1.8.4 学生调节矛盾工作采集量表',
                  role: [],
                  meun: false
                }
              ]
            }
          ]
        },
        {
          url: null,
          route: '',
          path: '',
          type: '主菜单',
          title: '常态工作记录（必选其一）',
          name: 'normalwork',
          role: [],
          meun: false,
          more: false,
          children: [
            {
              url: null,
              route: '',
              path: '',
              name: 'admin:record-preventive-behaviors',
              stype: '二级菜单',
              title: '2.1 常态工作-日常预防行为记录表',
              role: [],
              meun: false,
              more: false,
              children: [
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:dangerous_screening_collection',
                  stype: '三级菜单',
                  title: '2.1.1 管制刀具筛查工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:training_work_log',
                  stype: '三级菜单',
                  title: '2.1.2 反欺凌相关培训工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:dd_fz_xl_course',
                  stype: '三级菜单',
                  title: '2.1.3 德育教育工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:legal_system_education',
                  stype: '三级菜单',
                  title: '2.1.4 法治安全教育工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:life_safety_transfer',
                  stype: '三级菜单',
                  title: '2.1.5 生命安全健康教育工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:psychology_tutor_education',
                  stype: '三级菜单',
                  title: '2.1.6 心理辅导教育工作记录采集量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:student_file_log',
                  stype: '三级菜单',
                  title: '2.1.7 学生档案工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:group_activities_log',
                  stype: '三级菜单',
                  title: '2.1.8 团体活动工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:monitoring_room_log',
                  stype: '三级菜单',
                  title: '2.1.9 监控室日常工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:parents_communication_log',
                  stype: '三级菜单',
                  title: '2.1.10 家长沟通工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:activity_participate_check',
                  stype: '三级菜单',
                  title: '2.1.11 学生校园活动参与抽查表',
                  role: [],
                  meun: false
                }
              ]
            },
            {
              url: null,
              route: '',
              path: '',
              name: 'admin:bullying-discovery-record',
              stype: '二级菜单',
              title: '2.2 常态工作-欺凌发现工作记录表',
              role: [],
              meun: false,
              more: false,
              children: [
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:reporting_mailbox_work',
                  stype: '三级菜单',
                  title: '2.2.1 举报信箱工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:student_communication_log',
                  stype: '三级菜单',
                  title: '2.2.2 学生沟通工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:inspection_area_log',
                  stype: '三级菜单',
                  title: '2.2.3 区域巡检工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:fql_electronic_log',
                  stype: '三级菜单',
                  title: '2.2.4 校园反欺凌电子设备工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:operation_evaluation_log',
                  stype: '三级菜单',
                  title: '2.2.5 操行评价工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:stop_fql_behavior',
                  stype: '三级菜单',
                  title: '2.2.6 学生参与制止欺凌行为抽查表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:equipment_inspection_record',
                  stype: '三级菜单',
                  title: '2.2.7 反欺凌设备日常巡检维护工作记录表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:fql_discovery_work',
                  stype: '三级菜单',
                  title: '2.2.8 日常仪容仪表检查工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:work_record_emotional',
                  stype: '三级菜单',
                  title: '2.2.9 情绪预警筛查工作记录量表',
                  role: [],
                  meun: false
                }
              ]
            },
            {
              url: null,
              route: '',
              path: '',
              name: 'admin:handle-work-records',
              stype: '二级菜单',
              title: '2.3 常态工作-事后处理工作记录表',
              role: [],
              meun: false,
              more: false,
              children: [
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:conflict_record_scale',
                  stype: '三级菜单',
                  title: '2.3.1 冲突记录工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:psychological_counseling_work',
                  stype: '三级菜单',
                  title: '2.3.2 心理辅导工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:behavior_correction_record',
                  stype: '三级菜单',
                  title: '2.3.3 行为矫正工作记录量表',
                  role: [],
                  meun: false
                },
                {
                  url: '',
                  route: '',
                  path: '',
                  name: 'admin:solve_conflicts_among',
                  stype: '三级菜单',
                  title: '2.3.4 学生解决同学冲突情况周查表',
                  role: [],
                  meun: false
                }
              ]
            }
          ]
        },
        {
          url: 'reportcter',
          route: 'reportcter',
          path: 'reportcter',
          type: '主菜单',
          title: '上报中心',
          name: 'reportcter',
          role: [],
          meun: false
        },
        {
          url: null,
          route: '',
          path: '',
          title: '权限管理',
          name: 'permissionMassage',
          type: '主菜单',
          role: [],
          meun: false,
          more: false,
          children: [
            {
              url: 'userlist',
              route: 'userlist',
              path: 'userlist',
              name: 'userlist',
              stype: '二级菜单',
              title: '用户管理',
              role: [],
              meun: false
            },
            {
              url: 'rolelist',
              route: 'rolelist',
              path: 'rolelist',
              name: 'rolelist',
              stype: '二级菜单',
              title: '角色管理',
              role: [],
              meun: false
            },
            {
              url: 'menulist',
              route: 'menulist',
              path: 'menulist',
              name: 'menulist',
              stype: '二级菜单',
              title: '菜单管理',
              role: [],
              meun: false
            }
          ]
        },
        {
          url: 'messagecent',
          route: 'messagecent',
          path: 'messagecent',
          title: '消息中心',
          type: '主菜单',
          name: 'messagecent',
          role: [],
          meun: false
        },
        {
          url: 'schoolInfo',
          route: 'schoolInfo',
          path: 'schoolInfo',
          type: '主菜单',
          title: '学校基本信息',
          name: 'schoolInfo',
          role: [],
          meun: false
        },
        {
          url: 'apipage',
          route: 'apipage',
          path: 'apipage',
          name: 'apipage',
          type: '主菜单',
          title: 'api文档',
          role: [],
          meun: false
        }
      ],
      defaultProps: {
        children: 'children',
        label: 'title',
        name: 'name'
      },
      treeList: [],
      multipleSelection: [],
      roleListDatas: '',
      roleListDatasTwe: '',
      leftNavnum: 0,
      rightDatas: '',
      roleTableData: '',
      userListData: '',
      pooptions: '',
      popsexOptions: [
        {
          value: 1,
          label: '男'
        }, {
          value: 2,
          label: '女'
        }
      ],
      addUserForm: {
        name: '',
        gender: 1,
        password: '123@Abc',
        password_confirmation: '123@Abc',
        avatar: '',
        introduction: '',
        username: '',
        phone: '',
        role_id: [],
        popPosiShow: true,
        posiVals: '',
        zhiwei: '',
        roleId: '',
        zhiweiArr: []
      },
      addUserRle: {
        username: [
          { required: true, message: '用户名不能为空！', trigger: 'blur' }
        ],
        gender: [
          { required: true, message: '性别不能为空！', trigger: 'blur' }
        ],
        name: [
          { required: true, message: '手机号不能为空！', trigger: 'blur' },
          { validator: checkPhone, trigger: 'blur' }
        ],
        zhiweiArr: [
          { required: true, message: '职位不能为空！', trigger: 'blur' }
        ]
      },
      agesRegex: /^\d{2}$/,
      phoneRegex: /^\d{11}$/,
      roleMoreDatas: [
        {
          title: '校长',
          liDatas: [
            {
              name: '1.1 学校基础信息采集量表'
            },
            {
              name: '1.3 学校人员基础信息采集量表'
            },
            {
              name: '1.7.1 举报信箱工作采集量表'
            },
            {
              name: '2.2.1 举报信箱工作记录量表'
            }
          ],
          shows: false
        },
        {
          title: '监控专员/安保专员/门卫',
          liDatas: [
            {
              name: '1.2.1 监控设备采集量表'
            },
            {
              name: '1.6.9 监控室巡检工作采集量表'
            },
            {
              name: '1.7.3 区域巡检工作采集量表'
            },
            {
              name: '2.1.1 管制刀具筛查工作记录量表'
            },
            {
              name: '2.2.3 区域巡检工作记录量表'
            }
          ],
          shows: false
        },
        {
          title: '后勤人员',
          liDatas: [
            {
              name: '1.2.2 防欺凌设备信息采集量表'
            },
            {
              name: '1.2.3 情绪识别设备采集量表'
            },
            {
              name: '1.7.4 校园防欺凌电子设备工作采集量表'
            },
            {
              name: '1.7.7 防欺凌设备日常巡检相关的工作采集量表'
            },
            {
              name: '2.2.4 校园防欺凌电子设备工作记录量表'
            },
            {
              name: '2.2.7 防欺凌设备日常巡检维护工作记录表'
            }
          ],
          shows: false
        },
        {
          title: '法治副校长/法治辅导员',
          liDatas: [
            {
              name: '1.4 学生欺凌委员会信息采集量表'
            },
            {
              name: '1.5 学校规章制度采集量表'
            },
            {
              name: '1.6.4法治安全教育工作采集量表'
            },
            {
              name: '1.8.1 冲突记录工作采集量表'
            },
            {
              name: '2.1.4法治安全教育工作记录量表'
            },
            {
              name: '2.3.1 冲突记录工作记录量表'
            }
          ],
          shows: false
        },
        {
          title: '德育主任/德育教师',
          liDatas: [
            {
              name: '1.6.2 防欺凌相关培训工作采集量表'
            },
            {
              name: '1.6.3 德育教育工作采集量表'
            },
            {
              name: '2.1.2 防欺凌相关培训工作记录量表'
            },
            {
              name: '2.1.3 德育教育工作记录量表'
            }
          ],
          shows: false
        },
        {
          title: '心理健康教师/卫健教师',
          liDatas: [
            {
              name: '1.6.5生命安全健康教育工作采集量表'
            },
            {
              name: '1.6.6心理辅导教育工作采集量表'
            },
            {
              name: '1.8.2 心理辅导工作采集量表'
            },
            {
              name: '1.8.3 行为矫正工作采集量表'
            },
            {
              name: '2.1.5 生命安全健康教育工作记录量表'
            },
            {
              name: '2.1.6 心理辅导教育工作记录采集量表'
            },
            {
              name: '2.3.2 心理辅导工作记录量表'
            },
            {
              name: '2.3.3 行为矫正工作记录量表'
            }
          ],
          shows: false
        },
        {
          title: '班主任/少先队、团委辅导员',
          liDatas: [
            {
              name: '1.6.7 学生档案工作采集量表'
            },
            {
              name: '1.6.8 学生组织团体活动工作采集量表'
            },
            {
              name: '1.6.10 家长沟通工作采集量表'
            },
            {
              name: '1.6.11 学生促进学校欺凌防治工作采集量表'
            },
            {
              name: '1.7.2 学生沟通工作采集量表'
            },
            {
              name: '1.7.5 操行评价工作采集量表'
            },
            {
              name: '1.7.6 学生制止欺凌行为工作采集量表'
            },
            {
              name: '1.7.8 日常仪容仪检查工作采集量表'
            },
            {
              name: '1.7.9 学生异常情绪筛查预警工作采集量表'
            },
            {
              name: '1.8.4学生调节矛盾工作采集量表'
            },
            {
              name: '2.1.7 学生档案工作记录量表'
            },
            {
              name: '2.1.8 学生组织团体活动工作记录量表'
            },
            {
              name: '2.1.10 家长沟通工作记录量表'
            },
            {
              name: '2.1.11 学生促进学校欺凌防治工作参与抽查表'
            },
            {
              name: '2.2.2 学生沟通工作记录量表'
            },
            {
              name: '2.2.5 操行评价工作记录量表'
            },
            {
              name: '2.2.6 学生参与制止欺凌行为抽查表'
            },
            {
              name: '2.2.8 日常仪容仪表检查工作记录量表'
            },
            {
              name: '2.2.9 情绪预警筛查工作记录量表'
            },
            {
              name: '2.3.4 学生解决同学冲突情况抽查表'
            }
          ],
          shows: false
        }
      ],
      roleMoreDowmShows: false
    }
  },
  created () {
    let that = this
    if (navigator.onLine) {
    } else {
      that.$messageOne({message: '网络异常，请检测网络是否链接！', type: 'error', duration: 3000})
      return
    }
    // 获取页面高度
    var leftNavHeight = document.documentElement.clientHeight - 270
    var addPopHeight = document.documentElement.clientHeight
    that.addRolePopHeight = addPopHeight
    that.roleHeight = leftNavHeight
    that.navRoleHeight = leftNavHeight - 120
    that.roleListFun(1000)
    adminZhiwei(1000).then(res => {
      if (res.code == 10000) {
        that.pooptions = res.data
      } else if (res.code == 10002) {
        that.$router.push({name: 'Login'})
      } else {
        that.$messageOne({message: res.message, type: 'error', duration: 3000})
      }
    }).catch(error => {
      that.$messageOne({message: error, type: 'error', duration: 3000})
    })
    setTimeout(() => {
      let obj = {
        page: 1,
        limit: 100,
        role_id: 'all'
      }
      that.adminFiun(obj)
      that.adimnUserListFun()
    }, 500)
  },
  beforeDestroy () {
    document.removeEventListener('click', this.isClick) // 页面销毁的时候移除事件
  },
  methods: {
    isClick (e) {
      let isSelf = document.getElementById('showBoxId') // 获取dom元素
      if (isSelf) {
        // 判断一下dom元素有没有获取成功
        if (!isSelf.contains(e.target)) {
          // 通过dom元素的contains方法传入目标元素，containsf方法返回一个布尔值
          // 如果点击的是元素本身或者其子元素则返回true，否则返回false
          this.roleMoreDowmShows = false
        }
      }
    },
    weakupPopup () {
      this.roleMoreDowmShows = true
      this.$nextTick(() => {
        // 加个this.$nextTick使dom更新后再执行获取dom的方法(在这里实际上没有用，改获取不到的还是获取不到，但不影响功能)
        document.addEventListener('click', this.isClick, true)
      })
    },
    downCLick (obj) {
      obj.shows = true
    },
    upCLick (obj) {
      obj.shows = false
    },
    editHandle (item) {
      item.shows = false
    },
    saveHandle (item) {
      let that = this
      item.shows = true
      if (item.delivery == false) {
        item.lock = 'lock'
      } else {
        item.lock = 'unlock'
      }
      let zhiwei = item.zhiwei
      item.zhiweiArray = []
      item.zhiwei_id = []
      for (var i = 0; i < zhiwei.length; i++) {
        item.zhiweiArray.push(zhiwei[i].id)
        item.zhiwei_id.push(zhiwei[i].id)
      }
      adminAdminsPut(item).then(res => {
        if (res.code == 10000) {
          item.shows = true
          that.$messageOne({message: '修改成功', type: 'success', duration: 3000})
        } else {
          that.$messageOne({message: res.message, type: 'error', duration: 3000})
        }
      }).catch(error => {
        that.$messageOne({message: error, type: 'error', duration: 3000})
      })
    },
    adimnUserListFun () {
      let that = this
      let objs = {
        page: 1,
        limit: 100,
        role_id: ''
      }
      adminAdminsRoleGetTwe(objs).then(res => {
        if (res.code == 10000) {
          that.userListData = res.data
        } else if (res.code == 10002) {
          that.$router.push({name: 'Login'})
        } else {
          that.$messageOne({message: res.message, type: 'error', duration: 3000})
        }
      }).catch(error => {
        that.$messageOne({message: error, type: 'error', duration: 3000})
      })
    },
    submitUserForm (formName) {
      let that = this
      that.$refs[formName].validate((valid) => {
        if (valid) {
          adminAdmins(that.addUserForm).then(res => {
            if (res.code == 10000) {
              that.addUserForm = {
                name: '',
                gender: 1,
                password: '123@Abc',
                password_confirmation: '123@Abc',
                avatar: '',
                introduction: '',
                username: '',
                phone: '',
                role_id: [],
                popPosiShow: true,
                posiVals: '',
                zhiwei: '',
                roleId: '',
                zhiweiArr: []
              }
              this.addUserShow = true
              that.$messageOne({message: '添加成功！', type: 'success', duration: 3000})
              that.adimnUserListFun()
            } else if (res.code == 10001) {
              that.$messageOne({message: res.errors.name[0], type: 'error', duration: 3000})
            } else {
              that.$messageOne({message: res.message, type: 'error', duration: 3000})
            }
          }).catch(error => {
            that.$messageOne({message: error, type: 'error', duration: 3000})
          })
        }
      })
    },
    resetUserForm () {
      this.addUserShow = true
      this.addUserForm = {
        name: '',
        gender: 1,
        password: '123@Abc',
        password_confirmation: '123@Abc',
        avatar: '',
        introduction: '',
        username: '',
        phone: '',
        role_id: [],
        popPosiShow: true,
        posiVals: '',
        zhiwei: '',
        roleId: '',
        zhiweiArr: []
      }
    },
    // 配置菜单
    handleCheckChange () {
      let zi = this.$refs.tree.getCheckedKeys()// 返回选中子节点的key
      let fu = this.$refs.tree.getHalfCheckedKeys()// 返回选中子节点的父节点的key
      let new1 = zi.concat(fu)
      console.log(new1)
      this.multipleSelection = new1
    },
    popAddHandle () {
      this.addUserForm.popPosiShow = false
    },
    closePopHandle () {
      this.addUserForm.popPosiShow = true
      this.addUserForm.posiVals = ''
    },
    popSaveHandle () {
      let that = this
      let name = that.addUserForm.posiVals
      if (name == '') {
        that.$messageOne({message: '职位名不能为空！', type: 'info', duration: 3000})
        return false
      }
      let obj = {}
      obj.name = name
      adminZhiweiPost(obj).then(res => {
        if (res.code == 10000) {
          let obj = {}
          obj.id = res.id
          obj.name = res.name
          that.pooptions.push(obj)
          that.addUserForm.popPosiShow = true
          that.addUserForm.posiVals = ''
          that.$forceUpdate()
        } else {
          that.$messageOne({message: res.message, type: 'error', duration: 3000})
        }
      }).catch(error => {
        that.$messageOne({message: error, type: 'error', duration: 3000})
      })
    },
    zhiweiAddHandle (value) {
      const selectedObjects = value.map(val => this.pooptions.find(opt => opt.id === val))
      // this.addUserForm.zhiwei = []
      this.addUserForm.zhiwei = ''
      this.addUserForm.zhiwei = selectedObjects
      this.ruleFormCy.zhiwei = selectedObjects
    },
    addUserClickHandle () {
      this.addUserShow = false
    },
    userChanges (e) {
      this.ruleFormCy.zhiwei = e.zhiwei
      this.ruleFormCy.userId = e.id
    },
    adminFiun (objs) {
      let that = this
      adminAdminsRoleGetTwe(objs).then(res => {
        if (res.code == 10000) {
          let datas = res.data
          for (var i = 0; i < datas.length; i++) {
            datas[i].shows = true
            datas[i].posiShow = true
            datas[i].zhiweiArray = []
            datas[i].zhiwei_id = []
            if (datas[i].lock == 'unlock') {
              datas[i].delivery = true
            } else {
              datas[i].delivery = false
            }
          }
          that.roleTableData = datas
        } else {
          that.$messageOne({message: res.message, type: 'error', duration: 3000})
        }
      }).catch(error => {
        that.$messageOne({message: error, type: 'error', duration: 3000})
      })
    },
    roleListFun (objs) {
      let that = this
      adminRole(objs).then(res => {
        if (res.code == 10000) {
          that.roleListDatas = res.data
          let obj = {}
          obj.id = 'all'
          obj.name = '全部'
          that.roleListDatas.unshift(obj)
          that.rightDatas = that.roleListDatas[0]
          that.roleId = that.roleListDatas[0].id
        } else {
          that.$messageOne({message: res.message, type: 'error', duration: 3000})
        }
      }).catch(error => {
        that.$messageOne({message: error, type: 'error', duration: 3000})
      })
    },
    gotoCLick () {
      let that = this
      if (that.addRolePopShow == true) {
        that.$messageOne({message: '请保存数据后在返回！', type: 'error', duration: 3000})
        return
      }
      if (that.addChenyuanPopShow == true) {
        that.$messageOne({message: '请保存数据后在返回！', type: 'error', duration: 3000})
        return
      }
      that.$router.push({name: 'homes'})
    },
    addRoleHandle () {
      this.addRolePopShow = true
      this.addChenyuanPopShow = false
      this.ruleForm.name = ''
    },
    resetForm () {
      this.addRolePopShow = false
    },
    submitForm (formName) {
      let that = this
      let mulitp = that.multipleSelection
      let objs = {}
      objs.name = that.ruleForm.name
      objs.permissions = mulitp
      that.$refs[formName].validate((valid) => {
        if (valid) {
          if (mulitp.length == 0) {
            that.$messageOne({message: '权限不能为空！', type: 'error', duration: 3000})
            return
          }
          if (mulitp.indexOf('basicinfocoll') === -1 || mulitp.indexOf('normalwork') === -1) {
            that.$messageOne({message: '基础信息采集与常态工作采集菜单下级菜单必选其一', type: 'error', duration: 3000})
            return
          }
          adminAdminRolePermission(objs).then(res => {
            if (res.code == 10000) {
              that.roleListFun(1000)
              that.ruleForm.name = ''
              that.addRolePopShow = false
              that.$messageOne({message: '添加成功!', type: 'success', duration: 3000})
            } else {
              that.$messageOne({message: res.message, type: 'error', duration: 3000})
            }
          }).catch(error => {
            that.$messageOne({message: error, type: 'error', duration: 3000})
          })
        }
      })
    },
    addCYHandle () {
      let that = this
      that.addChenyuanPopShow = true
      that.addRolePopShow = false
      that.ruleFormCy.userName = ''
      that.ruleFormCy.role_id = ''
      adminRole(1000).then(res => {
        if (res.code == 10000) {
          that.roleListDatasTwe = res.data
          if (res.data.length > 0) {            
            that.roleId = res.data[0].id
          }
        } else {
          that.$messageOne({message: res.message, type: 'error', duration: 3000})
        }
      }).catch(error => {
        that.$messageOne({message: error, type: 'error', duration: 3000})
      })
    },
    resetCyForm () {
      this.addChenyuanPopShow = false
    },
    submitCyForm () {
      let that = this
      let name = that.ruleFormCy.userId
      let roleid = that.ruleFormCy.role_id
      if (that.ruleFormCy.delivery == true) {
        that.ruleFormCy.lock = 'unlock'
      } else {
        that.ruleFormCy.lock = 'lock'
      }
      if (name == '') {
        that.$messageOne({message: '用户不能为空！', type: 'error', duration: 3000})
        return
      }
      if (roleid == '') {
        that.$messageOne({message: '角色不能为空！', type: 'error', duration: 3000})
        return
      }
      if (that.roleListDatasTwe.length == 0) {
        that.$messageOne({message: '请先添加角色再添加成员！', type: 'error', duration: 3000})
        return
      }
      let objs = {}
      objs.adminid = that.ruleFormCy.userId
      objs.id = that.ruleFormCy.role_id
      objs.lock = that.ruleFormCy.lock
      adminAdminRoleAddPost(objs).then(res => {
        if (res.code == 10000) {
          let obj = {
            page: 1,
            limit: 100,
            role_id: 'all'
          }
          that.roleId = 'all'
          that.adminFiun(obj)
          that.ruleFormCy.userId = ''
          that.ruleFormCy.role_id = ''
          that.ruleFormCy.userName = ''
          that.ruleFormCy.lock = ''
          that.ruleFormCy.delivery = true
          that.addChenyuanPopShow = false
          that.$messageOne({message: '添加成功!', type: 'success', duration: 3000})
        } else {
          that.$messageOne({message: res.message, type: 'error', duration: 3000})
        }
      }).catch(error => {
        that.$messageOne({message: error, type: 'error', duration: 3000})
      })
    },
    roleNavHandle (i, items) {
      let that = this
      that.rightDatas = items
      that.leftNavnum = i
      let obj = {
        page: 1,
        limit: 100,
        role_id: items.id
      }
      that.adminFiun(obj)
    },
    deleteRow (item) {
      let that = this
      that.$confirm('是否要进行解绑?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let objs = {}
        objs.admin_id = item.id
        objs.id = that.roleId
        adminAdminRoleDelPost(objs).then(res => {
          if (res.code == 10000) {
            that.addChenyuanPopShow = false
            that.$messageOne({message: '解绑成功!', type: 'success', duration: 3000})
            let obj = {
              page: 1,
              limit: 100,
              role_id: that.roleId
            }
            that.adminFiun(obj)
            that.$forceUpdate()
          } else {
            that.$messageOne({message: res.message, type: 'error', duration: 3000})
          }
        }).catch(error => {
          that.$messageOne({message: error, type: 'error', duration: 3000})
        })
      }).catch(() => {
        this.$messageOne({message: '已取消解绑!', type: 'info', duration: 3000})
      })
    }
  }
}
</script>
<style scoped>
.roleMain{border-top:1px solid #E6E6E6;position:relative;}
.roleleft{width:276px;height:960px;position:absolute;top:0;left:0;border-right:1px solid #E6E6E6;}
.roleleft .roleleftBox{position:relative;padding:24px 0 24px 24px;height:760px;}
.roleleft .roleNav{overflow:hidden;overflow-y:auto;height:550px;}
.roleTile{height: 28px;font-weight: bold;font-size: 20px;color: #161617;line-height: 28px;margin-bottom:16px;position:relative;}
.roleLi{height: 36px;border-radius: 2px;font-size: 14px;color: #161617;line-height:36px;padding:0 16px;cursor:pointer;}
.roleLi.current{background: #0071DB;color:#fff;}
.addRoleBtn{cursor:pointer;height: 32px;background: #FFFFFF;border-radius: 4px;border: 1px solid #D9D9D9;font-size: 14px;color: #252526;z-index:99;position:absolute;bottom:-10px;left:24px;width:226px;text-align:center;line-height:32px;}
.addRoleBtn .addIcon{background:url('../../assets/icon32.png') no-repeat 0 0/100%;width:12px;height:12px;display:inline-block;margin-right:8px;position:relative;top:1px;}
.roleForm{margin-top:7px;}
.qxSl{overflow:hidden;overflow-y:auto;}
.roleright{margin:24px 20px 0 324px;}
.roleForm >>> .el-tree-node__content{height:36px;line-height:36px;}
.roleForm >>> .el-checkbox__input.is-checked .el-checkbox__inner{background:#5291FF;border:1px solid #0071DB}
.roleForm >>> .el-checkbox__input.is-indeterminate .el-checkbox__inner{background:#5291FF;border:1px solid #0071DB}
.elementUiTable{height:755px;overflow:hidden;overflow-y:auto;}
.elementUiTable >>> .my-header-class{background: #F7F7F7;border-radius: 2px;}
.elementUiTable >>> .el-table__empty-text{background:url('../../assets/icon24.png') no-repeat 0 0/100%;display:inline-block;width:64px;height:88px;margin:20px;text-indent:-9999px;}
.usellistPop{position:relative;}
.userListpopInfo{position:absolute;top:40px;left:0;font-size: 12px;color: #0071DB;line-height: 20px;cursor:pointer;text-decoration: underline;}
.userListpopInfo .icon{width: 16px;height: 16px;background: #e5f0fb;border-radius: 2px;text-align:center;line-height:12px;position:relative;top:3px;display:inline-block;margin-right:4px;overflow:hidden;}
.addUserListPop{margin-top:8px;background: rgba(246,246,246,0.8);padding:16px;border-radius: 2px;width:290px;}
.addRoleUserTitle{font-weight:bold;font-size: 14px;color: #161617;line-height: 22px;}
.eloption{margin:10px 10px 0;}
.eloptionbtn{font-size: 14px;color: #0071DB;text-align: left;font-style: normal;}
.eloptionbtn .elbtn{padding-left:8px;cursor:pointer;}
.addUserListPop .mb20Role{margin-bottom:20px;}
.roleInfoPostxt{line-height:40px;margin-bottom:5px;}
.roleInfoPostxt p{line-height:40px;}
.roleInfoPostxt p.txtLine{line-height:20px;}
.dialogPopRigthMain{height:990px;}
.dialogPopRigth{height:1070px;}
.dialogPopRigthMain >>> .el-switch.is-checked .el-switch__core{background:#67c23a;border:1px solid #67c23a;}
.roleMoreIcon{display:inline-block;background:url('../../assets/icon10.png') no-repeat 0 0/100%;width:16px;height:16px;cursor:pointer;position:relative;top:2px;}
.roleTile .roleMoreDownBox{position:absolute;width: 260px;background: #F7F7F7;border-radius: 2px;height: 570px;padding:16px 0 16px 12px;top:30px;left:85px;z-index:9999;}
.roleTile .roleMoreDownMain{height:550px;overflow:hidden;overflow-y:auto;padding-right:12px;}
.roleMoreBox{margin-bottom:12px;}
.roleMoreDownTil{height: 17px;font-weight: 600;font-size: 12px;color: #595959;line-height: 17px;margin-bottom:8px;}
.roleMoreTils .downIconRole{display:block;float:right;width:20px;height:20px;background:url('../../assets/icon52.png') no-repeat 0 0/100%;cursor:pointer;position:relative;top:6px;}
.roleMoreTils .upIconRole{display:block;float:right;width:20px;height:20px;background:url('../../assets/icon53.png') no-repeat 0 0/100%;cursor:pointer;position:relative;top:6px;}
.roleMoreBox .roleMoreTils{height: 32px;background: #FFFFFF;border-radius: 2px;line-height:32px;padding:0 12px;font-weight: 600;font-size: 12px;color: #161617;margin-bottom:7px;cursor:pointer;}
.roleMoreBox .roleMoreLi{line-height:18px;color: #595959;line-height: 18px;margin-bottom:2px;font-size:12px;padding:0 12px;}
</style>
