123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- import { createApp } from "vue";
- import App from "./App.vue";
- import router from "./router";
- import store from "./store";
- import "font-awesome/css/font-awesome.min.css";
- import ElementPlus from "element-plus";
- import "element-plus/dist/index.css";
- import locale from "element-plus/lib/locale/lang/zh-cn";
- import * as ElementPlusIconsVue from "@element-plus/icons-vue";
- import "@/lib/global-import.js";
- import "./permission";
- import axios from "@api/axios";
- import basicTool from "@tools/basicTool";
- import animated from "animate.css";
- import { ElMessage } from "element-plus";
- const app = createApp(App);
- const messageToast = () => {
-
- ElMessage.error("5秒内请勿重复点击");
- };
- const funListener = (el, binding) => {
- let time = null;
- el.removeEventListener("click", messageToast);
- el.addEventListener(
- "click",
- () => {
- binding.value();
- el.addEventListener("click", messageToast, false);
- time = setTimeout(() => {
- clearTimeout(time);
- funListener(el, binding);
- }, Number(binding.arg) || 5000);
- },
- {
- once: true,
- }
- );
- };
- Date.prototype.formatDate = function (fmt) {
- let o = {
- "M+": this.getMonth() + 1,
- "d+": this.getDate(),
- "h+": this.getHours(),
- "m+": this.getMinutes(),
- "s+": this.getSeconds(),
- "q+": Math.floor((this.getMonth() + 3) / 3),
- S: this.getMilliseconds(),
- };
- if (/(y+)/.test(fmt)) {
- fmt = fmt.replace(
- RegExp.$1,
- (this.getFullYear() + "").substr(4 - RegExp.$1.length)
- );
- }
- for (let k in o) {
- if (new RegExp("(" + k + ")").test(fmt)) {
- fmt = fmt.replace(
- RegExp.$1,
- RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
- );
- }
- }
- return fmt;
- };
- app.directive("prevdbclick", {
- mounted(el, binding) {
- funListener(el, binding);
- },
- });
- for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
- app.component(key, component);
- }
- window.__STATICVUE__ = app;
- window.__STATICVUE__.use(ElementPlus, { locale });
- app._context.components.ElDialog["props"].closeOnClickModal.default = false;
- window.__STATICVUE__.use(store);
- window.__STATICVUE__.use(router);
- window.__STATICVUE__.use(animated);
- window.__STATICVUE__.config.globalProperties.API = axios;
- window.__STATICVUE__.config.globalProperties.BASE = basicTool;
- window.__STATICVUE__.mount("#app");
|