<template>
  <!--  BEGIN MAIN CONTAINER  -->
  <!-- <div>112</div> -->
  <div class="relative">
    <!-- sidebar menu overlay -->
    <div class="fixed inset-0 bg-[black]/60 z-50 lg:hidden" :class="{ hidden: !store.state.sidebar }" @click="toggleSidebar"></div>

    <!-- screen loader -->
    <div
      v-show="store.state.isShowMainLoader"
      class="screen_loader fixed inset-0 bg-[#fafafa] dark:bg-[#060818] z-[60] grid place-content-center animate__animated"
    >
      <svg width="64" height="64" viewBox="0 0 135 135" xmlns="http://www.w3.org/2000/svg" fill="#4361ee">
        <path
          d="M67.447 58c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10zm9.448 9.447c0 5.523 4.477 10 10 10 5.522 0 10-4.477 10-10s-4.478-10-10-10c-5.523 0-10 4.477-10 10zm-9.448 9.448c-5.523 0-10 4.477-10 10 0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10zM58 67.447c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10z"
        >
          <animateTransform attributeName="transform" type="rotate" from="0 67 67" to="-360 67 67" dur="2.5s" repeatCount="indefinite" />
        </path>
        <path
          d="M28.19 40.31c6.627 0 12-5.374 12-12 0-6.628-5.373-12-12-12-6.628 0-12 5.372-12 12 0 6.626 5.372 12 12 12zm30.72-19.825c4.686 4.687 12.284 4.687 16.97 0 4.686-4.686 4.686-12.284 0-16.97-4.686-4.687-12.284-4.687-16.97 0-4.687 4.686-4.687 12.284 0 16.97zm35.74 7.705c0 6.627 5.37 12 12 12 6.626 0 12-5.373 12-12 0-6.628-5.374-12-12-12-6.63 0-12 5.372-12 12zm19.822 30.72c-4.686 4.686-4.686 12.284 0 16.97 4.687 4.686 12.285 4.686 16.97 0 4.687-4.686 4.687-12.284 0-16.97-4.685-4.687-12.283-4.687-16.97 0zm-7.704 35.74c-6.627 0-12 5.37-12 12 0 6.626 5.373 12 12 12s12-5.374 12-12c0-6.63-5.373-12-12-12zm-30.72 19.822c-4.686-4.686-12.284-4.686-16.97 0-4.686 4.687-4.686 12.285 0 16.97 4.686 4.687 12.284 4.687 16.97 0 4.687-4.685 4.687-12.283 0-16.97zm-35.74-7.704c0-6.627-5.372-12-12-12-6.626 0-12 5.373-12 12s5.374 12 12 12c6.628 0 12-5.373 12-12zm-19.823-30.72c4.687-4.686 4.687-12.284 0-16.97-4.686-4.686-12.284-4.686-16.97 0-4.687 4.686-4.687 12.284 0 16.97 4.686 4.687 12.284 4.687 16.97 0z"
        >
          <animateTransform attributeName="transform" type="rotate" from="0 67 67" to="360 67 67" dur="8s" repeatCount="indefinite" />
        </path>
      </svg>
    </div>

    <div class="fixed bottom-6 ltr:right-6 rtl:left-6 z-50">
      <template v-if="showTopButton">
        <button
          type="button"
          class="btn btn-outline-primary rounded-full p-2 animate-pulse bg-[#fafafa] dark:bg-[#060818] dark:hover:bg-primary"
          @click="goToTop"
        >
          <svg width="24" height="24" class="h-4 w-4" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path
              opacity="0.5"
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M12 20.75C12.4142 20.75 12.75 20.4142 12.75 20L12.75 10.75L11.25 10.75L11.25 20C11.25 20.4142 11.5858 20.75 12 20.75Z"
              fill="currentColor"
            />
            <path
              d="M6.00002 10.75C5.69667 10.75 5.4232 10.5673 5.30711 10.287C5.19103 10.0068 5.25519 9.68417 5.46969 9.46967L11.4697 3.46967C11.6103 3.32902 11.8011 3.25 12 3.25C12.1989 3.25 12.3897 3.32902 12.5304 3.46967L18.5304 9.46967C18.7449 9.68417 18.809 10.0068 18.6929 10.287C18.5768 10.5673 18.3034 10.75 18 10.75L6.00002 10.75Z"
              fill="currentColor"
            />
          </svg>
        </button>
      </template>
    </div>

    <!-- BEGIN APP SETTING LAUNCHER -->
    <!--  <Setting /> -->
    <!-- END APP SETTING LAUNCHER -->

    <div class="main-container text-black dark:text-white-dark min-h-screen" :class="[store.state.navbar]">
      <!--  BEGIN SIDEBAR  -->
      <Sidebar />
      <!--  END SIDEBAR  -->

      <div class="main-content flex flex-col min-h-screen">
        <!--  BEGIN TOP NAVBAR  -->
        <Header />
        <!--  END TOP NAVBAR  -->

        <!--  BEGIN CONTENT AREA  -->
        <div class="p-4 animation" :class="sidebarShow ? 'ml-56' : 'ml-0'">
          <!--  -->
          <!--侧边栏 -->
          <div :class="{ 'dark text-white-dark': store.state.semidark }">
            <!-- z-50 top-32 :class="sidebarShow ? '!left-0' : ''"-->
            <nav
              class="sidebar fixed min-h-screen h-full bottom-0 w-[228px] shadow-[5px_0_25px_0_rgba(94,92,154,0.1)] transition-all duration-300"
              :class="sidebarShow ? '!left-0' : ''"
              style="top: 105px"
            >
              <!-- mt-5 -->
              <div class="bg-white dark:bg-[#0e1726] h-full">
                <div class="flex justify-between items-center px-2 py-1"></div>
                <perfect-scrollbar
                  v-if="superMenu == 'super'"
                  :options="{
                    swipeEasing: true,
                    wheelPropagation: false,
                  }"
                  class="h-[calc(100vh-80px)] relative"
                >
                  <ul class="relative font-semibold space-y-0.5 p-4 py-0">
                    <li class="menu nav-item">
                      <button
                        type="button"
                        class="nav-link group w-full"
                        :class="{ active: activeDropdown === 'package' }"
                        @click="activeDropdown === 'package' ? (activeDropdown = null) : (activeDropdown = 'package')"
                      >
                        <div class="flex items-center">
                          <icon-menu-users class="group-hover:!text-primary shrink-0" />

                          <span class="ltr:pl-3 rtl:pr-3 text-black dark:text-[#506690] dark:group-hover:text-white-dark">{{ $t('package') }}</span>
                        </div>
                        <div :class="{ 'rtl:rotate-90 -rotate-90': activeDropdown == 'package' }">
                          <icon-caret-down />
                        </div>
                      </button>
                      <vue-collapsible :isOpen="activeDropdown === 'package'">
                        <ul class="sub-menu text-gray-500">
                          <li>
                            <router-link to="/package/packageList" @click="toggleMobileMenu">{{ $t('packageList') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/package/packagePermissions" @click="toggleMobileMenu">{{ $t('packagePermissions') }}</router-link>
                          </li>
                        </ul>
                      </vue-collapsible>
                      <vue-collapsible :isOpen="activeDropdown === 'package'">
                        <ul class="sub-menu text-gray-500"></ul>
                      </vue-collapsible>
                    </li>
                    <li class="menu nav-item">
                      <button
                        type="button"
                        class="nav-link group w-full"
                        :class="{ active: activeDropdown === 'templateManage' }"
                        @click="activeDropdown === 'templateManage' ? (activeDropdown = null) : (activeDropdown = 'templateManage')"
                      >
                        <div class="flex items-center">
                          <icon-menu-users class="group-hover:!text-primary shrink-0" />

                          <span class="ltr:pl-3 rtl:pr-3 text-black dark:text-[#506690] dark:group-hover:text-white-dark">{{ $t('templateManage') }}</span>
                        </div>
                        <div :class="{ 'rtl:rotate-90 -rotate-90': activeDropdown == 'templateManage' }">
                          <icon-caret-down />
                        </div>
                      </button>
                      <vue-collapsible :isOpen="activeDropdown === 'templateManage'">
                        <ul class="sub-menu text-gray-500">
                          <li>
                            <router-link to="/templateManage/smsTemplate" @click="toggleMobileMenu">{{ $t('smsTemplate') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/templateManage/emailtemplate" @click="toggleMobileMenu">{{ $t('emailtemplate') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/templateManage/accountTemplate" @click="toggleMobileMenu">{{ $t('accountTemplate') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/templateManage/systemMessage" @click="toggleMobileMenu">{{ $t('systemMessage') }}</router-link>
                          </li>
                        </ul>
                      </vue-collapsible>
                      <vue-collapsible :isOpen="activeDropdown === 'package'">
                        <ul class="sub-menu text-gray-500"></ul>
                      </vue-collapsible>
                    </li>
                    <li class="menu nav-item">
                      <button
                        type="button"
                        class="nav-link group w-full"
                        :class="{ active: activeDropdown === 'users' }"
                        @click="activeDropdown === 'users' ? (activeDropdown = null) : (activeDropdown = 'users')"
                      >
                        <div class="flex items-center">
                          <icon-menu-users class="group-hover:!text-primary shrink-0" />

                          <span class="ltr:pl-3 rtl:pr-3 text-black dark:text-[#506690] dark:group-hover:text-white-dark">{{ $t('setting') }}</span>
                        </div>
                        <div :class="{ 'rtl:rotate-90 -rotate-90': activeDropdown == 'users' }">
                          <icon-caret-down />
                        </div>
                      </button>
                      <vue-collapsible :isOpen="activeDropdown === 'users'">
                        <ul class="sub-menu text-gray-500">
                          <li>
                            <router-link to="/setting/companyList" @click="toggleMobileMenu">{{ $t('companyList') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/setting/dicData" @click="toggleMobileMenu">{{ $t('dicData') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/setting/menuManage" @click="toggleMobileMenu">{{ $t('menuManage') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/setting/express" @click="toggleMobileMenu">{{ $t('express') }}</router-link>
                          </li>
                          <!-- express -->
                        </ul>
                      </vue-collapsible>
                      <vue-collapsible :isOpen="activeDropdown === 'users'">
                        <ul class="sub-menu text-gray-500"></ul>
                      </vue-collapsible>
                    </li>
                  </ul>
                </perfect-scrollbar>
                <perfect-scrollbar
                  v-if="superMenu == 'compan'"
                  :options="{
                    swipeEasing: true,
                    wheelPropagation: false,
                  }"
                  class="h-[calc(100vh-80px)] relative"
                >
                  <ul class="relative font-semibold space-y-0.5">
                    <li class="menu nav-item">
                      <button
                        type="button"
                        class="nav-link group w-full !pl-2"
                        :class="{ active: activeDropdown === 'dashboard' }"
                        @click="activeDropdown === 'dashboard' ? (activeDropdown = null) : (activeDropdown = 'dashboard')"
                      >
                        <div class="flex items-center">
                          <i class="pg-icon w-5 h-5"></i>
                          <span class="ltr:pl-2 rtl:pr-3 text-black dark:text-[#506690] dark:group-hover:text-white-dark">
                            {{ $t('selfBuilt') }}
                          </span>
                        </div>
                      </button>
                      <vue-collapsible :isOpen="true">
                        <ul class="sub-menu text-gray-500">
                          <li>
                            <router-link to="/stock/warehouseList" @click="toggleMobileMenu">{{ $t('warehouseList') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/warehouseLocation" @click="toggleMobileMenu">{{ $t('warehouseLocation') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/goodsLend" @click="toggleMobileMenu">{{ $t('goodsLend') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/goodsTransfer" @click="toggleMobileMenu">{{ $t('goodsTransfer') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/goodsExchange" @click="toggleMobileMenu">{{ $t('goodsExchange') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/goodsOutBound" @click="toggleMobileMenu">{{ $t('goodsOutBound') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/goodsInventory" @click="toggleMobileMenu">{{ $t('goodsInventory') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/goodsInventoryLoss" @click="toggleMobileMenu">{{ $t('goodsInventoryLoss') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/goodsUnderstock" @click="toggleMobileMenu">{{ $t('goodsUnderstock') }}</router-link>
                          </li>
                        </ul>
                      </vue-collapsible>
                    </li>
                    <div style="margin-left: -16px; border-bottom: 1px solid #ebebeb; width: 260px"></div>
                    <li class="menu nav-item">
                      <button
                        type="button"
                        class="nav-link group w-full !pl-2"
                        :class="{ active: activeDropdown === 'overseas' }"
                        @click="activeDropdown === 'overseas' ? (activeDropdown = null) : (activeDropdown = 'overseas')"
                      >
                        <div class="flex items-center">
                          <i class="pg-icon w-5 h-5"></i>
                          <span class="ltr:pl-3 rtl:pr-3 text-black dark:text-[#506690] dark:group-hover:text-white-dark">{{ $t('overseasWarehouse') }}</span>
                        </div>
                        <div :class="{ 'rtl:rotate-90 -rotate-90': activeDropdown == 'overseas' }"></div>
                      </button>
                      <vue-collapsible :isOpen="true">
                        <ul class="sub-menu text-gray-500">
                          <li>
                            <router-link to="/stock/overseasWarehouseAuth" @click="toggleMobileMenu">{{ $t('overseasWarehouseAuth') }}</router-link>
                          </li>
                          <li>
                            <router-link to="/stock/overseasList" @click="toggleMobileMenu">{{ $t('warehouseList') }}</router-link>
                          </li>
                        </ul>
                      </vue-collapsible>
                      <vue-collapsible :isOpen="activeDropdown === 'overseas'">
                        <ul class="sub-menu text-gray-500"></ul>
                      </vue-collapsible>
                    </li>
                  </ul>
                </perfect-scrollbar>
                <!-- <el-scrollbar wrap-class="scrollbar-wrapper">
                  <el-menu mode="vertical" :default-active="$route.path" :collapse="isCollapse">
                    <sidebar-item v-for="route in permissionRouters" :key="route.name" :item="route" :base-path="route.path"></sidebar-item>
                  </el-menu>
                </el-scrollbar> -->
              </div>
              <span id="sidebarSwitch" title="Shortcut:S" :style="sidebarShow ? '' : 'left:-12px;'">
                <span class="w" @click="contract" :style="sidebarShow ? '' : 'width:16px;'">
                  <b class="caret caret-left" v-if="sidebarShow"></b>
                  <b class="caret caret-right" v-else></b>
                </span>
              </span>
            </nav>
          </div>

          <div class="tags-view-container tabs-box">
            <!-- 标签页 -->
            <!-- tabs-box --><!-- :class="'active'" -->
            <scroll-pane class="tags-view-wrapper" ref="scrollPane">
              <router-link
                ref="tag"
                class="tags-view-item"
                v-for="(item, index) in toPathList"
                :key="index"
                :to="item.path"
                :class="item.path == toPath ? 'active' : ''"
              >
                <div :class="item.path !== '/dashboard' ? 'flex' : ''" class="justify-around">
                  <span>{{ t(item.name) }}</span>
                  <span class="ml-1 mt-0.5" v-if="item.path !== '/dashboard'" @click.prevent.stop="removeTag(index)">
                    <el-icon>
                      <Close />
                    </el-icon>
                  </span>
                </div>
              </router-link>
            </scroll-pane>
            <!-- 第二种格式 -->
            <!--  <el-breadcrumb separator="/">
              <el-breadcrumb-item :to="{ path: '/' }" >{{$t('home')}}</el-breadcrumb-item>
              <el-breadcrumb-item :to="{path:'/stock/warehouseList'}">{{$t('warehouseList')}}</el-breadcrumb-item>
              <el-breadcrumb-item :to="{path:'/order/orderList'}" :active="true">{{$t('order')}}</el-breadcrumb-item>
            </el-breadcrumb> -->
          </div>
          <!-- 页面主体部分 -->
          <router-view></router-view>
        </div>
        <!--  END CONTENT AREA  -->

        <!-- BEGIN FOOTER -->

        <!-- END FOOTER -->
      </div>
      <Footer />
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref, onMounted, computed, watch } from 'vue';
//import Sidebar from '@/components/sidebar/index.vue'
import VueCollapsible from 'vue-height-collapsible/vue3';
import Sidebar from '@/components/layout/Sidebar.vue';
import Header from '@/components/layout/Header.vue';
import Footer from '@/components/layout/Footer.vue';
import Setting from '@/components/ThemeCustomizer.vue';
import appSetting from '@/app-setting';
import IconMenuUsers from '@/components/icon/menu/icon-menu-users.vue';
import IconCaretDown from '@/components/icon/icon-caret-down.vue';
import IconCaretsDown from '@/components/icon/icon-carets-down.vue';
import IconMenuDashboard from '@/components/icon/menu/icon-menu-dashboard.vue';
import ScrollPane from '../components/ScrollPane.vue';
import { ArrowRight, Close } from '@element-plus/icons-vue';

import store from '@/stores';
import { useRoute, useRouter } from 'vue-router'; // 引入 useRoute
import { useI18n } from 'vue-i18n';
import { Delete, Edit, Search, Share, Upload, CircleClose } from '@element-plus/icons-vue';

const { t } = useI18n();
/* 获取菜单数据 */
const permissionRouters = computed(() => store.getters.permission_routers);
const sidebar = computed(() => store.getters.sidebar);
const isCollapse = computed(() => !sidebar.value.opened);

const route = useRoute(); // 获取当前路由
const router = useRouter();
const showTopButton = ref(false);
const activeDropdown: any = ref('');
const superMenu = computed(() => store.state.superMenu);
const toggleMobileMenu = () => {
  if (window.innerWidth < 1024) {
    store.dispatch('toggleSidebar');
  }
};
const toggleSidebars = () => {
  store.dispatch('toggleSidebar');
};
onMounted(() => {
  toPathList.value.push({ name: t('home'), path: '/dashboard' });
  window.onscroll = () => {
    if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
      showTopButton.value = true;
    } else {
      showTopButton.value = false;
    }
  };

  const eleanimation: any = document.querySelector('.animation');
  eleanimation.addEventListener('animationend', function () {
    appSetting.changeAnimation('remove');
  });
  store.dispatch('toggleMainLoader');
  /*     store.toggleMainLoader(); */
  const selector = document.querySelector('.sidebar ul a[href="' + window.location.pathname + '"]');
  if (selector) {
    selector.classList.add('active');
    const ul: any = selector.closest('ul.sub-menu');
    if (ul) {
      let ele: any = ul.closest('li.menu').querySelectorAll('.nav-link') || [];
      if (ele.length) {
        ele = ele[0];
        setTimeout(() => {
          ele.click();
        });
      }
    }
  }
});

const goToTop = () => {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
};
const toggleSidebar = () => {
  store.dispatch('toggleSidebar');
};

const sidebarShow = ref(true);
/* 收缩 */
const contract = () => {
  sidebarShow.value = !sidebarShow.value;
};
/* 展开 */
const expand = () => {
  sidebarShow.value = true;
};
console.log(store.state.permission);
/* 监听 */
const toPath = ref('');
const toPathList = ref<{ name: any; path: string }[]>([]);
watch(route, (to) => {
  console.log(to.path);
  const secondSlashIndex = to.path.indexOf('/', to.path.indexOf('/') + 1);
  const valueBeforeSecondSlash = to.path.substring(0, secondSlashIndex);
  console.log(valueBeforeSecondSlash);
  toPath.value = to.path;
  //如果路径不存在则添加路径
  if (!toPathList.value.some((item) => item.path === to.path)) {
    toPathList.value.push({ name: to.name || null, path: to.path });
    // Limit to last 10 entries
    if (toPathList.value.length > 10) toPathList.value.shift();
  }
});

/* 获取页面 */
const visitedViews = computed(() => store.state.tagsView.visitedViews);
const lastTenVisitedViews = computed(() => {
  const views = store.state.tagsView.visitedViews;
  console.log(views);
  return views.slice(Math.max(views.length - 10, 0)); // 获取最后十条数据
});
/* 删除标签 */
const removeTag = (index: number) => {
  if (toPathList.value.length > 1) {
    const tagToRemove = toPathList.value[index]; // 获取要删除的标签
    toPathList.value.splice(index, 1); // 删除标签

    // 确定要导航到的上一个标签
    const previousTag = toPathList.value[index] || toPathList.value[index - 1]; // 获取上一个标签或保持在当前标签

    // 检查当前路由是否与要删除的标签相同
    if (previousTag) {
      router.push(previousTag.path); // 导航到上一个标签
    }
  }
  // 保证最后一个标签为首页
  if (toPathList.value.length === 1 && toPathList.value[0].path !== '/dashboard') {
    toPathList.value.push({ name: t('home'), path: '/dashboard' });
  }
};
/* 侧边栏List */
const sidebarList = ref([]);
</script>
<style>
#sidebarSwitch {
  position: fixed;
  left: 213px;
  top: 43%;
  z-index: 5;
  display: inline-block;
  width: 30px;
  height: 90px;
  cursor: pointer;
  text-align: center;
}
#sidebarSwitch .w {
  display: inline-block;
  width: 10px;
  text-align: center;
  height: 40px;
  background: #fff;
  margin: 23px 0 0;
  border: 1px solid #ddd;
  border-radius: 5px;
}
#sidebarSwitch .w .caret {
  margin: 17px 0 0;
}
.caret {
  display: inline-block;
  transform: translate(0, -2px) rotate(-45deg);
  width: 5px;
  height: 5px;
  border-left: 1px solid #999;
  border-bottom: 1px solid #999;
  border-top: 0;
  border-right: 0;
  content: '';
}
.caret-left {
  transform: translate(1px, 0) rotate(45deg);
}
.caret-right {
  transform: translate(-1px, 0) rotate(-135deg);
}
.pg-icon {
  background: url('../assets/images/icon.png') 0 0 no-repeat;
  display: inline-block;
}
.sidebar ul.sub-menu li a::before {
  height: 0 !important;
}

.tags-view-container {
  /* background: rgb(250, 250, 250); */
  width: 100%;
  /* box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04); */
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  /* border-bottom: 1px solid #d8dce5; */
  /* margin-left: 20px;
  margin-top: 5px; */
}

.tags-view-container.tabs-box {
  min-width: 1260px;
}

.tags-view-container .dropdown-btn {
  margin: 0 20px;
  width: 20px;
  height: 30px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* border-radius: 50%; */
  /* background: rgba(215,215,215, 1); */
  cursor: pointer;
}

.tags-view-container .dropdown-btn:hover {
  filter: brightness(1.1);
  transform: rotate(180deg);
  transition: 0.15s;
}

.tags-view-container .dropdown-btn .el-icon-arrow-down {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.tags-view-container .tags-view-wrapper {
  width: calc(100% - 120px);
  height: 40px;
}

.tags-view-container .tags-view-wrapper .tags-view-item {
  display: inline-block;
  position: relative;
  height: 36px;
  line-height: 36px;
  color: #495060;
  padding: 0 8px;
  margin-right: 9px;
  margin-top: 4px;
  background-color: #f5f7fa;
  border-radius: 7px 7px 0 0;
}

.tags-view-container .tags-view-wrapper .tags-view-item:first-of-type {
  /* margin-left: 15px; */
}

.tags-view-container .tags-view-wrapper .tags-view-item.active {
  background-color: #fff;
  /* color: #fff; */
  /* border-color: #409EFF; */
  color: #409eff;
}

.tags-view-container .tags-view-wrapper .tags-view-item.active::before {
  /* content: ''; */
  /* background: #fff; */
  /* display: inline-block; */
  /* width: 8px; */
  /* height: 8px; */
  /* border-radius: 50%; */
  /* position: relative; */
  /* margin-right: 2px; */
}

.tags-view-container .contextmenu {
  margin: 0;
  background: #fff;
  z-index: 999;
  position: absolute;
  list-style-type: none;
  padding: 5px 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  color: #333;
  box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
}

.tags-view-container .contextmenu li {
  margin: 0;
  padding: 7px 16px;
  cursor: pointer;
}

.tags-view-container .contextmenu li:hover {
  background: #eee;
}

.tags-view-container .tags-view-item {
  padding: 0 10px;
  min-width: 80px;
  border-radius: 4px;
  text-align: center;
  user-select: none;
}

.tags-view-container .tags-view-item .el-icon-close {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  transform-origin: 100% 50%;
}

.tags-view-container .tags-view-item .el-icon-close:before {
  transform: scale(0.6);
  display: inline-block;
}

.tags-view-container .tags-view-item .el-icon-close:hover {
  background-color: #b4bccc;
  color: #fff;
}
</style>
