<template>
  <div class="engine flex h-full w-full flex-col">
    <div class="top-box flex justify-between">
      <div class="tab-box flex items-end gap-5">
        <div
          :class="[
            'tab-item',
            'top-radius',
            {
              active: active == 1,
            },
          ]"
          @click="active = 1"
        >
          排队取号系统
        </div>
        <div
          :class="[
            'tab-item',
            'top-radius',
            {
              active: active == 2,
            },
          ]"
          @click="active = 2"
        >
          评价系统
        </div>
      </div>
      <div class="flex gap-5">
        <div class="search-box top-radius flex h-full items-center gap-5">
          <div class="text-[14px] text-[#395EBF]">
            统计时段：2023.08.01~2023.08.17
          </div>
          <el-date-picker
            size="small"
            v-model="value2"
            type="daterange"
            align="right"
            unlink-panels
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :picker-options="pickerOptions"
          >
          </el-date-picker>
          <el-button size="small" type="primary">搜索</el-button>
        </div>
        <div class="engine-btn top-radius">
          <img src="@/assets/img/engine.png" class="engine-img mr-2 w-[24px]" />
          数据搜索引擎
        </div>
      </div>
    </div>
    <div class="main w-full flex-1"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      value2: "",
      active: 1,
    };
  },
};
</script>

<style lang="less" scoped>
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  95% {
    transform: rotate(20turn);
  }

  100% {
    transform: rotate(20turn);
  }
}
.engine {
  position: relative;
}
.top-box {
  width: 100%;
  height: 48px;
  position: relative;
  z-index: 0;
  .top-radius {
    border-radius: 12px 12px 0px 0px;
  }
}
.tab-box {
  .tab-item {
    height: 70%;
    padding: 0px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    cursor: pointer;
  }
  .active {
    height: 100%;
    color: var(--primary);
    font-weight: 600;
  }
}
.search-box {
  background-color: #fff;

  padding: 0px 20px;
}
.engine-btn {
  width: 220px;
  color: #fff;
  background: linear-gradient(
    270deg,
    rgba(139, 87, 249, 1) 0%,
    rgba(5, 149, 253, 1) 100%
  );
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.main {
  background: #fff;
  border-radius: 0px 0px 4px 4px;
  position: relative;
  box-shadow: 0 -0.25rem 0.25rem rgba(204, 204, 204, 0.3);
  z-index: 1000;
}
.engine-img {
  // cubic-bezier(1, 0.05, 0.1, 1)
  animation: rotate 5s cubic-bezier(1, -0.01, 0, 0.85) infinite;
}
</style>
