<!-- 搜索表单 -->
<template>
  <a-space style="flex-wrap: wrap">
    <a-input-search
      allow-clear
      placeholder="请输入关键词"
      style="width: 280px"
      v-model:value="where.keywords"
      @pressEnter="reload"
      @search="reload"
    />
  </a-space>
</template>

<script lang="ts" setup>
import {watch,nextTick} from 'vue';
import {CmsWebsite, CmsWebsiteParam} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import useSearch from "@/utils/use-search";

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

const emit = defineEmits<{
  (e: 'search', where?: CmsWebsiteParam): void;
  (e: 'add'): void;
}>();

// 表单数据
const { where } = useSearch<CmsWebsiteParam>({
  websiteId: undefined,
  keywords: ''
});

const reload = () => {
  emit('search', where);
};

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

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