<template>
  <div class="content-box">
    <div class="left">
      <div class="cameratxt">
        <span class="cameratxt">房态管理</span
        ><span
          style="font-size: 13px; color: rgba(51, 51, 51, 1); margin-left: 10px"
        >
          / 共182间</span
        >
      </div>
      <!-- 按钮列表 -->
      <div class="gongneng">
        <el-dropdown>
          <el-button type="primary" color="rgba(41, 109, 227, 1)">
            <span>批量置脏/净</span></el-button
          >
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item @click="clean(1)">批量置脏</el-dropdown-item>
              <el-dropdown-item @click="clean(2)">批量置净</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
        <!-- <el-button type="primary" color="rgba(9, 101, 98, 1)" @click="clean"
          ><el-icon><CirclePlus /></el-icon><span>批量置脏/净</span></el-button
        > -->
        <!-- <el-button type="primary" color="rgba(9, 101, 98, 1)" @click="addlist"
          ><el-icon><CirclePlus /></el-icon><span>批量开/关房</span></el-button
        > -->
        <el-dropdown>
          <el-button type="primary" color="rgba(41, 109, 227, 1)">
            <span>批量开/关房</span></el-button
          >
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item @click="roomClose(1)"
                >批量开房</el-dropdown-item
              >
              <el-dropdown-item @click="roomClose(2)"
                >批量关房</el-dropdown-item
              >
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </div>
    <div>
      <div class="middle">
        <div class="filter">
          <div class="condition">
            <el-input
              :clearable="true"
              @clear="searchBtn"
              v-model="searchInput.keyWord"
              class="w-50 m-2"
              placeholder="请输入姓名或房间号"
              style="width: 230px"
            />
            <el-button
              style="margin-left: 20px"
              color="rgba(41, 109, 227, 1)"
              type="primary"
              class="search"
              @click="searchBtn"
              ><el-icon>
                <Search />
              </el-icon>
              <span>查询</span></el-button
            >
          </div>
          <div class="type">
            <span>房间类型</span>
            <el-select
              style="width: 180px; margin-left: 20px"
              v-model="value"
              class="m-2"
              placeholder="请选择类型"
            >
              <el-option label="全部" value="1" />
              <el-option label="禁用" value="2" />
            </el-select>
          </div>
        </div>
        <div class="changeItems">
          <div
            class="changeItem"
            :class="changeIndex == 1 ? 'changeItem_active' : ''"
            @click="changeItem(1)"
          >
            单日
          </div>
          <div
            class="changeItem"
            :class="changeIndex == 2 ? 'changeItem_active' : ''"
            @click="changeItem(2)"
          >
            日历
          </div>
        </div>
      </div>
      <div class="footer">
        <div class="floor" v-for="item in roomList.list">
          <div class="title">
            <span class="t1">{{ item.title }}</span
            ><span class="t2">{{ item.roomlength }}</span>
          </div>
          <div class="roomList">
            <div class="room" v-for="i in item.children">
              <el-popover
                popper-class="roominfoPopper"
                placement="bottom-start"
                :width="360"
                trigger="click"
                effect="light"
              >
                <!-- :visible="i.visible" -->
                <template #reference>
                  <div @click="itemClick(i)">
                    <div class="roomNum">
                      <span>{{ i.roomNum }}</span>
                      <span class="status">空闲</span>
                    </div>
                    <div class="rLock">房间锁</div>
                    <div class="rLock">
                      <span>水: 25度&nbsp;&nbsp;&nbsp;电: 25度</span>
                    </div>
                    <div class="rLock">
                      <span>退房倒计时: 00:00:24</span>
                      <img
                        src="@/assets/icons/lock.png"
                        alt=""
                        style="width: 20px"
                      />
                    </div>
                  </div>
                </template>
                <div class="roomInfo">
                  <div class="title">
                    <div class="i">{{ item.title }}</div>
                    <div class="setAside">
                      <img src="@/assets/icons/setAside.png" alt="" />
                      <span>置净</span>
                    </div>
                  </div>
                  <div class="content">
                    <div class="lefts">
                      <div>
                        <span>住客 :</span>
                        <span>{{ i.shebei }}</span>
                      </div>
                      <div>
                        <span>入住 :</span>
                        <span>{{ i.wangluo }}</span>
                      </div>
                      <div>
                        <span>离店 :</span>
                        <span>{{ i.wifiMAC }}</span>
                      </div>
                      <div>
                        <span>付款 :</span>
                        <span>{{ i.lanyaMAC }}</span>
                      </div>
                      <div>
                        <span>已住 :</span>
                        <span>{{ i.time }}</span>
                      </div>
                      <div>
                        <span>电表起码 :</span>
                        <span>{{ i.dianliang }}</span>
                      </div>
                      <div>
                        <span>电表止码 :</span>
                        <span>{{ i.statu }}</span>
                      </div>
                      <div>
                        <span>代缴 :</span>
                        <span>{{ i.shebeiStatu }}</span>
                      </div>
                      <div>
                        <span>电量 :</span>
                        <span>{{ i.lastLock }}</span>
                      </div>
                    </div>
                    <div class="rigths">
                      <div @click="forbiddenClick">
                        <img
                          src="@/assets/icons/checkOut.png"
                          style="height: 20px"
                          alt=""
                        />
                        <span>退房</span>
                      </div>
                      <div @click="keyClick">
                        <img src="@/assets/icons/refund.png" alt="" />
                        <span>退款</span>
                      </div>
                      <div @click="roomChangeClick">
                        <img src="@/assets/icons/roomChange.png" alt="" />
                        <span>换房</span>
                      </div>
                      <div @click="unlockingClick">
                        <img src="@/assets/icons/sendPass.png" alt="" />
                        <span>下发密码</span>
                      </div>
                      <div @click="resetPassClick">
                        <img src="@/assets/icons/log.png" alt="" />
                        <span>日志</span>
                      </div>
                      <div class="roomType">
                        <div class="block">
                          <span>全</span>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-popover>
            </div>
          </div>
        </div>
      </div>
      <!-- 批量开/关房 -->
      <el-dialog
        class="roomCloseDilog"
        v-model="roomCloseDialogVisible"
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        :title="roomCloseTitle"
        align-center
        width="700"
        :before-close="cancelRoomClose"
      >
        <div class="first" v-show="firstShow">
          <div class="trees">
            <div class="tree">
              <div class="tree-left">
                <el-checkbox
                  v-model="roomCloseChecked"
                  style="margin-left: 15px"
                  @change="chooseAllRoomClose"
                  >全选</el-checkbox
                >
                <span style="margin-left: 165px"
                  >{{ roomCloseCount.length }} / {{ roomCloseDataLength }}</span
                >
              </div>
              <el-tree
                :data="roomCloseDatas"
                show-checkbox
                node-key="id"
                ref="roomCloseTree"
                :props="defaultProps"
                @check="checkRoomClose"
              ></el-tree>
            </div>
            <div class="tree">
              <div class="tree-left">
                <p style="margin-left: 15px">
                  已选 ( {{ roomCloseCount.length }} )
                </p>
              </div>
              <ul
                class="infinite-list"
                style="overflow: auto"
                infinite-scroll-immediate="false"
              >
                <li
                  v-for="(i, index) in roomCloseCount"
                  :key="index"
                  class="infinite-list-item"
                >
                  <span style="margin-left: 19px">{{ i.label }}</span>
                  <el-icon @click="cancelCheckRoomClose(i)">
                    <Close />
                  </el-icon>
                  <!-- <i class="el-icon-close" @click="cancelCheck(i)"></i> -->
                </li>
              </ul>
            </div>
          </div>
          <div class="options">
            <el-button
              color="rgba(9, 101, 98, 1)"
              class="queding"
              type="primary"
              @click="lastStep"
            >
              下一步
            </el-button>
            <el-button @click="cancelRoomClose(roomCloseTree)">取消</el-button>
          </div>
        </div>
        <div class="last" v-show="lastShow">
          <div class="hint">
            <span>房间转“停用房”或“维修房”后，将会影响入住率</span>
            <el-tooltip
              class="box-item"
              effect="dark"
              content="入住率=间夜量/(总客房数-维修房数-停用房数-链接关房数)"
              placement="top"
            >
              <img src="@/assets/hint.png" alt="" />
            </el-tooltip>
          </div>
          <div class="roomUl">
            <div class="title">房间</div>
            <div class="delRoom">
              <ul>
                <li v-for="i in roomCloseCount">
                  <span>{{ i.label }}</span>
                  <div class="del" @click="closeRoomDel(i)"></div>
                </li>
              </ul>
            </div>
          </div>
          <div class="roomUl roomTime">
            <div class="title">日期</div>
            <div class="delRoom">
              <el-date-picker
                v-model="lastData.createTime"
                type="daterange"
                range-separator="至"
                start-placeholder="起始时间"
                end-placeholder="结束时间"
                format="YYYY-MM-DD"
                value-format="YYYY-MM-DD"
                :prefix-icon="Calendar"
                placeholder="请选择日期"
              />
            </div>
          </div>
          <div class="roomUl" v-if="roomCloseTitle == '批量关房'">
            <div class="title">关房类型</div>
            <div class="delRoom">
              <el-radio-group v-model="lastData.radio">
                <el-radio :label="1">停用房</el-radio>
                <el-radio :label="2">维修房</el-radio>
                <el-radio :label="3">保留房</el-radio>
              </el-radio-group>
            </div>
          </div>
          <div class="roomUl textarea">
            <div class="title">备注</div>
            <div class="delRoom">
              <el-input
                v-model="lastData.textarea"
                :rows="3"
                type="textarea"
                placeholder="请输入内容 (选填)"
              />
            </div>
          </div>
          <div class="options">
            <el-button
              class="queding"
              color="rgba(9, 101, 98, 1)"
              @click="notarizeRoomClose(roomCloseTree)"
              >确认</el-button
            >
            <el-button @click="firstStep"> 上一步 </el-button>
          </div>
        </div>
      </el-dialog>

      <!-- 开/关房 -->
      <el-dialog
        class="roomCloseDilogs"
        v-model="roomCloseOneDialogVisible"
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        title="关房"
        align-center
        width="550"
        :before-close="roomCloseOneTitle"
      >
        <div class="last">
          <div class="hint">
            <span>房间转“停用房”或“维修房”后，将会影响入住率</span>
            <el-tooltip
              class="box-item"
              effect="dark"
              content="入住率=间夜量/(总客房数-维修房数-停用房数-链接关房数)"
              placement="top"
            >
              <img src="@/assets/hint.png" alt="" />
            </el-tooltip>
          </div>
          <!-- <div class="roomUl">
          <div class="title">房间</div>
          <div class="delRoom">
            <ul>
              <li v-for="i in roomCloseCount">
                <span>{{ i.label }}</span>
                <div class="del" @click="closeRoomDel(i)"></div>
              </li>
            </ul>
          </div>
        </div> -->
          <!-- <div class="roomUl roomTime">
          <div class="title">日期</div>
          <div class="delRoom">
            <el-date-picker v-model="lastData.createTime" type="daterange" range-separator="至" start-placeholder="起始时间"
              end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" :prefix-icon="Calendar"
              placeholder="请选择日期" />
          </div>
        </div> -->
          <div class="roomUl">
            <div class="title">关房类型</div>
            <div class="delRoom">
              <el-radio-group v-model="roomcloseForm.radio">
                <el-radio :label="1">停用房</el-radio>
                <el-radio :label="2">维修房</el-radio>
                <el-radio :label="3">保留房</el-radio>
              </el-radio-group>
            </div>
          </div>
          <div class="roomUl textarea">
            <div class="title">备注</div>
            <div class="delRoom">
              <el-input
                v-model="roomcloseForm.textarea"
                :rows="3"
                type="textarea"
                placeholder="请输入内容 (选填)"
              />
            </div>
          </div>
          <div class="options">
            <el-button
              class="queding"
              color="rgba(9, 101, 98, 1)"
              @click="yesCloseRoom"
              >确认</el-button
            >
            <el-button @click="roomCloseOneTitle">取消</el-button>
          </div>
        </div>
      </el-dialog>

      <!-- 换房弹窗 -->
      <el-dialog
        class="roomChangeDialog"
        v-model="roomChangeVisible"
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        title="17栋2单元2层01 今日房价：¥155 - 换房操作"
        align-center
        width="1000"
        :before-close="cancelRoomChange"
      >
        <div class="roomChangeBody">
          <div class="middles">
            <div class="changeItemss">
              <div
                class="changeNews"
                :class="roomChangeIndex == 1 ? 'changeNews_active' : ''"
                @click="changeRoom(1)"
              >
                双床房
              </div>
              <div
                class="changeNews"
                :class="roomChangeIndex == 2 ? 'changeNews_active' : ''"
                @click="changeRoom(2)"
              >
                双床房
              </div>
              <div
                class="changeNews"
                :class="roomChangeIndex == 3 ? 'changeNews_active' : ''"
                @click="changeRoom(3)"
              >
                双床房
              </div>
            </div>
          </div>
          <div class="cards">
            <div class="footers">
              <div class="floor" v-for="item in roomList.list">
                <div class="roomList">
                  <div class="room" v-for="i in item.children">
                    <el-popover
                      popper-class="roominfoPopper"
                      placement="bottom-start"
                      :width="360"
                      trigger="click"
                      effect="light"
                    >
                      <!-- :visible="i.visible" -->
                      <template #reference>
                        <div @click="itemClick(i)">
                          <div class="roomNum">
                            <span>{{ i.roomNum }}</span>
                            <span class="status">空闲</span>
                          </div>
                          <div class="rLock">房间锁</div>
                          <div class="rLock">
                            <span>水: 25度&nbsp;&nbsp;&nbsp;电: 25度</span>
                          </div>
                          <div class="rLock">
                            <span>退房倒计时: 00:00:24</span>
                            <img
                              src="@/assets/icons/lock.png"
                              alt=""
                              style="width: 20px"
                            />
                          </div>
                        </div>
                      </template>
                      <div class="roomInfo">
                        <div class="title">
                          <div class="i">{{ item.title }}</div>
                          <div class="setAside">
                            <img src="@/assets/icons/setAside.png" alt="" />
                            <span>置净</span>
                          </div>
                        </div>
                        <div class="content">
                          <div class="lefts">
                            <div>
                              <span>住客 :</span>
                              <span>{{ i.shebei }}</span>
                            </div>
                            <div>
                              <span>入住 :</span>
                              <span>{{ i.wangluo }}</span>
                            </div>
                            <div>
                              <span>离店 :</span>
                              <span>{{ i.wifiMAC }}</span>
                            </div>
                            <div>
                              <span>付款 :</span>
                              <span>{{ i.lanyaMAC }}</span>
                            </div>
                            <div>
                              <span>已住 :</span>
                              <span>{{ i.time }}</span>
                            </div>
                            <div>
                              <span>电表起码 :</span>
                              <span>{{ i.dianliang }}</span>
                            </div>
                            <div>
                              <span>电表止码 :</span>
                              <span>{{ i.statu }}</span>
                            </div>
                            <div>
                              <span>代缴 :</span>
                              <span>{{ i.shebeiStatu }}</span>
                            </div>
                            <div>
                              <span>电量 :</span>
                              <span>{{ i.lastLock }}</span>
                            </div>
                          </div>
                          <div class="rigths">
                            <div @click="forbiddenClick">
                              <img
                                src="@/assets/icons/checkOut.png"
                                style="height: 20px"
                                alt=""
                              />
                              <span>退房</span>
                            </div>
                            <div @click="keyClick">
                              <img src="@/assets/icons/refund.png" alt="" />
                              <span>退款</span>
                            </div>
                            <div @click="roomChangeClick">
                              <img src="@/assets/icons/roomChange.png" alt="" />
                              <span>换房</span>
                            </div>
                            <div @click="unlockingClick">
                              <img src="@/assets/icons/sendPass.png" alt="" />
                              <span>下发密码</span>
                            </div>
                            <div @click="resetPassClick">
                              <img src="@/assets/icons/log.png" alt="" />
                              <span>日志</span>
                            </div>
                            <div class="roomType">
                              <div class="block">
                                <span>全</span>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </el-popover>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="roomChangeFooter">
          <div class="reason">
            <el-select v-model="value" class="m-2" placeholder="Select">
              <el-option label="全部" value="1" />
              <el-option label="禁用" value="2" />
            </el-select>
            <span class="reason_">换房原因 : </span>
          </div>
          <div class="options">
            <el-button
              color="rgba(41, 109, 227, 1)"
              type="primary"
              @click="submitAdd(ruleFormRef)"
              style="margin-right: 20px"
            >
              确定
            </el-button>
            <el-button @click="cancelRoomChange" style="margin: 0 20px 0 30px"
              >取消</el-button
            >
            <el-input
              clearable
              v-model="value"
              class="w-50 m-2"
              style="width: 80px"
              @blur="timeUpdata"
            />
            <span class="title">新房号 : </span>

            <el-input
              clearable
              v-model="value"
              class="w-50 m-2"
              style="width: 80px"
              @blur="timeUpdata"
            />
            <span class="title">新房价 : </span>
          </div>
        </div>
      </el-dialog>
    </div>
  </div>
