<template>
  <div class="app-container">

    <div class="company" v-if="!$store.state.user.tenantId">
      <el-input
        style="width: 200px"
        placeholder="公司名称"
        size="small"
        prefix-icon="el-icon-search"
        v-model="gsInfo.tenantName"
        @keyup.enter.native="getGsInfoList">
      </el-input>
      <div class="cp-content" style="width: 200px">
        <div :class="gsInfo.active_id===item.id?'cp-item active':'cp-item'" @click="changCompany(item.id)" v-for="item in gsInfo.list">{{ item.name }}</div>
      </div>
    </div>

    <div :class="$store.state.user.tenantId?'content-all':'content'">

      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
        <el-form-item label="所属部门" prop="deptName">
          <el-input
            v-model="queryParams.deptName"
            placeholder="请输入员工所属部门"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="员工姓名" prop="name">
          <el-input
            v-model="queryParams.name"
            placeholder="请输入员工姓名"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="性别" prop="sex">
          <el-select v-model="queryParams.sex" placeholder="请选择性别" clearable>
            <el-option
              v-for="dict in dict.type.sys_user_sex"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="休息类型" prop="restType">
          <el-select v-model="queryParams.restType" placeholder="请选择休息类型" clearable>
            <el-option
              v-for="dict in dict.type.pay_work_rest_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="每日应出勤" prop="hoursPerDay">
          <el-input
            v-model="queryParams.hoursPerDay"
            placeholder="请输入每日应出勤小时数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="状态" prop="deleted">
          <el-select v-model="queryParams.deleted" placeholder="请选择">
            <el-option
              v-for="dict in dict.type.pay_del_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>

      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['secure:empinfo:add']"
          >新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            plain
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['secure:empinfo:edit']"
          >修改</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            @click="handleExport"
            v-hasPermi="['secure:empinfo:export']"
          >导出</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-edit"
            size="mini"
            @click="handleEdit"
            v-hasPermi="['pay:employeeInfo:list']"
          >修改每日应出勤小时数</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>

      <el-table v-loading="loading" :data="employeeInfoList" @selection-change="handleSelectionChange" border>
        <el-table-column type="selection" width="55" align="center" fixed min-width="50"/>
        <el-table-column label="员工所属部门" align="center" prop="deptName" :show-overflow-tooltip="true" fixed min-width="120"/>
        <el-table-column label="员工姓名" align="center" prop="name" :show-overflow-tooltip="true" fixed min-width="100"/>
        <el-table-column label="状态" align="center" prop="deleted">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.pay_del_status" :value="scope.row.deleted"/>
          </template>
        </el-table-column>
        <el-table-column label="性别" align="center" prop="sex">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
          </template>
        </el-table-column>
        <el-table-column label="年龄" align="center" prop="age" />
        <el-table-column label="手机号" align="center" prop="phone" min-width="100"/>
        <el-table-column label="身份证号" align="center" prop="idcard" min-width="100" />
        <el-table-column label="银行卡号" align="center" prop="bankCardNumber" min-width="100" />
        <el-table-column label="开户行" align="center" prop="openingBank" min-width="100" />
        <el-table-column label="基本工资" align="center" prop="basicSalary" />
<!--        <el-table-column label="日薪" align="center" prop="daySalary" />-->
<!--        <el-table-column label="时薪" align="center" prop="hourSalary" />-->
        <el-table-column label="休息类型" align="center" prop="restType">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.pay_work_rest_type" :value="scope.row.restType"/>
          </template>
        </el-table-column>
        <el-table-column label="每日应出勤小时数" align="center" prop="hoursPerDay"  min-width="130"/>
        <el-table-column label="工资计算类型" align="center" prop="payCalcType" min-width="110">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.pay_salary_type" :value="scope.row.payCalcType"/>
          </template>
        </el-table-column>
        <el-table-column label="学历" align="center" prop="education" >
          <template slot-scope="scope">
            <dict-tag :options="dict.type.pay_education" :value="scope.row.education"/>
          </template>
        </el-table-column>
        <el-table-column label="家庭住址" align="center" prop="address" />
        <el-table-column label="紧急联系人" align="center" prop="contact" min-width="100"/>
        <el-table-column label="紧急联系人电话" align="center" prop="contactPhone" min-width="120"/>
