<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="100px">
        <el-form-item label="员工姓名" prop="empName">
          <el-input
            v-model="queryParams.empName"
            placeholder="请输入员工姓名"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <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="kaoqinDate">
          <el-date-picker clearable
                          v-model="queryParams.kaoqinDate"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择考勤日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="考勤年份月份" prop="kaoqinYearMonth">
          <el-date-picker
            v-model="queryParams.kaoqinYearMonth"
            type="month"
            size="mini"
            placeholder="请输入考勤年份月份"
            value-format="yyyy-MM">
          </el-date-picker>
        </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="['pay:attendance: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="['pay:attendance:edit']"
          >修改
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            plain
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['pay:attendance:remove']"
          >删除
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="info"
            plain
            icon="el-icon-upload2"
            size="mini"
            @click="handleImport"
            v-hasPermi="['pay:attendance:import']"
          >导入
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            @click="handleExport"
            v-hasPermi="['pay:attendance:export']"
          >导出
          </el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>

      <el-table v-loading="loading" :data="attendanceList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="员工姓名" align="center" prop="empName" />
        <el-table-column label="部门名称" align="center" prop="deptName" />
        <el-table-column label="上午开始时间" align="center" prop="amStartTime" width="180"/>
        <el-table-column label="上午结束时间" align="center" prop="amEndTime" width="180"/>
        <el-table-column label="下午开始时间" align="center" prop="pmStartTime" width="180"/>
        <el-table-column label="下午结束时间" align="center" prop="pmEndTime" width="180"/>
        <el-table-column label="考勤日期" align="center" prop="kaoqinDate" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.kaoqinDate, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="考勤年份月份" align="center" prop="kaoqinYearMonth" />
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['pay:attendance:edit']"
            >修改</el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['pay:attendance:remove']"
            >删除</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="800px" append-to-body :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="员工姓名" prop="empName">
              <el-input placeholder="请选择员工姓名" readonly v-model="form.empName" @focus="selectEmployee">
                <i slot="suffix" class="el-input__icon el-icon-search" style="color:#0f00d1; font-weight: bolder"></i>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="部门名称" prop="deptName">
              <el-input hidden v-model="form.deptName" placeholder="请输入部门名称" :disabled="true"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="考勤年份月份" prop="kaoqinYearMonth">
              <el-date-picker style="width: 100%;"
                v-model="form.kaoqinYearMonth"
                type="month"
                placeholder="请输入考勤年份月份"
                value-format="yyyy-MM">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="考勤日期" prop="kaoqinDate">
              <el-date-picker clearable style="width: 100%;"
                              v-model="form.kaoqinDate"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择考勤日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="上午开始时间" prop="amStartTime1">
              <el-time-picker v-model="form.amStartTime1" style="width: 100%;" value-format="HH:mm" format="HH:mm" placeholder="上午开始时间"></el-time-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="上午结束时间" prop="amEndTime1">
              <el-time-picker v-model="form.amEndTime1" style="width: 100%;" value-format="HH:mm" format="HH:mm" placeholder="上午结束时间"></el-time-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="下午开始时间" prop="pmStartTime1">
              <el-time-picker v-model="form.pmStartTime1" style="width: 100%;" value-format="HH:mm" format="HH:mm" placeholder="下午开始时间"></el-time-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="下午结束时间" prop="pmEndTime1">
              <el-time-picker v-model="form.pmEndTime1" style="width: 100%;" value-format="HH:mm" format="HH:mm" placeholder="下午结束时间"></el-time-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 选择员工信息 -->
    <el-dialog title="双击选择员工信息" :visible.sync="emp.open" width="900px" append-to-body top="6vh">
      <div>
        <el-form :model="emp.queryParams" :inline="true" label-width="70px">
          <el-form-item label="员工名称" prop="name" style="margin-bottom: 10px">
            <el-input
              v-model="emp.queryParams.name"
              placeholder="请输入员工名称"
              clearablesize="small"
              @keyup.enter.native="empQuery"
            />
          </el-form-item>
          <el-form-item style="margin-bottom: 10px">
            <el-button type="primary" icon="el-icon-search" size="small" @click="empQuery">搜索</el-button>
          </el-form-item>
        </el-form>

        <el-table border v-loading="emp.loading" :data="emp.list" @row-dblclick="empRowChange">
          <el-table-column label="员工姓名" align="center" prop="name" :show-overflow-tooltip="true" min-width="120"/>
          <el-table-column label="所属部门" align="center" prop="deptName" :show-overflow-tooltip="true" min-width="120"/>
          <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>

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

        <div slot="footer" class="dialog-footer">
          <el-button @click="empCancel">取 消</el-button>
        </div>
      </div>

    </el-dialog>

    <!-- 考勤导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body :close-on-click-modal="false">
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport + '&date=' + upload.date + '&kaoqinType=' + upload.kaoqinType+ '&tenantId=' + upload.tenantId"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <div class="el-upload__tip" slot="tip">
            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的考勤数据
          </div>
          <span>仅允许导入xls、xlsx格式文件。</span>
          <div class="el-upload__date">
            <span>请选择考勤月份：</span>
            <el-date-picker
              v-model="upload.date"
              type="month"
              size="mini"
              placeholder="选择月"
              value-format="yyyy-MM"
              style="width:40%;">
            </el-date-picker>
          </div>
          <div class="el-upload__date">
            <span>请选择考勤设备：</span>
            <el-select v-model="upload.kaoqinType" placeholder="请选择" clearable size="mini" style="width: 40%">
              <el-option
                v-for="item in upload.options"
                :key="item.kaoqinType"
                :label="item.facilities"
                :value="item.kaoqinType">
              </el-option>
            </el-select>
          </div>
          <!-- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link> -->
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listAttendance, getAttendance, delAttendance, addAttendance, updateAttendance } from "@/api/pay/attendance";
import { listEmployeeInfo } from "@/api/pay/employeeInfo";
import { listTenant } from "@/api/pay/tenant";
import { getToken } from "@/utils/auth";

