<template>
  <div class="content-box">
    <div class="left">
      <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
      <span class="cameratxt">校园安全</span>
    </div>
    <div class="scroll">
      <div class="middle">
        <div class="filter">
          <div class="condition">
            <el-input
              :clearable="true"
              @clear="searchBtn"
              v-model="searchInput.keyWord"
              placeholder="请输入地点"
            >
              <template #prefix>
                <el-icon class="el-input__icon"><search /></el-icon>
              </template>
            </el-input>
          </div>
          <el-button
            color="rgba(0, 97, 255, 1)"
            type="primary"
            class="search"
            @click="searchBtn"
          >
            查询</el-button
          >
          <div class="condition">
            <span>状态 :</span>
            <el-select
              v-model="searchInput.status"
              class="m-2"
              placeholder="请选择状态"
              @change="searchBtn"
              style="width: 150px"
            >
              <el-option label="全部" value="" />
              <el-option label="已处理" value="1" />
              <el-option label="未处理" value="0" />
            </el-select>
          </div>
          <div class="condition">
          <span>时间&nbsp;&nbsp;</span>
          <el-date-picker
            v-model="searchInput.createTime"
            type="datetimerange"
            range-separator="-"
            start-placeholder="起始时间"
            end-placeholder="结束时间"
            format="YYYY-MM-DD HH:mm:ss"
            value-format="YYYY-MM-DD HH:mm:ss"
            :prefix-icon="Calendar"
            placeholder="请选择日期"
            style="width: 350px"
            @change="searchBtn"
            :clearable="false"
          />
        </div>
        </div>
        <!-- 按钮列表 -->
        <div class="gongneng">
          <!-- <el-button
            type="primary"
            color="rgba(0, 97, 255, 1)"
            @click="addClick"
            plain
            >新建身份</el-button
          > -->
          <el-button
            type="primary"
            color="rgba(0, 97, 255, 1)"
            @click="importExcel"
            plain
            >导出</el-button
          >
          <el-button
            type="primary"
            color="rgba(0, 97, 255, 1)"
            @click="pushSetting"
            plain
            >推送人设置</el-button
          >
        </div>
      </div>
      <div class="footer" v-loading="loading">
        <el-table
          :row-class-name="tableRowClassName"
          :data="tableData.list"
          @selection-change="handleSelectionChange"
          style="width: 100%"
          :header-cell-style="{
            background: 'rgba(240, 243, 247, 1)',
            height: '50px',
            border: 0,
          }"
        >
          <!-- <el-table-column align="center" type="selection" width="80" /> -->
          <el-table-column
            width="100"
            align="center "
            type="index"
            label="序号"
          />
          <el-table-column align="center" prop="warningName" label="姓名" />
          <el-table-column align="center" prop="type" label="类型" />
          <el-table-column
            align="center"
            width="180"
            prop="location"
            label="地点"
          />
          <el-table-column align="center" prop="img" label="图片">
            <template #default="{ row }">
              <div class="img" v-viewer>
                <img :src="row.image" alt="" />
              </div>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="remark"
            show-overflow-tooltip
            width="220"
            label="备注"
          />
          <el-table-column align="center" prop="status" label="状态">
            <template #default="scope">
              <span v-if="scope.row.statu == 0">未处理</span>
              <span v-if="scope.row.statu == 1">已处理</span>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="createTime"
            width="200"
            label="时间"
          >
            <template #default="{ row }">
              <span>{{
                dayjs(row.createTime).format("YYYY-MM-DD HH:mm:ss")
              }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="操作" width="200">
            <template #default="scope">
              <div class="edit" v-if="scope.row.statu == 0">
                <div class="look" @click="editClick(scope.row)">处理</div>
                <el-popconfirm
                  width="220"
                  confirm-button-text="确认"
                  cancel-button-text="取消"
                  :icon="InfoFilled"
                  icon-color="#f89626"
                  title="是否确认为误报?"
                  @confirm="misinformation(scope.row)"
                  @cancel="cancelEvent"
                >
                  <template #reference>
                    <div class="del">误报</div>
                  </template>
                </el-popconfirm>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>

      <!-- 分页组件 -->
      <div class="pageSize">
        <span></span>
        <el-pagination
          background
          :current-page="currentPage"
          :page-size="pageSize"
          layout="total, prev, pager, next, jumper, slot"
          :total="total"
          @update:current-page="handleCurrentChange"
        />
      </div>

      <!-- 处理按钮 -->
      <el-dialog
        class="editDialog"
        v-model="editVisible"
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        :title="titleDialog"
        align-center
        width="600"
        :before-close="cancelEdit"
      >
        <el-form
          ref="editRef"
          :model="editRuleForm"
          :rules="editRules"
          label-width="60px"
          class="demo-ruleForm"
          :size="formSize"
          label-position="left"
          status-icon
        >
          <el-form-item label="备注 :" prop="remark">
            <el-input
              v-model="editRuleForm.remark"
              :rows="4"
              show-word-limit
              maxlength="100"
              type="textarea"
              placeholder="请输入备注"
            />
          </el-form-item>
          <el-form-item class="options">
            <el-button
              color="rgba(41, 109, 227, 1)"
              class="queding"
              type="primary"
              @click="confirmEdit(editRef)"
            >
              确认
            </el-button>
            <el-button @click="cancelEdit(editRef)">取消</el-button>
          </el-form-item>
        </el-form>
      </el-dialog>
      <!-- 编辑按钮 -->
      <el-dialog
        class="pushSetDialog"
        v-model="pushSetVisible"
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        title="推送人设置"
        align-center
        width="700"
        :before-close="cancelPushSet"
      >
        <div class="tree_pushSet">
          <div class="trees">
            <div class="tree">
              <div class="tree-left">
                <span>{{ pushSetLiCount.length }} / {{ dataLength }}</span>
                <el-input
                  style="margin-left: 5px"
                  v-model.trim="pushSetInput"
                  placeholder="输入名字查询"
                  @input="pushData"
                  :clearable="true"
                />
              </div>
              <el-tree
                :data="pushSetDatas"
                show-checkbox
                class="pushSetTree"
                node-key="id"
                ref="pushSetTree"
                :props="{ label: id, children: children }"
                @check="checkPushSet"
                :default-checked-keys="defaultPushData"
              >
                <template #default="{ node, data }">
                  <span class="custom-tree-node">
                    <span
                      >{{ data.cardNo }}&nbsp;&nbsp; {{ data.name }}&nbsp;&nbsp;
                      {{ data.departmentName }}</span
                    >
                    <!-- <span>
                      <a @click="append(data)"> Append </a>
                      <a style="margin-left: 8px" @click="remove(node, data)">
                        Delete
                      </a>
                    </span> -->
                  </span>
                </template>
              </el-tree>
            </div>
            <div class="tree">
              <div class="tree-left">
                <p style="margin-right: 15px">
                  已选 {{ pushSetLiCount.length }}
                </p>
              </div>
              <ul
                class="infinite-list"
                style="overflow: auto"
                infinite-scroll-immediate="false"
              >
                <li
                  v-for="(i, index) in pushSetLiCount"
                  :key="index"
                  class="infinite-list-item"
                >
                  <span style="margin-left: 19px"
                    >{{ i.cardNo }}&nbsp;&nbsp; {{ i.name }}&nbsp;&nbsp;
                    {{ i.departmentName }}</span
                  >
                  <el-icon @click="cancelLiCheck(i)">
                    <Close />
                  </el-icon>
                  <!-- <i class="el-icon-close" @click="cancelCheck(i)"></i> -->
                </li>
              </ul>
            </div>
          </div>
          <div class="options">
            <el-button
              color="rgba(0, 97, 255, 1)"
              class="queding"
              type="primary"
              @click="affirmPushSet(pushSetTree)"
            >
              确认
            </el-button>
            <el-button @click="cancelPushSet(pushSetTree)">取消</el-button>
          </div>
        </div>
      </el-dialog>
    </div>
    <div class="bgImg" v-if="bgImg">
      <el-carousel
        @click="bgImg = false"
        ref="bgImgs"
        indicator-position
        arrow="always"
        :autoplay="false"
        trigger
      >
        <el-carousel-item>
          <img :src="showImg" alt="" />
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script setup>
import {
  ref,
  reactive,
  watch,
  nextTick,
  onBeforeMount,
  onUnmounted,
} from "vue";
import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { Calendar } from "@element-plus/icons-vue";
import vidiconsApi from "@/api/vidicons.js";
import { dayjs } from "element-plus";
import lodash from "lodash";
import eds from "@/utils/eds.js";
import axios from "axios";
import { useStore } from "vuex";
const store = useStore();
const api = ref("");
const router = useRouter();
// 表格数据
const loading = ref(false);
const tableData = reactive({
  list: [
    {
      userName: "张三",
      type: "越界",
      position: "教学楼",
      img: "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1123%2F77d07411j00r30gwf004dc000go00b4m.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
      remark: "请规范好学生行为",
      status: "已处理",
      time: "2023-12-02 11:05:30",
    },
  ],
});

const searchInput = reactive({
  keyWord: "",
  status: "",
  createTime:[
    dayjs().format("YYYY-MM-DD 00:00:00"),
    dayjs().format("YYYY-MM-DD 23:59:59"),
  ],
}); // 搜索按钮数据

const currentPage = ref(1); // 当前页
const pageSize = ref(7);
const total = ref(7); // 当前总数
const bgImg = ref(false);
const showImg = ref();

// 处理功能
const titleDialog = ref("");
const editVisible = ref(false);
const editRef = ref();
const editRuleForm = reactive({
  remark: "", // 备注
  id: "",
});
// 表单验证
const editRules = reactive({
  remark: [{ required: true, message: "备注不能为空", trigger: "blur" }],
});

// 推送人设置 (----------------------------------------)
const pushSetVisible = ref(false);
const pushSetTree = ref(); // ref
const pushSetInput = ref(); // 搜索
const pushSetCurrentPage = ref(1);
const pushSetPageCount = ref(30);
const pushSetPageTotal = ref(1); // 推送人总共有多少页，由于判断滚动加载是否已全部加载数据
const dataLength = ref(0); // 人员的数量
const pushSetDatas = ref([
  {
    id: 1,
    label: "大床房",
    children: [
      {
        id: 11,
        label: "11",
      },
    ],
  },
]); // 树形数据
// 右边
const pushSetLiCount = ref([]); // 右边li展示的数据
const defaultPushData = ref(); // 默认勾选中的人

// 预警信息分页数据
const getList = async () => {
  loading.value = true;
  let data = {
    currentPage: currentPage.value,
    pageCount: pageSize.value,
    name: searchInput.keyWord, // 地点
    state: searchInput.status, // 状态，0：未处理，1：已处理，不填是全部
    // managerId: sessionStorage.getItem("token"),
  };
  if(searchInput.createTime){
    data.startTime=searchInput.createTime[0]
    data.endTime=searchInput.createTime[1]
  }
  let res = await axios({
    method: "get",
    url: api.value + "/wanzai/api/smartWarning/queryPageSmartWarning",
    headers: {
      token: sessionStorage.getItem("token"),
      user_head: sessionStorage.getItem("userhead"),
    },
    params: data,
  });
  // console.log(
  //   res,
  //   JSON.parse(eds.decryptDes(res.data.data)),
  //   "预警信息分页数据"
  // );
  if (res.data.code == 200) {
    loading.value = false;
    tableData.list = JSON.parse(eds.decryptDes(res.data.data)).list;
    total.value = JSON.parse(eds.decryptDes(res.data.data)).totalCount;
    // 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 editClick = async (row) => {
  titleDialog.value = "处理";
  editRuleForm.remark = "";
  editRuleForm.id = row.id;
  editVisible.value = true;
  //   let data = {
  //     linkId: row.id,
  //   };
  //   let res = await axios({
  //     method: "post",
  //     url: api.value + "/mhotel/uploadgetByLinkId.action",
  //     headers: {
  //   token: sessionStorage.getItem("token"),
  //   user_head: sessionStorage.getItem("userhead"),
  // },
  //     params: data,
  //   });
  //   console.log(res, "编辑中查找图片");
  //   if (res.data.code == 200) {
  //     // res.data.data.fileInfoList.forEach((item) => {
  //     //   item.uid = item.id;
  //     // });
  //     // fileList.list = res.data.data.fileInfoList;
  //     // ruleForm.fileListJson = fileList.list;
  //     res.data.data.forEach((item) => {
  //       item.uid = item.id;
  //     });
  //     fileList.list = res.data.data;
  //     ruleForm.fileListJson = fileList.list;
  //     // ElMessage({
  //     //   type: "success",
  //     //   showClose: true,
  //     //   message: res.data.message,
  //     //   center: true,
  //     // });
  //   } else {
  //     ElMessage({
  //       type: "error",
  //       showClose: true,
  //       message: res.data.message,
  //       center: true,
  //     });
  //   }
};
const confirmEdit = (formEl) => {
  if (!formEl) return;
  formEl.validate(async (valid, fields) => {
    if (valid) {
      let data = {
        remark: editRuleForm.remark,
        id: editRuleForm.id,
      };
      let res = await axios({
        method: "post",
        url: api.value + "/wanzai/api/smartWarning/operation",
        headers: {
          token: sessionStorage.getItem("token"),
          user_head: sessionStorage.getItem("userhead"),
        },
        data: data,
      });
      console.log(res, "处理");
      if (res.data.code == 200) {
        editVisible.value = false;
        getList();
        editRef.value.resetFields();
        ElMessage({
          type: "success",
          showClose: true,
          message: res.data.message,
          center: true,
        });
      } else {
        ElMessage({
          type: "error",
          showClose: true,
          message: res.data.message,
          center: true,
        });
      }
    }
  });
};
const cancelEdit = () => {
  editVisible.value = false;
  editRuleForm.remark = "";
  editRef.value.resetFields();
};
// 误报
const misinformation = async (row) => {
  let data = {
    id: row.id,
  };
  let res = await axios({
    method: "post",
    url: api.value + "/wanzai/api/smartWarning/operation",
    headers: {
      token: sessionStorage.getItem("token"),
      user_head: sessionStorage.getItem("userhead"),
    },
    data: data,
  });
  console.log(res, "处理");
  if (res.data.code == 200) {
    editVisible.value = false;
    getList();
    ElMessage({
      type: "success",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  } else {
    ElMessage({
      type: "error",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  }
};

// 查看图片
const imgClick = (row) => {
  bgImg.value = true;
  showImg.value = row.image;
};
// 推送人设置弹窗 （----------------------------------------------）
const pushSetting = async () => {
  pushSetVisible.value = true;
  pushSetInput.value = "";
  pushData(); // 推送人员数据
  PushedData(); // 已推送人员
  pushDataScroll(); //推送人滚动加载数据
};
// 推送人员数据
const pushData = async () => {
  pushSetCurrentPage.value = 1;

  let data = {
    name: pushSetInput.value,
    currentPage: pushSetCurrentPage.value,
    pageCount: pushSetPageCount.value,
    departmentId: 1, // 部门id
  };
  let res = await axios({
    method: "get",
    url: api.value + "/wanzai/api/smartWarning/warningUserList",
    headers: {
      token: sessionStorage.getItem("token"),
      user_head: sessionStorage.getItem("userhead"),
    },
    params: data,
  });
  console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "推送人");
  if (res.data.code == 200) {
    pushSetDatas.value = JSON.parse(eds.decryptDes(res.data.data)).list;
    dataLength.value = JSON.parse(eds.decryptDes(res.data.data)).totalCount;
    pushSetPageTotal.value = JSON.parse(
      eds.decryptDes(res.data.data)
    ).totalPage;
    // if (pushSetTree.value) {
    //   pushSetTree.value.scrollTop = 0;
    // }

    if (pushSetDatas.value && pushSetLiCount.value) {
      nextTick(() => {
        pushSetTree.value.setCheckedNodes(pushSetLiCount.value);
      });
    }
  } else {
    ElMessage({
      type: "error",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  }
};
// 推送人滚动加载数据
const pushDataScroll = () => {
  nextTick(() => {
    const domElementNode = document.querySelector(".pushSetTree");
    console.log(domElementNode);

    // 注册下拉滚动事件;
    if (domElementNode) {
      domElementNode.addEventListener("scroll", async () => {
        const isBottom =
          domElementNode.scrollHeight - domElementNode.scrollTop <=
          domElementNode.clientHeight;
        if (isBottom) {
          // console.log("触底了");
          if (pushSetCurrentPage.value < pushSetPageTotal.value) {
            pushSetCurrentPage.value++;
            let data = {
              name: pushSetInput.value,
              currentPage: pushSetCurrentPage.value,
              pageCount: pushSetPageCount.value,
              departmentId: 1, // 部门id
            };
            let res = await axios({
              method: "get",
              url: api.value + "/wanzai/api/smartWarning/warningUserList",
              headers: {
                token: sessionStorage.getItem("token"),
                user_head: sessionStorage.getItem("userhead"),
              },
              params: data,
            });
            console.log(
              res,
              JSON.parse(eds.decryptDes(res.data.data)),
              "推送人滚动数据"
            );
            if (res.data.code == 200) {
              pushSetDatas.value = [
                ...pushSetDatas.value,
                ...JSON.parse(eds.decryptDes(res.data.data)).list,
              ];
              nextTick(() => {
                pushSetTree.value.setCheckedNodes(pushSetLiCount.value);
              });
            } else {
              ElMessage({
                type: "error",
                showClose: true,
                message: res.data.message,
                center: true,
              });
            }
          } else {
            console.log("数据全部加载完成");
          }
        }
      });
    }
  });
};

// 已推送人员
const PushedData = async () => {
  let res = await axios({
    method: "get",
    url: api.value + "/wanzai/api/smartWarning/warningPushList",
    headers: {
      token: sessionStorage.getItem("token"),
      user_head: sessionStorage.getItem("userhead"),
    },
  });
  console.log(res, "已推送人员");
  if (res.data.code == 200) {
    pushSetLiCount.value = JSON.parse(eds.decryptDes(res.data.data));
    if (pushSetDatas.value && pushSetLiCount.value) {
      nextTick(() => {
        pushSetTree.value.setCheckedNodes(pushSetLiCount.value);
      });
    }
    // dataLength.value = res.data.data.totalCount;
  } else {
    ElMessage({
      type: "error",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  }
};
// 勾选人员
const checkPushSet = (data, nodes) => {
  console.log(data, nodes);
  console.log(pushSetTree.value.getCheckedNodes());

  let flag = pushSetLiCount.value.some((i) => {
    return data.id == i.id;
  });
  if (flag) {
    pushSetLiCount.value = pushSetLiCount.value.filter((i) => {
      return i.id != data.id;
    });
  }else{
    pushSetLiCount.value.push(data)
  }
};
// 右边叉掉推送人员
const cancelLiCheck = (i) => {
  // console.log(i);
  pushSetLiCount.value = pushSetLiCount.value.filter((item) => {
    return item.id != i.id;
  });
  pushSetTree.value.setCheckedNodes(pushSetLiCount.value);
};

// 确认按钮
const affirmPushSet = async () => {
  if (pushSetLiCount.value.length >= 1) {
    let data = { ids: [] };
    pushSetLiCount.value.forEach((item) => {
      data.ids.push(item.id);
    });
    let res = await axios({
      method: "post",
      url: api.value + "/wanzai/api/smartWarning/warningSavePush",
      headers: {
        token: sessionStorage.getItem("token"),
        user_head: sessionStorage.getItem("userhead"),
      },
      data: data,
    });
    console.log(res, "确认推送");
    if (res.data.code == 200) {
      pushSetVisible.value = false;
      ElMessage({
        type: "success",
        showClose: true,
        message: res.data.message,
        center: true,
      });
    } else {
      ElMessage({
        type: "error",
        showClose: true,
        message: res.data.message,
        center: true,
      });
    }
  } else {
    // ElMessage({
    //   type: "warning",
    //   showClose: true,
    //   message: "推送人不能为空",
    //   center: true,
    // });
    let data = { ids: [0] };
    pushSetLiCount.value.forEach((item) => {
      data.ids.push(item.id);
    });
    let res = await axios({
      method: "post",
      url: api.value + "/wanzai/api/smartWarning/warningSavePush",
      headers: {
        token: sessionStorage.getItem("token"),
        user_head: sessionStorage.getItem("userhead"),
      },
      data: data,
    });
    console.log(res, "确认推送");
    if (res.data.code == 200) {
      pushSetVisible.value = false;
      ElMessage({
        type: "success",
        showClose: true,
        message: res.data.message,
        center: true,
      });
    } else {
      ElMessage({
        type: "error",
        showClose: true,
        message: res.data.message,
        center: true,
      });
    }
  }
};

const cancelPushSet = () => {
  pushSetVisible.value = false;
};

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

// 多选框功能
const handleSelectionChange = (val) => {
  console.log(val);
  selectData.list = val;
};
//导出功能
const importExcel = async () => {
  let data = {
    location: searchInput.keyWord, // 地点
    state: searchInput.status, // 状态，0：未处理，1：已处理，不填是全部
    // managerId: sessionStorage.getItem("token"),
  };
  let res = await axios({
    method: "get",
    url: api.value + "/wanzai/api/smartWarning/excelSmartWarning",
    headers: {
      token: sessionStorage.getItem("token"),
      user_head: sessionStorage.getItem("userhead"),
    },
    params: data,
    responseType: "blob",
  });
  console.log(res, "导出");
  if (res.status == 200) {
    let name = `预警信息`;
    var content = res.data;
    var datas = new Blob([content]);
    var downloadUrl = window.URL.createObjectURL(datas);
    var anchor = document.createElement("a");
    anchor.href = downloadUrl;
    anchor.download = name + ".xlsx";
    anchor.click();
    window.URL.revokeObjectURL(datas);
    ElMessage({
      type: "success",
      showClose: true,
      message: "导出成功",
      center: true,
    });
  } else {
    ElMessage({
      type: "error",
      showClose: true,
      message: res.data.message,
      center: true,
    });
  }
};
// 表格斑马纹颜色修改
const tableRowClassName = ({ row, rowIndex }) => {
  if (rowIndex % 2 === 0) {
    return "even";
  } else if (rowIndex % 2 !== 0) {
    return "odd";
  }
  return "";
};
// 分页
const handleCurrentChange = (value) => {
  // console.log(value);
  currentPage.value = value;
  getList();
};

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

<style scoped lang="scss">
.content-box {
  min-width: 800px;
  width: calc(100vw - 260px);
  height: calc(100vh - 105px);
  border-radius: 8px;
  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;

    margin: 0 30px;
    border-bottom: 1px solid #ccc;
    color: rgb(0, 0, 0);
    font-size: 18px;
    font-weight: 600;

    span {
      display: block;
      line-height: 60px;
      height: 60px;
      margin-right: 20px;
    }

    .is_active {
      color: rgba(111, 182, 184, 1);
    }
  }
  .scroll {
    height: calc(100% - 61px);
    overflow: auto;
  }
  .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;
        margin: 0 40px 0 0;
      }

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

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

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

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

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

    :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: calc(100% - 60px);
    height: calc(100% - 210px);
    margin: 10px auto 20px;

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

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

        tr {
          // color: #000;
        }
      }

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

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

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

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

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

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

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

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

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

      // :deep(.look):hover {
      //   color: red;
      // }
      // :deep(.del):hover {
      //   color: red;
      // }
    }
  }
  // 处理按钮
  :deep(.editDialog) {
    //   height: 420px;
    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 {
      padding: 30px 30px 10px 30px;
      .el-form-item__content {
        width: 200px;
        .el-input-group__append {
          background-color: rgba(222, 234, 252, 1);
          color: rgba(0, 97, 255, 1);
          cursor: pointer;
          user-select: none;
        }
      }
      .options {
        margin: 50px 20px 20px 0;
        width: 100%;
        .el-form-item__content {
          display: flex;
          flex-direction: row-reverse;
        }
        .queding {
          color: #fff;
          margin-left: 15px;
        }
      }
    }
  }
  // 推送人设置
  // 编辑按钮
  :deep(.pushSetDialog) {
    //   height: 420px;
    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 {
      padding: 0 30px 10px 30px;
      .trees {
        display: flex;
        justify-content: center;
        padding: 25px 0;
        // border-bottom: 1px solid rgba(204, 204, 204, 1);
      }

      .tree {
        .tree-left {
          width: 316px;
          height: 44px;
          background: rgba(240, 243, 247, 1);
          border: 1px solid rgba(230, 230, 230, 1);
          box-sizing: border-box;
          display: flex;
          align-items: center;
          justify-content: space-between;
          flex-direction: row-reverse;
        }
      }

      .el-tree {
        width: 316px;
        height: 324px;
        border: 1px solid rgba(230, 230, 230, 1);
        box-sizing: border-box;
        padding-left: 9px;
        overflow: auto;
        .el-tree-node {
          &:nth-child(1) {
            margin-top: 10px;
          }
          margin-bottom: 10px;
          .el-tree-node__content {
            .el-icon {
              display: none;
            }
          }
        }
      }

      ul {
        width: 316px;
        height: 324px;
        list-style: none;
        padding: 0;
        margin: 0;
        border: 1px solid rgba(230, 230, 230, 1);
        box-sizing: border-box;
        overflow: auto;

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

          .el-icon-close {
            cursor: pointer;
            width: 10px;
            height: 10px;
          }
        }
      }

      .options {
        width: 100%;
        display: flex;
        flex-direction: row-reverse;
        padding: 16px 0;

        .queding {
          margin-left: 20px;
          color: #fff;
        }
      }
    }
  }

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

    span {
      color: #000;
    }

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

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

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

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

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

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

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

      :deep(.btn-next) {
        margin-left: 5px;
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        background-color: transparent;
      }
    }
  }
  .bgImg {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 99999999;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);

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

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

        img {
          height: 100%;
        }
      }
    }
  }
}

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