<!-- 搜索表单 -->
<template>
  <a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin')">
    <a-button
      type="text"
      @click="openUrl('/project/renew')"
    >即将到期
    </a-button>
    <a-button
      type="text"
      @click="openUrl('/project/renew-log/index')"
    >续费明细
    </a-button>
    <a-button
      type="text"
      @click="openUrl('/project/no-renew')"
    >未签续费
    </a-button>
    <a-button
      type="text"
      @click="openUrl('/oa/app/index')"
    >(旧版项目管理)
    </a-button>
  </a-space>
</template>

<script lang="ts" setup>
import {watch,nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {message} from 'ant-design-vue';
import {removeSiteInfoCache} from "@/api/cms/cmsWebsite";
import {hasRole} from "@/utils/permission";

const props = withDefaults(
  defineProps<{
    // 选中的角色
    selection?: [];
    website?: CmsWebsite;
    count?: 0;
  }>(),
  {}
);

const emit = defineEmits<{
  (e: 'add'): void;
}>();

const add = () => {
  emit('add');
};

// 清除缓存
const clearSiteInfoCache = () => {
  removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId') + "*").then(
    (msg) => {
      if (msg) {
        message.success(msg);
      }
    }
  );
};

nextTick(() => {
  if(localStorage.getItem('NotActive')){
    // IsActive.value = false
  }
})

watch(
  () => props.selection,
  () => {
  }
);
</script>
