城阳pc工作端前端代码
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.

105 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: 全局挂载提示信息,避免同时出现多条信息
2 years ago
*
*
*/
4 years ago
import Vue from "vue";
import Element from "element-ui";
4 years ago
4 years ago
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";
2 years ago
import { message } from "@/utils/message.js";
2 years ago
4 years ago
//按钮
2 years ago
4 years ago
import http from "@/utils/request";
import cloneDeep from "lodash/cloneDeep";
4 years ago
// axios封装
4 years ago
import ajax from "@/js/ajax";
4 years ago
// service
4 years ago
import service from "@/js/service";
4 years ago
// vuex处理多个组件共享状态
4 years ago
import store from "@/js/store";
4 years ago
//系统工具
4 years ago
import util from "@js/util";
3 years ago
// import Cookies from "js-cookie";
2 years ago
import Moment from "moment";
4 years ago
import getQueryPara from "dai-js/modules/getQueryPara";
2 years ago
import NodeWrap from "@/components/Tree/nodeWrap.vue";
import AddNode from "@/components/Tree/addNode.vue";
//按钮
Vue.component("nodeWrap", NodeWrap);
Vue.component("addNode", AddNode);
4 years ago
// 兼容token传参登录
if (getQueryPara("token")) {
console.log("token", getQueryPara("token"));
localStorage.setItem("token", getQueryPara("token"));
console.log("token222222", localStorage.getItem("token"));
4 years ago
}
4 years ago
window.app = Object.assign(
{},
{
util,
ajax,
4 years ago
service,
4 years ago
}
4 years ago
);
4 years ago
4 years ago
Vue.config.productionTip = false;
2 years ago
Moment.locale("zh-cn");
4 years ago
Vue.use(Element, {
4 years ago
size: "default",
i18n: (key, value) => i18n.t(key, value),
});
2 years ago
2 years ago
Vue.prototype.$message = message;
// 弹窗底部滚动问题 弹窗需配合v-if使用
Vue.directive("fixed", {
inserted() {
2 years ago
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;
2 years ago
document.body.scrollTop = document.documentElement.scrollTop = -parseInt(top);
body.style.top = "";
},
});
4 years ago
// 挂载全局
4 years ago
Vue.prototype.$http = http;
// el-uploader的header配置
Vue.prototype.$getElUploadHeaders = () => ({
Authorization: localStorage.getItem("token") || "",
});
4 years ago
// Vue.prototype.$getDictLabel = getDictLabel
//事件总线
2 years ago
Vue.prototype.$EventBus = new Vue();
4 years ago
// 保存整站vuex本地储存初始状态
4 years ago
window.SITE_CONFIG["storeState"] = cloneDeep(store.state);
4 years ago
2 years ago
Vue.prototype.tableHeaderStyle = { background: "linear-gradient(0deg, #005EB3 0%, #0083F0 100%)", color: "#FFFFFF", padding: "6px 0px" };
3 years ago
4 years ago
new Vue({
i18n,
router,
store,
4 years ago
render: (h) => h(App),
}).$mount("#app");