import validUA from "@/utils/ua";
if (!validUA) {
  alert(
    "请选择Chrome内核版本大于80的浏览器，最新版的Chrome浏览器(推荐)和360浏览器(极速和安全均可)满足要求。"
  );
  location.href = "about:blank";
}
// vite-plugin-components 不能引入message的style
import "ant-design-vue/es/message/style/css.js";

import "./styles/global.css";
import "./features/report/assets/report.css";
import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router";
import filters from "@/filters";
import roundNumber from "@/directives/roundNumber";
import numberToPercent from "@/directives/numberToPercent";
// import Antd from "ant-design-vue";
// import "ant-design-vue/dist/antd.css";
import ECharts from "vue-echarts";
import { use } from "echarts/core";

import { CanvasRenderer,SVGRenderer } from "echarts/renderers";
import { LineChart, BarChart } from "echarts/charts";
import {
  GridComponent,
  TitleComponent,
  TooltipComponent,
  LegendComponent,
  MarkLineComponent,
} from "echarts/components";
import { Table } from "ant-design-vue";
[Table].forEach((element) => {
  element.props.size.default = "small";
});

use([
  SVGRenderer,
  CanvasRenderer,
  LineChart,
  BarChart,
  GridComponent,
  TitleComponent,
  TooltipComponent,
  LegendComponent,MarkLineComponent
]);

import { createPinia } from "pinia";

// if(process.env.NODE_ENV)
// console.log(import.meta.env.DEV);
const app = createApp(App);
app.use(router);
app.use(createPinia());
app.config.globalProperties.$filters = filters;

app.component("VChart", ECharts);
app.directive("round-number", roundNumber);
app.directive("number-to-percent", numberToPercent);

app.mount("#app");