export default {
  name: "Attendance",
  dicts: ['sys_user_sex', 'pay_del_status'],
  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,
      // 考勤表格数据
      attendanceList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 员工列表
      employeeList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        tenantId: undefined,
        employeeId: undefined,
        empName: undefined,
        deptName: undefined,
        deptId: undefined,
        amStartTime: undefined,
        amEndTime: undefined,
        pmStartTime: undefined,
        pmEndTime: undefined,
        kaoqinDate: undefined,
        kaoqinYearMonth: undefined,
        kaoqinjiNum: undefined
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        empName: [
          { required: true, message: "员工姓名不能为空", trigger: "blur" }
        ],
        deptId: [
          { required: true, message: "部门名称不能为空", trigger: "blur" }
        ],
        kaoqinDate: [
          { required: true, message: "考勤日期不能为空", trigger: "blur" }
        ],
        kaoqinYearMonth: [
          { required: true, message: "考勤年份月份 (yyyy-MM)不能为空", trigger: "blur" }
        ]
      },
      // 考勤导入参数
      upload: {
        // 是否显示弹出层（考勤导入）
        open: false,
        // 弹出层标题（考勤导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的考勤数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/pay/attendance/import",
        date: "",
        options: [{
          kaoqinType: '0',
          facilities: '综合办'
        },{
          kaoqinType: '1',
          facilities: '网机'
        },{
          kaoqinType: '2',
          facilities: '围栏'
        }],
        kaoqinType: '',
        tenantId: '',
      },
      /** 选择员工*/
      emp: {
        // 是否显示弹出层
        open: false,
        // 列表遮罩层
        loading: true,
        // 列表查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          name: undefined
        },
        // 表格数据
        list: [],
        // 总条数
        total: 0,
      },
    };
  },
  created() {
    if (!this.$store.state.user.tenantId) {
      this.getGsInfoList()
    }else {
      this.gsInfo.active_id = this.$store.state.user.tenantId
      this.getList()
    }
  },
  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()
        }else{
          this.$alert(`没有查到相关公司，暂无数据！`, `提示`, {
            type: 'warning'
          });
        }
      });
    },
    // 选择公司
    changCompany(id){
      this.gsInfo.active_id = id
      this.getList()
    },
    /** 查询考勤列表 */
    getList() {
      this.loading = true;
      this.queryParams.tenantId = this.gsInfo.active_id;
      listAttendance(this.queryParams).then(response => {
        this.attendanceList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        tenantId: undefined,
        employeeId: undefined,
        empName: undefined,
        deptName: undefined,
        deptId: undefined,
        amStartTime: undefined,
        amStartTime1: undefined,
        amEndTime1: undefined,
        amEndTime: undefined,
        pmStartTime: undefined,
        pmStartTime1: undefined,
        pmEndTime: undefined,
        pmEndTime1: undefined,
        kaoqinDate: undefined,
        kaoqinYearMonth: undefined,
        kaoqinjiNum: 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
      getAttendance(id).then(response => {
        this.loading = false;
        this.form = response.data;

        if(this.form.amStartTime == null){
          this.$set(this.form,"amStartTime1",null);
        }else{
          var asth = new Date(this.form.amStartTime).getHours();
          asth = asth < 10 ?  asth : asth;
          var astm = new Date(this.form.amStartTime).getMinutes();
          astm = astm < 10 ? '0' + astm : astm;
          this.$set(this.form,"amStartTime1",asth+":"+astm);
        }

        if(this.form.amEndTime == null){
          this.$set(this.form,"amEndTime1",null);
        }else{
          var aeth = new Date(this.form.amEndTime).getHours();
          aeth = aeth < 10 ?  aeth : aeth;
          var aetm = new Date(this.form.amEndTime).getMinutes();
          aetm = aetm < 10 ? '0' + aetm : aetm;
          this.$set(this.form,"amEndTime1",aeth+":"+aetm);
        }

        if(this.form.pmStartTime == null){
          this.$set(this.form,"pmStartTime1",null);
        }else{
          var psth = new Date(this.form.pmStartTime).getHours();
          psth = psth < 10 ?  psth : psth;
          var pstm = new Date(this.form.pmStartTime).getMinutes();
          pstm = pstm < 10 ? '0' + pstm : pstm;
          this.$set(this.form,"pmStartTime1",psth+":"+pstm);
        }
        if(this.form.pmEndTime == null){
          this.$set(this.form,"pmEndTime1",null);
        }else{
          var peth = new Date(this.form.pmEndTime).getHours();
          peth = peth < 10 ?  peth : peth;
          var petm = new Date(this.form.pmEndTime).getMinutes();
          petm = petm < 10 ? '0' + petm : petm;
          this.$set(this.form,"pmEndTime1",peth+":"+petm);
        }

        this.open = true;
        this.title = "修改考勤";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.tenantId = this.gsInfo.active_id;
          this.buttonLoading = true;
          var isTime = true;
          if(this.form.amStartTime1!==null){
            this.form.amStartTime = this.form.kaoqinDate + ' ' + this.form.amStartTime1 + ':00';
          }
          if(this.form.amEndTime1!==null){
            this.form.amEndTime = this.form.kaoqinDate + ' ' + this.form.amEndTime1 + ':00';
          }
          if(this.form.pmStartTime1!==null){
            this.form.pmStartTime = this.form.kaoqinDate + ' ' + this.form.pmStartTime1 + ':00';
          }
          if(this.form.pmEndTime1!==null){
            this.form.pmEndTime = this.form.kaoqinDate + ' ' + this.form.pmEndTime1 + ':00';
          }
          if (new Date(this.form.amEndTime).getTime() < new Date(this.form.amStartTime).getTime()) {
            isTime = false
            this.$alert('上午结束时间应大于上午开始时间', '信息', {
              confirmButtonText: '确定',
              customClass: 'message_box_alert'
            }).catch((err) => {
              console.log(err)
            })
          }
          if(new Date(this.form.pmEndTime).getTime() < new Date(this.form.pmStartTime).getTime()){
            isTime = false
            this.$alert('上午结束时间应大于上午开始时间', '信息', {
              confirmButtonText: '确定',
              customClass: 'message_box_alert'
            }).catch((err) => {
              console.log(err)
            })
          }

          if (this.form.id != null) {
            updateAttendance(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addAttendance(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 delAttendance(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('pay/attendance/export', {
        ...this.queryParams
      }, `attendance_${new Date().getTime()}.xlsx`)
    },
    // 选择员工
    selectEmployee(){
      this.emp.open = true;
      this.emp.queryParams.pageNum = 1;
      this.empQuery();
    },
    /** 员工列表查询 */
    empQuery() {
      this.emp.loading = true;
      this.emp.queryParams.tenantId = this.gsInfo.active_id
      listEmployeeInfo(this.emp.queryParams).then(response => {
        this.emp.list = response.rows;
        this.emp.total = response.total;
        this.emp.loading = false;
      });
    },
    /** 员工选择弹出框关闭*/
    empCancel() {
      this.emp.open = false
    },
    // 客户选择 选中数据
    empRowChange(val) {
      this.form.employeeId = val.id;
      this.form.empName = val.name;
      this.form.deptId = val.deptId;
      this.form.deptName = val.deptName;
      this.emp.open = false;
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "考勤导入";
      this.upload.open = true;
      this.upload.tenantId = this.gsInfo.active_id;
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
      this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
      this.getList();
      this.$loading().close();
    },
    // 提交上传文件
    submitFileForm() {
      if (this.isEmpty(this.upload.date)) {
        this.$alert('请选择考勤月份', '信息', {
          confirmButtonText: '确定',
          customClass:'message_box_alert'
        }).catch((err) => {
          console.log(err)
        })
      } else if (this.isEmpty(this.upload.kaoqinType)) {
        this.$alert('请选择考勤设备', '信息', {
          confirmButtonText: '确定',
          customClass:'message_box_alert'
        }).catch((err) => {
          console.log(err)
        })
      } else {
        this.$refs.upload.submit();
      }
    },
    //判断字符是否为空的方法
    isEmpty(obj) {
      if (typeof obj == "undefined" || obj == null || obj == "" || obj.length ==0) {
        return true;
      } else {
        return false;
      }
    }
  }
};
</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>
