<template>
  <headerView v-if="showView == 'GIP' || showView == 'IPP'" />
  <!-- 政务公开 -->
  <div v-if="showView == 'MGAP' || showView == 'IPP'">
    <header-zwgk v-if="showView == 'MGAP'" />
    <main-module :showView="showView">
      <template #routerView>
        <router-view></router-view>
      </template>
    </main-module>
  </div>
  <template v-if="showView != 'MGAP' && showView != 'IPP'">
    <router-view></router-view>
  </template>
  <!-- 全文检索 -->
  <footerView v-if="showView != 'FTS' && showView != 'IPP'" />
</template>
<script setup>
import { useRouter } from 'vue-router'
import headerView from '@/views/header/index.vue'
import headerZwgk from '@/views/header/headerZwgk.vue'
import footerView from '@/views/footer/index.vue'
import mainModule from '@/views/zwgk/modules/main.vue'
import { ref, watch, onMounted } from 'vue'
import { BACKGETview } from '@/api/Important.js'
let showView = ref('GIP')
const router = useRouter()
watch(
  () => router.currentRoute.value.meta.tagRoute,
  (newValue) => {
    //获取所有路由

    showView.value = newValue
  },
  { immediate: true }
)

onMounted(() => {
  BACKGETviewGET()
})

const del = (v) => {
  setTimeout(() => {
    // const body = document.body
    const htmlElement = document.documentElement
    if (v == 0) {
      htmlElement.classList.remove('my-custom-class')
    } else {
      htmlElement.classList.add('my-custom-class')
    }
  }, 0)
}

const BACKGETviewGET = async () => {
  const { data } = await BACKGETview({ size: 10, current: 1 })
  del(data.records[0].mourningDaySwitch)
}
</script>

<style>
.my-custom-class {
  filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
  -webkit-filter: grayscale(100%);
  -moz-filter: grayscale(100%);
  -ms-filter: grayscale(100%);
  -o-filter: grayscale(100%);
  filter: grayscale(100%);
  filter: gray;
}
</style>