</template>

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

const nowDay = ref(dayjs().format("YYYY-MM-DD HH:mm:ss"));

const changeIndex = ref(1);
const changeItem = (flag) => {
  changeIndex.value = flag;
};

// 批量置净脏数据 (------------------------)
const cleanDialogVisible = ref(false);
const roomTree = ref();
const defaultProps = ref({
  label: "label",
  children: "children",
});
const count = ref([]); // 选中的全部数据
const cleanTitle = ref("");
const checked = ref(false);
const datas = ref([
  {
    id: 1,
    label: "大床房",
    children: [
      {
        id: 11,
        label: "11",
      },
      {
        id: 12,
        label: "12",
      },
      {
        id: 13,
        label: "13",
      },
      {
        id: 14,
        label: "14",
      },
    ],
  },
  {
    id: 2,
    label: "圆床房",
    children: [
      {
        id: 21,
        label: "21",
      },
      {
        id: 22,
        label: "22",
      },
      {
        id: 23,
        label: "23",
      },
      {
        id: 24,
        label: "24",
      },
      {
        id: 25,
        label: "25",
      },
      {
        id: 26,
        label: "26",
      },
      {
        id: 27,
        label: "27",
      },
      {
        id: 28,
        label: "28",
      },
    ],
  },
  {
    id: 3,
    label: "双人床",
    children: [
      {
        id: 31,
        label: "31",
      },
      {
        id: 32,
        label: "32",
      },
      {
        id: 33,
        label: "33",
      },
      {
        id: 34,
        label: "34",
      },
      {
        id: 35,
        label: "35",
      },
      {
        id: 36,
        label: "36",
      },
      {
        id: 37,
        label: "37",
      },
      {
        id: 38,
        label: "38",
      },
    ],
  },
]);
const dataLength = ref();

