WXL (wul)
7 天以前 a99e82da2b087d7019cdce015c25befc620b9d61
src/main.js
@@ -13,6 +13,7 @@
import router from "./router";
import directive from "./directive"; // directive
import plugins from "./plugins"; // plugins
import Print from 'vue-print-nb'
import { download } from "@/utils/request";
//引入quill-editor编辑器
import VueQuillEditor from "vue-quill-editor";
@@ -21,10 +22,14 @@
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
Vue.use(VueQuillEditor);
Vue.use(Print)
// 引入
import { codemirror } from "vue-codemirror";
import "@/utils/cm-setting.js";
Vue.component("codemirror", codemirror);
import preventReClick from '@/utils/directives/preventReClick';
Vue.use(preventReClick);
import { Quill } from "vue-quill-editor";
window.Quill = Quill;
@@ -46,6 +51,7 @@
import {
  parseTime,
  formatTime,
  followupAuthority,
  resetForm,
  addDateRange,
  selectDictLabel,
@@ -87,6 +93,14 @@
  Vue.filter(key, filters[key]);
}
import moment from "moment"
// 1. 在main.js中添加错误监听
window.addEventListener('unhandledrejection', (event) => {
  if (event.reason && event.reason.message &&
      event.reason.message.includes('Loading chunk')) {
    // 重新加载页面
    window.location.reload();
  }
});
Vue.prototype.$moment = moment;
@@ -98,6 +112,7 @@
Vue.prototype.formatTime = formatTime;
Vue.prototype.daysBetween = daysBetween;
Vue.prototype.resetForm = resetForm;
Vue.prototype.followupAuthority = followupAuthority;
Vue.prototype.addDateRange = addDateRange;
Vue.prototype.selectDictLabel = selectDictLabel;
Vue.prototype.selectDictLabels = selectDictLabels;
@@ -137,6 +152,19 @@
Vue.config.productionTip = false;
// 全局注入机构判断(省立同德系列 / 纯省立同德院区)。
// 所有组件无需单独注册 computed,模板与 this 中可直接使用 isTongdeOrg / isTongdeCampus
Vue.mixin({
  computed: {
    isTongdeOrg() {
      return this.$store.getters.isTongdeOrg; // 是否省立同德系列院区(含南华大学附属第一医院)
    },
    isTongdeCampus() {
      return this.$store.getters.isTongdeCampus;// 是否纯省立同德院区(不含南华大学附属第一医院)
    },
  },
});
new Vue({
  el: "#app",
  router,