You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.6 KiB
104 lines
2.6 KiB
/*
|
|
* @Author: mk 2403457699@qq.com
|
|
* @Date: 2022-12-16 09:05:10
|
|
* @LastEditors: mk 2403457699@qq.com
|
|
* @LastEditTime: 2023-08-10 16:49:19
|
|
* @Description: 全局挂载提示信息,避免同时出现多条信息
|
|
*
|
|
*
|
|
*/
|
|
import Vue from "vue";
|
|
import Element from "element-ui";
|
|
|
|
import App from "@/App";
|
|
import i18n from "@/i18n";
|
|
import router from "@/router";
|
|
import "@/icons";
|
|
import "@/element-ui/theme/index.css";
|
|
import "@/assets/scss/aui.scss";
|
|
import { message } from "@/utils/message.js";
|
|
|
|
//按钮
|
|
|
|
import http from "@/utils/request";
|
|
import cloneDeep from "lodash/cloneDeep";
|
|
|
|
// axios封装
|
|
import ajax from "@/js/ajax";
|
|
// service
|
|
import service from "@/js/service";
|
|
// vuex处理多个组件共享状态
|
|
import store from "@/js/store";
|
|
//系统工具
|
|
import util from "@js/util";
|
|
// import Cookies from "js-cookie";
|
|
import Moment from "moment";
|
|
import getQueryPara from "dai-js/modules/getQueryPara";
|
|
import NodeWrap from "@/components/Tree/nodeWrap.vue";
|
|
import AddNode from "@/components/Tree/addNode.vue";
|
|
//按钮
|
|
Vue.component("nodeWrap", NodeWrap);
|
|
Vue.component("addNode", AddNode);
|
|
|
|
// 兼容token传参登录
|
|
if (getQueryPara("token")) {
|
|
console.log("token", getQueryPara("token"));
|
|
localStorage.setItem("token", getQueryPara("token"));
|
|
console.log("token222222", localStorage.getItem("token"));
|
|
}
|
|
|
|
window.app = Object.assign(
|
|
{},
|
|
{
|
|
util,
|
|
ajax,
|
|
service,
|
|
}
|
|
);
|
|
|
|
Vue.config.productionTip = false;
|
|
Moment.locale("zh-cn");
|
|
Vue.use(Element, {
|
|
size: "default",
|
|
i18n: (key, value) => i18n.t(key, value),
|
|
});
|
|
|
|
Vue.prototype.$message = message;
|
|
// 弹窗底部滚动问题 弹窗需配合v-if使用
|
|
Vue.directive("fixed", {
|
|
inserted() {
|
|
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
|
document.body.style.cssText += "position:fixed;width:100%;top:-" + scrollTop + "px;";
|
|
},
|
|
unbind() {
|
|
let body = document.body;
|
|
body.style.position = "";
|
|
let top = body.style.top;
|
|
document.body.scrollTop = document.documentElement.scrollTop = -parseInt(top);
|
|
body.style.top = "";
|
|
},
|
|
});
|
|
|
|
// 挂载全局
|
|
Vue.prototype.$http = http;
|
|
|
|
// el-uploader的header配置
|
|
Vue.prototype.$getElUploadHeaders = () => ({
|
|
Authorization: localStorage.getItem("token") || "",
|
|
});
|
|
// Vue.prototype.$getDictLabel = getDictLabel
|
|
|
|
//事件总线
|
|
Vue.prototype.$EventBus = new Vue();
|
|
|
|
// 保存整站vuex本地储存初始状态
|
|
window.SITE_CONFIG["storeState"] = cloneDeep(store.state);
|
|
|
|
Vue.prototype.tableHeaderStyle = { background: "linear-gradient(0deg, #005EB3 0%, #0083F0 100%)", color: "#FFFFFF", padding: "6px 0px" };
|
|
|
|
new Vue({
|
|
i18n,
|
|
router,
|
|
store,
|
|
render: (h) => h(App),
|
|
}).$mount("#app");
|
|
|