<!--        <el-table-column label="是否质检" align="center" prop="zhijian">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.pay_yes_no" :value="scope.row.zhijian"/>
          </template>
        </el-table-column>
        <el-table-column label="业务员" align="center" prop="yewu">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.pay_yes_no" :value="scope.row.yewu"/>
          </template>
        </el-table-column>
        <el-table-column label="合同补助开始时间" align="center" prop="htstime" min-width="130">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.htstime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="合同补助结束时间" align="center" prop="htetime" min-width="130">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.htetime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>-->

        <el-table-column label="备注" align="center" prop="remark" min-width="120"/>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['pay:employeeInfo:edit']"
            >修改</el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />

    </div>

    <!-- 添加或修改员工信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="850px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="135px">
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="员工所属部门" prop="deptId" style="height: 35px;">
              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择员工所属部门" @select="changeDept"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工姓名" prop="name">
              <el-input v-model="form.name" placeholder="请输入员工姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="状态" prop="deleted">
              <el-radio-group v-model="form.deleted">
                <el-radio
                  v-for="dict in dict.type.pay_del_status"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="性别" prop="sex">
              <el-select v-model="form.sex" placeholder="请选择性别" style="width: 100%;">
                <el-option
                  v-for="dict in dict.type.sys_user_sex"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="年龄" prop="age">
              <el-input v-model="form.age" placeholder="请输入年龄" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="手机号" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入手机号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="身份证号" prop="idcard">
              <el-input v-model="form.idcard" placeholder="请输入身份证号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="学历" prop="education">
              <el-select v-model="form.education" placeholder="请选择学历" style="width: 100%;">
                <el-option
                  v-for="dict in dict.type.pay_education"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="休息类型" prop="restType">
              <el-select v-model="form.restType" placeholder="请选择休息类型" style="width: 100%;">
                <el-option
                  v-for="dict in dict.type.pay_work_rest_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="每日应出勤" prop="hoursPerDay">
              <el-input v-model="form.hoursPerDay" placeholder="请输入每日应出勤小时数" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="是否质检" prop="zhijian">
              <el-radio-group v-model="form.zhijian">
                <el-radio
                  v-for="dict in dict.type.pay_yes_no"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="银行卡号" prop="bankCardNumber">
              <el-input v-model="form.bankCardNumber" placeholder="请输入银行卡号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="开户行" prop="openingBank">
              <el-input v-model="form.openingBank" placeholder="请输入开户行" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工资计算类型" prop="payCalcType">
              <el-select v-model="form.payCalcType" placeholder="请选择工资计算类型" style="width: 100%;">
                <el-option
                  v-for="dict in dict.type.pay_salary_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="基本工资" prop="basicSalary">
              <el-input v-model="form.basicSalary" placeholder="请输入基本工资" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="家庭住址" prop="address">
              <el-input v-model="form.address" placeholder="请输入家庭住址" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="紧急联系人" prop="contact">
              <el-input v-model="form.contact" placeholder="请输入紧急联系人" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="紧急联系人电话" prop="contactPhone">
              <el-input v-model="form.contactPhone" placeholder="请输入紧急联系人电话" />
            </el-form-item>
          </el-col>