// 批量开关房数据 (------------------------)
const roomCloseDialogVisible = ref(false);
const roomCloseTree = ref();

const roomCloseCount = ref([]); // 选中的全部数据
const roomCloseTitle = ref("");
const roomCloseChecked = ref(false);
const roomCloseDatas = ref([
  {
    id: 1,
    label: "大床房",
    children: [
      {
        id: 11,
        label: "11",
      },
      {
        id: 12,
        label: "12",
      },
      {
        id: 13,
        label: "13",
      },
      {
        id: 14,
        label: "14",
      },
    ],
  },
  {
    id: 2,
    label: "圆床房",
    children: [
      {
        id: 21,
        label: "21",
      },
      {
        id: 22,
        label: "22",
      },
      {
        id: 23,
        label: "23",
      },
      {
        id: 24,
        label: "24",
      },
      {
        id: 25,
        label: "25",
      },
      {
        id: 26,
        label: "26",
      },
      {
        id: 27,
        label: "27",
      },
      {
        id: 28,
        label: "28",
      },
    ],
  },
  {
    id: 3,
    label: "双人床",
    children: [
      {
        id: 31,
        label: "31",
      },
      {
        id: 32,
        label: "32",
      },
      {
        id: 33,
        label: "33",
      },
      {
        id: 34,
        label: "34",
      },
      {
        id: 35,
        label: "35",
      },
      {
        id: 36,
        label: "36",
      },
      {
        id: 37,
        label: "37",
      },
      {
        id: 38,
        label: "38",
      },
    ],
  },
]);
const roomCloseDataLength = ref();
const firstShow = ref(false); // 判断是否为第一步操作
const lastShow = ref(false); // 判断是否为第二步操作
const lastData = ref({
  createTime: "",
  radio: "",
  textarea: "",
});
// 表格数据
const loading = ref(false);
const tableData = reactive({
  list: [
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
    { roomlength: "/ 共3间" },
  ],
});