<!--          <el-col :span="12">
            <el-form-item label="日薪" prop="daySalary">
              <el-input v-model="form.daySalary" placeholder="请输入日薪" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="时薪" prop="hourSalary">
              <el-input v-model="form.hourSalary" placeholder="请输入时薪" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="业务员" prop="yewu">
              <el-radio-group v-model="form.yewu">
                <el-radio
                  v-for="dict in dict.type.pay_yes_no"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同补助开始时间" prop="htstime">
              <el-date-picker clearable style="width: 100%;"
                              v-model="form.htstime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择合同补助开始时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同补助结束时间" prop="htetime">
              <el-date-picker clearable style="width: 100%;"
                              v-model="form.htetime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择合同补助结束时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="删除标志" prop="deleted">
              <el-radio-group v-model="form.deleted">
                <el-radio
                  v-for="dict in dict.type.pay_del_status"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>-->
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 添加或修改每日应出勤小时数对话框 -->
    <el-dialog :title="title" :visible.sync="openHour" width="500px" append-to-body :close-on-click-modal="false">
      <el-form ref="formHour" :model="formHour" :rules="hourrules" label-width="162px">
        <el-form-item label="每日应出勤小时数" prop="oldHour">
          <el-input v-model="formHour.oldHour" placeholder="请输入每日应出勤小时数" />
        </el-form-item>
        <el-form-item label="修改每日应出勤小时数" prop="newHour">
          <el-input v-model="formHour.newHour" placeholder="请输入每日应出勤小时数" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormHour">确 定</el-button>
        <el-button @click="cancelHour">取 消</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listEmployeeInfo, getEmployeeInfo, delEmployeeInfo, addEmployeeInfo, updateEmployeeInfo, updateHour } from "@/api/pay/employeeInfo";
import { deptTreeSelect } from "@/api/system/user";
import { listTenant } from "@/api/pay/tenant";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

export default {
  name: "EmployeeInfo",
  components: { Treeselect },
  dicts: ['sys_user_sex', 'pay_salary_type', 'pay_work_rest_type', 'pay_del_status', 'pay_yes_no', 'pay_education'],
  data() {
    return {
      // 公司信息
      gsInfo:{
        tenantName:'',
        active_id:this.$store.state.user.tenantId,
        list:[]
      },
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 员工信息表格数据
      employeeInfoList: [],
      // 部门树选项
      deptOptions: undefined,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        tenantId: undefined,
        userId: undefined,
        deptId: undefined,
        name: undefined,
        sex: undefined,
        age: undefined,
        phone: undefined,
        idcard: undefined,
        bankCardNumber: undefined,
        openingBank: undefined,
        basicSalary: undefined,
        daySalary: undefined,
        hourSalary: undefined,
        restType: undefined,
        hoursPerDay: undefined,
        payCalcType: undefined,
        education: undefined,
        address: undefined,
        contact: undefined,
        contactPhone: undefined,
        zhijian: undefined,
        yewu: undefined,
        htstime: undefined,
        htetime: undefined,
        deleted: undefined,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        deptId: [
          { required: true, message: "员工所属部门不能为空", trigger: "blur" }
        ],
        name: [
          { required: true, message: "员工姓名不能为空", trigger: "blur" }
        ],
        phone: [
          { required: true, message: "手机号不能为空", trigger: "blur" },
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: "请输入正确的手机号码",
            trigger: "blur"
          }
        ],
        basicSalary: [
          { required: true, message: "基本工资不能为空", trigger: "blur" }
        ],
        hoursPerDay: [
          { required: true, message: "每日应出勤小时数不能为空", trigger: "blur" }
        ],
        payCalcType: [
          { required: true, message: "工资计算类型", trigger: "change" }
        ],
      },
      openHour: false,
      formHour: {},
      hourrules: {
        oldHour: [
          { required: true, message: "每日应出勤小时数不能为空", trigger: 'blur'}
        ],
        newHour: [
          { required: true, message: "修改每日应出勤小时数不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    console.log(this.$store.state.user, this.$store.state.user.tenantId);
    if (!this.$store.state.user.tenantId) {
      this.getGsInfoList()
    }else {
      this.gsInfo.active_id = this.$store.state.user.tenantId
      this.getList();
      this.getDeptTree();
    }

    this.roles = sessionStorage.getItem("roles");
  },
  methods: {
    // 获取左侧公司列表
    getGsInfoList(){
      listTenant({ name: this.gsInfo.tenantName }).then(response => {
        if(response.rows.length>0){
          this.gsInfo.list = response.rows;
          this.gsInfo.active_id = this.gsInfo.list[0].id
          this.getList()
          this.getDeptTree();
        }else{
          this.$alert(`没有查到相关公司，暂无数据！`, `提示`, {
            type: 'warning'
          });
        }
      });
    },
    // 选择公司
    changCompany(id){
      this.gsInfo.active_id = id
      this.getList()
      this.getDeptTree();
    },
    /** 查询员工信息列表 */
    getList() {
      this.loading = true;
      this.queryParams.tenantId = this.gsInfo.active_id;
      listEmployeeInfo(this.queryParams).then(response => {
        this.employeeInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
      deptTreeSelect({tenantId: this.gsInfo.active_id}).then(response => {
      // deptTreeSelect().then(response => {
        this.deptOptions = response.data;
      });
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        tenantId: undefined,
        userId: undefined,
        deptId: undefined,
        deptName: undefined,
        name: undefined,
        sex: undefined,
        age: undefined,
        phone: undefined,
        idcard: undefined,
        bankCardNumber: undefined,
        openingBank: undefined,
        basicSalary: undefined,
        daySalary: undefined,
        hourSalary: undefined,
        restType: undefined,
        hoursPerDay: undefined,
        payCalcType: undefined,
        education: undefined,
        address: undefined,
        contact: undefined,
        contactPhone: undefined,
        zhijian: '0',
        yewu: undefined,
        htstime: undefined,
        htetime: undefined,
        deleted: '0',
        createBy: undefined,
        createTime: undefined,
        updateBy: undefined,
        updateTime: undefined,
        remark: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加员工信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.reset();
      const id = row.id || this.ids
      getEmployeeInfo(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.form.zhijian= this.form.zhijian.toString();
        this.form.deleted= this.form.deleted.toString();
        this.open = true;
        this.title = "修改员工信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.tenantId = this.gsInfo.active_id;
          this.buttonLoading = true;
          if (this.form.id != null) {
            updateEmployeeInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addEmployeeInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除员工信息编号为"' + ids + '"的数据项？').then(() => {
        this.loading = true;
        return delEmployeeInfo(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('pay/employeeInfo/export', {
        ...this.queryParams
      }, `employeeInfo_${new Date().getTime()}.xlsx`)
    },
    /** 修改每日应出勤小时数 */
    handleEdit() {
      this.reset();
      this.openHour = true;
      this.title = "修改每日应出勤小时数";
    },
    submitFormHour() {
      this.$refs["formHour"].validate(valid => {
        if (valid) {
          updateHour(this.formHour).then(response => {
            if (response.code === 200) {
              this.$modal.msgSuccess("修改成功");
            }
            this.openHour = false;
            this.getList();
          })
        }
      })
    },
    cancelHour() {
      this.openHour = false;
      this.resetHour();
    },
    resetHour() {
      this.formHour = {
        oldHour: null,
        newHour: null
      }
      this.resetForm("formHour");
    },
    // 选择部门
    changeDept(val){
      this.form.deptId=val.id
      this.form.deptName=val.label
    }
  }
};
</script>

<style scoped lang="scss">
.app-container {
  display: flex;
  .company {
    border-radius: 5px;
    width: 230px;
    height: calc(100vh - 115px);
    overflow-y: auto;
    .cp-content {
      margin-top: 20px;
      .cp-item {
        cursor: pointer;
        padding: 6px 10px 6px 5px;
        color: #424242;
        font-size: 14px;
        &:hover {
          background: #f6f6f6;
        }
      }
      .active{
        background: #edf6ff;
      }
    }
  }
  .content{
    padding-left: 15px;
    width: calc(100% - 250px);
    .el-button--medium {
      padding: 2px 0px;
    }
  }
  .content-all{
    width: 100%;
    .el-button--medium {
      padding: 2px 0px;
    }
  }
}
</style>