const searchInput = reactive({
  keyWord: "",
}); // 搜索按钮数据

const roomList = reactive({
  list: [
    {
      title: "17栋1单元2层01房",
      roomlength: "/ 共3间",
      children: [
        {
          roomNum: "18#1单元-2层201",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层202",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层203",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
      ],
    },
    {
      title: "3层",
      roomlength: "/ 共3间",
      children: [
        {
          roomNum: "18#1单元-2层201",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层202",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层203",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
      ],
    },
    {
      title: "4层",
      roomlength: "/ 共3间",
      children: [
        {
          roomNum: "18#1单元-2层201",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层202",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层203",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层204",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
      ],
    },
    {
      title: "5层",
      roomlength: "/ 共3间",
      children: [
        {
          roomNum: "18#1单元-2层201",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层202",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层203",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
        {
          roomNum: "18#1单元-2层204",
          shebei: "L6-VVIFI-QINGKE",
          wangluo: "WIFI",
          wifiMAC: "80A036AE239D",
          lanyaMAC: "F3F401122AF2",
          time: "2023-11-02 15:45:34",
          dianliang: "75%",
          statu: "在线",
          shebeiStatu: "启用",
          lastLock: "2023-11-02 15:45:34",
          visible: false,
        },
      ],
    },
  ],
});

// 设置临时总卡 (头部按钮--------------------------------------------------------）
const temporaryCardVisible = ref(false);
const temporaryCardRef = ref();
const temporaryCardRuleForm = reactive({
  level: 1,
  name: "",
  effectiveTime: "",
  failureTime: "",
  serialNumber: "",
  id: "",
});
var checkFullName = (rule, value, callback) => {
  if (!value) {
    return callback(new Error("请输入姓名"));
  }

  var reg = /^[\u4e00-\u9fa5]{2,6}$/;
  if (!reg.test(value)) {
    callback(new Error("必须为2-6个汉字！"));
  } else {
    callback();
  }
};
// 表单验证
const temporaryCardRules = reactive({
  name: [
    { required: true, message: "姓名不能为空", trigger: "blur" },
    { validator: checkFullName, trigger: "blur" },
  ],
  level: [
    {
      required: true,
      message: "角色不能为空",
      trigger: "blur",
    },
  ],
  effectiveTime: [
    {
      required: true,
      message: "生效时间不能为空",
      trigger: "blur",
    },
  ],
  failureTime: [
    {
      required: true,
      message: "失效时间不能为空",
      trigger: "blur",
    },
  ],
  serialNumber: [
    {
      required: true,
      message: "至少选择一间房",
      trigger: "blur",
    },
  ],
});

// 消息列表弹窗(----------------------------------------------------)
const roomChangeVisible = ref(false);
const roomChangeIndex = ref(1);

// 远程开锁（--------------------------------------------------------）
const unlockingVisible = ref(false);
// 解绑设备 (--------------------------------------------------------）
const deblockingVisible = ref(false);
// 禁用门锁 (--------------------------------------------------------）
const forbiddenVisible = ref(false);
// 重置管理员密码 (--------------------------------------------------------）
const resetPassVisible = ref(false);
const resetPassRef = ref();
const resetPassRuleForm = reactive({
  password: "",
  againPass: "",
  id: "",
});
// 表单验证
const resetPassRules = reactive({
  password: [
    {
      required: true,
      message: "密码不能为空",
      trigger: "blur",
    },
    {
      min: 8,
      max: 20,
      pattern:
        /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\._\+(){}])[0-9a-zA-Z!@#$%^&*,\\._\+(){}]{8,20}$/,
      message: "请输入8-20位正确密码（大小写字母·字符·数字）",
      trigger: "blur",
    },
  ],
  againPass: [
    {
      required: true,
      message: "确认密码不能为空",
      trigger: "blur",
    },
    {
      min: 8,
      max: 20,
      pattern:
        /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\._\+(){}])[0-9a-zA-Z!@#$%^&*,\\._\+(){}]{8,20}$/,
      message: "请输入8-20位正确密码（大小写字母·字符·数字）",
      trigger: "blur",
    },
  ],

  // desc: [{ required: true, message: "Please input activity form", trigger: "blur" }],
});
// 钥匙管理 (--------------------------------------------------------）
const keyVisible = ref(false);
const showBtnList = ref(true); //添加电子钥匙 控制按钮列表的显隐
// 钥匙管理 密码管理(--------------------------------------------------------）
const passManagementVisible = ref(false);
const passManagementIndex = ref(1); // 默认选中 时效密码
const passManagementRef = ref();
const passManagementRuleForm = reactive({
  level: 1,
  name: "",
  effectiveTime: "",
  failureTime: "",
  pass: "",
  id: "",
});
var passManagementName = (rule, value, callback) => {
  if (!value) {
    return callback(new Error("请输入姓名"));
  }

  var reg = /^[\u4e00-\u9fa5]{2,6}$/;
  if (!reg.test(value)) {
    callback(new Error("必须为2-6个汉字！"));
  } else {
    callback();
  }
};
// 表单验证
const passManagementRules = reactive({
  name: [
    { required: true, message: "姓名不能为空", trigger: "blur" },
    { validator: passManagementName, trigger: "blur" },
  ],
  level: [
    {
      required: true,
      message: "角色不能为空",
      trigger: "blur",
    },
  ],
  effectiveTime: [
    {
      required: true,
      message: "生效时间不能为空",
      trigger: "blur",
    },
  ],
  failureTime: [
    {
      required: true,
      message: "失效时间不能为空",
      trigger: "blur",
    },
  ],
  pass: [
    {
      required: true,
      message: "密码不能为空",
      trigger: "blur",
    },
  ],
});

// 钥匙管理 添加指纹(--------------------------------------------------------）
const fingerprintVisible = ref(false);
const fingerprintRef = ref();
const fingerprintRuleForm = reactive({
  level: 1,
  name: "",
  effectiveTime: "",
  failureTime: "",
  id: "",
});
var fingerprintName = (rule, value, callback) => {
  if (!value) {
    return callback(new Error("请输入姓名"));
  }

  var reg = /^[\u4e00-\u9fa5]{2,6}$/;
  if (!reg.test(value)) {
    callback(new Error("必须为2-6个汉字！"));
  } else {
    callback();
  }
};
// 表单验证
const fingerprintRules = reactive({
  name: [
    { required: true, message: "姓名不能为空", trigger: "blur" },
    { validator: fingerprintName, trigger: "blur" },
  ],
  level: [
    {
      required: true,
      message: "角色不能为空",
      trigger: "blur",
    },
  ],
  effectiveTime: [
    {
      required: true,
      message: "生效时间不能为空",
      trigger: "blur",
    },
  ],
  failureTime: [
    {
      required: true,
      message: "失效时间不能为空",
      trigger: "blur",
    },
  ],
});

// 添加指纹弹窗
const addFingerprintVisible = ref(false);
const stepindex = ref(0); // 录取指纹步骤
const step = reactive({
  list: [
    { id: 1, title: "" },
    { id: 2, title: "" },
    { id: 3, title: "" },
    { id: 4, title: "" },
  ],
}); // 指纹步骤数据
const ws = ref("");

// 钥匙管理 添加身份证(--------------------------------------------------------）
const identityCardVisible = ref(false);
const identityCardRef = ref();
const identityCardRuleForm = reactive({
  level: 1,
  name: "",
  effectiveTime: "",
  failureTime: "",
  id: "",
});
var identityCardName = (rule, value, callback) => {
  if (!value) {
    return callback(new Error("请输入姓名"));
  }

  var reg = /^[\u4e00-\u9fa5]{2,6}$/;
  if (!reg.test(value)) {
    callback(new Error("必须为2-6个汉字！"));
  } else {
    callback();
  }
};
// 表单验证
const identityCardRules = reactive({
  name: [
    { required: true, message: "姓名不能为空", trigger: "blur" },
    { validator: identityCardName, trigger: "blur" },
  ],
  level: [
    {
      required: true,
      message: "角色不能为空",
      trigger: "blur",
    },
  ],
  effectiveTime: [
    {
      required: true,
      message: "生效时间不能为空",
      trigger: "blur",
    },
  ],
  failureTime: [
    {
      required: true,
      message: "失效时间不能为空",
      trigger: "blur",
    },
  ],
});
// 添加身份证弹窗
const addIdentityCardVisible = ref(false);
// const wsidentityCard = ref("");
const identityCardTitle = ref("");
// const identityCardNum = ref(""); // 身份证卡号
const identityCardIndex = ref(0); // 读卡步骤

watch(
  () => searchInput.createTime,
  (newVal, oldVal) => {
    console.log("监听时间:", newVal);
    if (newVal == null) {
      getList();
    }
  }
);

// 点击房间查看面板操作
const itemClick = (i) => {
  roomList.list.forEach((item) => {
    item.children.forEach((ii) => {
      ii.visible = false;
    });
  });
  i.visible = true;
  // if (i.visible == true) {
  //   i.visible = false;
  // } else {
  //   i.visible = true;
  // }
};

// 查看员工列表
const getList = async () => {
  loading.value = true;
  let data = {
    page: currentPage.value, // 当前页
    rows: pageSize.value, // 一页数据条数
    ledgerParam: searchInput.keyWord,
    managerId: sessionStorage.getItem("token"),
  };
  if (searchInput.createTime) {
    data.payStartTime = searchInput.createTime[0];
    data.payEndTime = searchInput.createTime[1];
  }

  if (searchInput.status) {
    if (searchInput.status != 0) {
      data.orderStatus = searchInput.status;
    }
  }
  let res = await axios({
    method: "post",
    url: api.value + "/mhotel/bookquearyBookPage.action",
    headers: {
      // token: sessionStorage.getItem("token"),
      // user_head: sessionStorage.getItem("userhead"),
    },
    params: data,
  });
  console.log(res, "用户列表");
  if (res.data.code == 200) {
    loading.value = false;
    // ElMessage({
    //   type: "success",
    //   showClose: true,
    //   message: res.data.message,
    //   center: true,
    // });
  } else {
    loading.value = false;
    ElMessage({
      type: "error",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  }
};

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

// 批量置脏

// 消息列表 (---------------------------------------------------------------)
const roomChangeClick = () => {
  roomChangeVisible.value = true;
};
// 切换消息列表
const changeRoom = (ind) => {
  roomChangeIndex.value = ind;
  if (ind == 1) {
  } else if (ind == 2) {
  }
};
// 关闭弹窗列表
const cancelRoomChange = () => {
  roomChangeVisible.value = false;
};
// 消息列表分页
const newsHandleCurrentChange = (value) => {
  // console.log(value);
  newsPage.value = value;
};

// 远程开锁(-----------------------------------------------------------------)
const unlockingClick = () => {
  unlockingVisible.value = true;
};
const cancelUnlocking = () => {
  unlockingVisible.value = false;
};
// 解绑设备(-----------------------------------------------------------------)
const deblockingClick = () => {
  deblockingVisible.value = true;
};
const cancelDeblocking = () => {
  deblockingVisible.value = false;
};

// 禁用门锁(-----------------------------------------------------------------)
const forbiddenClick = () => {
  forbiddenVisible.value = true;
};
const cancelForbidden = () => {
  forbiddenVisible.value = false;
};
// 重置密码(-----------------------------------------------------------------)
const resetPassClick = () => {
  resetPassVisible.value = true;
};
const cancelResetPass = () => {
  resetPassVisible.value = false;
};
// 钥匙管理(-----------------------------------------------------------------)
const keyClick = () => {
  keyVisible.value = true;
};
const cancelKey = () => {
  keyVisible.value = false;
};
// 钥匙管理 密码管理(-----------------------------------------------------------------)
const passManagementClick = () => {
  passManagementVisible.value = true;
};
const cancelPassManagement = () => {
  passManagementVisible.value = false;
};
// 判断切换  时效密码  无网络密码  临时密码
const passManagementHandleClick = (value) => {
  console.log(value);
  passManagementRef.value.resetFields();
};
// 确定发送
const passManagementSend = (formEl) => {
  if (!formEl) return;
  formEl.validate(async (valid, fields) => {
    if (valid) {
    } else {
      console.log("error submit!", fields);
    }
  });
};

// 钥匙管理 添加指纹(-----------------------------------------------------------------)
const fingerprintClick = () => {
  fingerprintVisible.value = true;
};
const cancelFingerprint = () => {
  fingerprintVisible.value = false;
  fingerprintRef.value.resetFields();
};

// 钥匙管理 添加身份证(-----------------------------------------------------------------)
const identityCardClick = () => {
  identityCardVisible.value = true;
};
const cancelIdentityCard = () => {
  identityCardVisible.value = false;
  identityCardRef.value.resetFields();
};

// 身份证读卡 下一步
const identityCardNext = (formEl) => {
  if (!formEl) return;
  formEl.validate(async (valid, fields) => {
    if (valid) {
      addIdentityCardVisible.value = true;
      // identityCardNum.value = "";
    }
  });
};
const cancelAddIdentityCard = () => {
  addIdentityCardVisible.value = false;
  identityCardIndex.value = 0;
};

//导出功能
const importExcel = lodash.debounce(async () => {
  let data = {
    ledgerParam: searchInput.keyWord,
    managerId: sessionStorage.getItem("token"),
  };
  if (searchInput.createTime) {
    data.payStartTime = searchInput.createTime[0];
    data.payEndTime = searchInput.createTime[1];
  }
  if (searchInput.status) {
    data.orderStatus = searchInput.status;
  }
  let res = await axios({
    method: "post",
    url: api.value + "/mhotel/booktoBookExcel.action",
    headers: {
      // token: sessionStorage.getItem("token"),
    },
    params: data,
  });
  console.log(res, "导出订单管理");
  if (res.data.code == 200) {
    var downloadPath = res.data.downurl;
    // window.open(downloadPath);
    window.location.href = downloadPath;
    var downloadLink = document.createElement("a");
    downloadLink.style.display = "none"; // 使其隐藏
    downloadLink.href = downloadPath;
    downloadLink.download = "";
    downloadLink.click();
    document.body.appendChild(downloadLink);
    document.body.removeChild(downloadLink);
    ElMessage({
      type: "success",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  } else {
    ElMessage({
      type: "error",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  }
}, 1000);

// 表格斑马纹颜色修改
const tableRowClassName = ({ row, rowIndex }) => {
  if (rowIndex % 2 === 0) {
    return "even";
  } else if (rowIndex % 2 !== 0) {
    return "odd";
  }
  return "";
};
// 分页
const handleCurrentChange = (value) => {
  // console.log(value);
  currentPage.value = value;
  getList(changeIndex.value);
};

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

<style scoped lang="scss">
.content-box {
  width: 97.5%;
  height: calc(100vh - 105px);
  margin: 20px auto;
  background-color: #fff;
  color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);

  .left {
    // width: calc(100wh - 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    margin: 0 30px;
    border-bottom: 1px solid #ccc;
    color: rgb(0, 0, 0);
    font-size: 18px;
    font-weight: 600;
    .gongneng {
      .el-dropdown {
        margin-left: 20px;
      }
    }
  }

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

    color: #000;

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

      .search {
        color: #fff;
      }

      .condition {
        display: flex;
        align-items: center;
        margin: 10px 30px 10px 0;
      }
    }
    .changeItems {
      display: flex;
      margin: 5px 0 15px 0;
      .changeItem {
        padding: 0 15px;
        height: 30px;
        background-color: rgba(230, 230, 230, 1);
        text-align: center;
        line-height: 30px;
        font-size: 14px;
        margin-right: 15px;
        border-radius: 3px;
        color: rgba(166, 166, 166, 1);
        cursor: pointer;
      }
      .changeItem_active {
        background-color: rgba(222, 234, 252, 1);
        color: rgba(0, 97, 255, 1);
      }
      .search {
        margin-right: 5px;
      }
    }

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

      span {
        color: #fff;
      }
    }

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

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

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

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

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

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

  .footer {
    width: 96%;
    height: calc(100vh - 308px);
    margin: 10px auto 20px;
    color: #000;
    overflow: auto;
    .floor {
      .title {
        margin: 8px 0;
        .t1 {
          font-weight: 600;
          margin-right: 10px;
        }
        .t2 {
          font-size: 13px;
          color: rgba(102, 102, 102, 1);
        }
      }
      .roomList {
        display: flex;
        flex-wrap: wrap;
        font-size: 14px;

        .room {
          width: 228px;
          height: 140px;
          opacity: 1;
          border-radius: 4px;
          background: rgba(240, 243, 247, 1);
          margin: 5px 18px 18px 0;
          // padding-left: 15px;
          .el-tooltip__trigger {
            height: 100%;
          }
          .roomNum {
            font-size: 16px;
            height: 55px;
            font-weight: 600;
            margin: 0 15px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            .status {
              // background-color: rgba(211, 219, 230, 1);
              background-color: rgba(41, 109, 227, 1);
              color: #fff;
              font-size: 12px;
              padding: 1px 5px;
              border-radius: 2px;
            }
          }
          .rLock {
            font-size: 12px;
            color: #000;
            margin: 0 15px;
            padding: 0 0 5px 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            img {
              cursor: pointer;
            }
          }
          .wifi {
            display: flex;
            align-items: center;
            padding: 10px 0 10px 15px;
            color: rgba(51, 51, 51, 1);
            img {
              width: 14px;
              padding-right: 5px;
            }
          }
        }
      }
    }
  }
  .footer::-webkit-scrollbar-track {
    background-color: #daeeff;
  }

  .footer::-webkit-scrollbar {
    background-color: #0888f8;
    height: 3px;
    width: 4px;
  }

  .footer::-webkit-scrollbar-thumb {
    background: #57b2ff;
    border-radius: 4px;
    height: 3px;
    width: 4px;
  }

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

    span {
      color: #000;
    }

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

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

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

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

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

      :deep(.el-pager li.is-active) {
        background-color: rgba(111, 182, 184, 1);
      }

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

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

.el-input {
  width: 192px;
}

// 弹出的信息框
.roominfoPopper {
  .roomInfo {
    // border: 1px solid red;
    color: #fff;
    font-size: 14px;
    .title {
      font-size: 16px;
      padding: 7.5px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.5);
      display: flex;
      align-items: center;
      .i {
        display: inline-block;
        width: 208px;
      }
      .setAside {
        display: flex;
        align-items: center;
        margin-left: 16px;
        font-size: 14px;
        img {
          width: 16px;
          margin-right: 5px;
        }
      }
    }
    .content {
      display: flex;
      .lefts {
        border-right: 1px solid rgba(255, 255, 255, 0.5);
        span:nth-child(1) {
          text-align: left;
          display: inline-block;
          // width: 72px;
          margin: 5px 15px 5px 0;
        }
        span:nth-child(2) {
          text-align: left;
          display: inline-block;
          // width: 190px;
          padding-right: 20px;
        }
      }
      .rigths {
        // width: 140px;
        margin-left: 15px;
        div {
          display: flex;
          align-items: center;
          height: 33px;
          cursor: pointer;
          img {
            width: 18px;
            height: 18px;
            margin-right: 5px;
          }
          span {
            text-align: left;
            display: inline-block;
          }
          .deblocking {
            transform: translateX(3px);
          }
        }
        .roomType {
          margin: 30px 0 0 15px;
          .block {
            width: 49px;
            height: 49px;
            background-color: #fff;
            border-radius: 50%;
            color: rgba(30, 125, 251, 1);
            font-size: 24px;
            display: flex;
            justify-content: center;
            align-items: center;
          }
        }
      }
    }
  }
}
// 换房弹窗
:deep(.roomChangeDialog) {
  // height: 600px;
  overflow: hidden;
  border-radius: 11px;

  .el-dialog__header {
    border-radius: 11px 11px 0 0;
    background: rgba(237, 241, 245, 1);
    font-weight: 600;
    margin: 0;

    .el-dialog__headerbtn {
      outline: none;
    }
  }

  .el-dialog__body {
    // overflow: auto;
    padding: 10px 20px 10px 20px;

    .roomChangeBody {
      display: flex;
      height: 500px;
      margin-bottom: 50px;
      .middles {
        width: 150px;
        // margin: 0 auto;
        color: #000;
        //   切换  消息记录  操作记录
        .changeItemss {
          // margin: 20px 0;
          width: 130px;
          .changeNews {
            margin: 15px 0;
            height: 40px;
            background-color: rgba(230, 230, 230, 1);
            text-align: center;
            line-height: 40px;
            font-size: 14px;
            border-radius: 3px;
            color: rgba(166, 166, 166, 1);
            cursor: pointer;
          }
          .changeNews_active {
            background-color: rgba(222, 234, 252, 1);
            color: rgba(0, 97, 255, 1);
          }
        }
        // border-bottom: 1px solid rgb(231, 231, 231);
        .filter {
          display: flex;
          flex-wrap: wrap;
          align-items: center;
          margin: 10px 0 0 0;
          justify-content: start;

          .search {
            color: #fff;
          }

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

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

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

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

          span {
            color: #fff;
          }
        }

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

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

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

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

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

        :deep(.cont .accomplish .el-button) {
          width: 50%;
          margin: 0;
        }
      }
      .cards {
        flex: 1;
        overflow: auto;
        margin: 10px 0 0 0;
        .floor {
          .title {
            margin: 8px 0;
            .t1 {
              font-weight: 600;
              margin-right: 10px;
            }
            .t2 {
              font-size: 13px;
              color: rgba(102, 102, 102, 1);
            }
          }
          .roomList {
            display: flex;
            flex-wrap: wrap;
            font-size: 14px;

            .room {
              width: 228px;
              height: 140px;
              opacity: 1;
              border-radius: 4px;
              background: rgba(240, 243, 247, 1);
              margin: 5px 18px 18px 0;
              // padding-left: 15px;
              .el-tooltip__trigger {
                height: 100%;
              }
              .roomNum {
                font-size: 16px;
                height: 55px;
                font-weight: 600;
                margin: 0 15px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                .status {
                  // background-color: rgba(211, 219, 230, 1);
                  background-color: rgba(41, 109, 227, 1);
                  color: #fff;
                  font-size: 12px;
                  padding: 1px 5px;
                  border-radius: 2px;
                }
              }
              .rLock {
                font-size: 12px;
                color: #000;
                margin: 0 15px;
                padding: 0 0 5px 0;
                display: flex;
                align-items: center;
                justify-content: space-between;
                img {
                  cursor: pointer;
                }
              }
              .wifi {
                display: flex;
                align-items: center;
                padding: 10px 0 10px 15px;
                color: rgba(51, 51, 51, 1);
                img {
                  width: 14px;
                  padding-right: 5px;
                }
              }
            }
          }
        }
      }
      .cards::-webkit-scrollbar-track {
        background-color: #daeeff;
      }

      .cards::-webkit-scrollbar {
        background-color: #0888f8;
        height: 3px;
        width: 4px;
      }

      .cards::-webkit-scrollbar-thumb {
        background: #57b2ff;
        border-radius: 4px;
        height: 3px;
        width: 4px;
      }

      .footers {
        width: 96%;
        // height: 402px;
        margin: 0 auto;

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

          .el-table__header-wrapper {
            background-color: #000;
            font-size: 15px;

            tr {
              color: #000;
            }
          }

          .el-table__row {
            height: 50px;
            font-size: 15px;
            color: #000;

            .orderNum {
              color: rgba(111, 182, 184, 1);
              cursor: pointer;
            }
          }

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

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

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

          .el-table__body .even2 {
            background-color: #fff;
          }

          .el-table__body .odd2 {
            background-color: rgba(240, 243, 247, 1);
          }
        }
      }
    }
    .roomChangeFooter {
      height: 150px;
      .reason {
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(230, 230, 230, 1);
        .reason_ {
          color: #000;
          margin-right: 10px;
        }
      }
      .options {
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        margin: 30px 0 0 0;
        .title {
          margin: 0 10px;
        }
      }
    }
  }
}
</style>
<style lang="scss">
.roominfoPopper {
  background: rgba(0, 0, 0, 0.8) !important;
  border: none !important;
  .el-popper__arrow::before {
    background: rgba(0, 0, 0, 0.8) !important;
  }
}
</style>
