|
|
|
|
@ -4,7 +4,9 @@ import "babel-polyfill";
|
|
|
|
|
import "es6-promise/auto";
|
|
|
|
|
import ElementUI from "element-ui";
|
|
|
|
|
import "element-ui/lib/theme-chalk/index.css";
|
|
|
|
|
import { Message } from "element-ui";
|
|
|
|
|
import {
|
|
|
|
|
Message
|
|
|
|
|
} from "element-ui";
|
|
|
|
|
Vue.use(ElementUI);
|
|
|
|
|
import App from "./App.vue";
|
|
|
|
|
import store from "./store";
|
|
|
|
|
@ -22,18 +24,26 @@ import "./utils/dialog";
|
|
|
|
|
import "./plugins";
|
|
|
|
|
// import "./utils/directive/focus";
|
|
|
|
|
import echarts from "echarts";
|
|
|
|
|
import { getCookie } from "./utils/utils.js";
|
|
|
|
|
import {
|
|
|
|
|
getCookie
|
|
|
|
|
} from "./utils/utils.js";
|
|
|
|
|
import apiConfig from "../config/api.config.js";
|
|
|
|
|
import vueEsign from "vue-esign";
|
|
|
|
|
import animated from "animate.css"; // npm install animate.css --save安装,在引入
|
|
|
|
|
import formatTime from "./utils/filters.js";
|
|
|
|
|
import arrDiff from "./utils/array.js";
|
|
|
|
|
import { Loading } from "element-ui";
|
|
|
|
|
import {
|
|
|
|
|
Loading
|
|
|
|
|
} from "element-ui";
|
|
|
|
|
import countdown from "./utils/countdown.js";
|
|
|
|
|
import "./utils/rem.js";
|
|
|
|
|
Vue.use(animated);
|
|
|
|
|
Vue.use(vueEsign);
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
thousands
|
|
|
|
|
} from '@/utils/index.js'
|
|
|
|
|
|
|
|
|
|
import Vue from "vue";
|
|
|
|
|
import Router from "vue-router";
|
|
|
|
|
import router from "./router";
|
|
|
|
|
@ -44,10 +54,13 @@ Vue.use(VueAxios, axios);
|
|
|
|
|
axios.defaults.baseURL = apiConfig.baseUrl;
|
|
|
|
|
Vue.use(Print); //注册
|
|
|
|
|
|
|
|
|
|
import { message } from "./utils/resetMessage.js"; //现在提示弹窗每次只弹一条
|
|
|
|
|
import {
|
|
|
|
|
message
|
|
|
|
|
} from "./utils/resetMessage.js"; //现在提示弹窗每次只弹一条
|
|
|
|
|
// import VueParticles from 'vue-particles'
|
|
|
|
|
// Vue.use(VueParticles)
|
|
|
|
|
|
|
|
|
|
Vue.prototype.$thousands = thousands
|
|
|
|
|
Vue.prototype.$message = message;
|
|
|
|
|
Vue.prototype.$countdown = countdown;
|
|
|
|
|
Vue.prototype.bus = new Vue();
|
|
|
|
|
@ -66,7 +79,7 @@ export function getNextDate(date, day) {
|
|
|
|
|
}
|
|
|
|
|
axios.defaults.withCredentials = true; //让ajax携带cookie
|
|
|
|
|
// 全局过滤器--时间戳格式化时间//.padStart(2 , "0") 不足两位的,用0填充
|
|
|
|
|
Vue.filter("dateFormat", function(originVal) {
|
|
|
|
|
Vue.filter("dateFormat", function (originVal) {
|
|
|
|
|
const dt = new Date(originVal);
|
|
|
|
|
const y = dt.getFullYear();
|
|
|
|
|
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
|
|
|
|
@ -76,7 +89,7 @@ Vue.filter("dateFormat", function(originVal) {
|
|
|
|
|
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
|
|
|
|
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
|
|
|
|
|
});
|
|
|
|
|
Vue.filter("dateMonth", function(originVal) {
|
|
|
|
|
Vue.filter("dateMonth", function (originVal) {
|
|
|
|
|
const dt = new Date(originVal);
|
|
|
|
|
const y = dt.getFullYear();
|
|
|
|
|
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
|
|
|
|
@ -86,10 +99,10 @@ Vue.filter("dateMonth", function(originVal) {
|
|
|
|
|
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
|
|
|
|
return `${y}-${m}-${d}`;
|
|
|
|
|
});
|
|
|
|
|
Vue.filter("phone", function(phone) {
|
|
|
|
|
Vue.filter("phone", function (phone) {
|
|
|
|
|
return phone.substring(0, 3) + "****" + phone.substring(phone.length - 4);
|
|
|
|
|
});
|
|
|
|
|
Vue.filter("identityNum", function(identityNum) {
|
|
|
|
|
Vue.filter("identityNum", function (identityNum) {
|
|
|
|
|
return (
|
|
|
|
|
identityNum.substring(0, 4) +
|
|
|
|
|
"**************" +
|
|
|
|
|
@ -97,11 +110,11 @@ Vue.filter("identityNum", function(identityNum) {
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Vue.filter("money", function(money) {
|
|
|
|
|
Vue.filter("money", function (money) {
|
|
|
|
|
return (money * 1).toFixed(2);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Vue.prototype.openLoading = function() {
|
|
|
|
|
Vue.prototype.openLoading = function () {
|
|
|
|
|
const loading = this.$loading({
|
|
|
|
|
// 声明一个loading对象
|
|
|
|
|
lock: true, // 是否锁屏
|
|
|
|
|
@ -112,7 +125,7 @@ Vue.prototype.openLoading = function() {
|
|
|
|
|
body: true,
|
|
|
|
|
customClass: "mask" // 遮罩层新增类名
|
|
|
|
|
});
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
// 设定定时器,超时5S后自动关闭遮罩层,避免请求失败时,遮罩层一直存在的问题
|
|
|
|
|
loading.close(); // 关闭遮罩层
|
|
|
|
|
}, 5000);
|
|
|
|
|
@ -151,7 +164,9 @@ router.beforeEach((to, from, next) => {
|
|
|
|
|
message: "请先登录",
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
next({ path: "/login" });
|
|
|
|
|
next({
|
|
|
|
|
path: "/login"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
Vue.directive("role", {
|
|
|
|
|
@ -178,7 +193,9 @@ new Vue({
|
|
|
|
|
el: "#app",
|
|
|
|
|
router,
|
|
|
|
|
store,
|
|
|
|
|
components: { App },
|
|
|
|
|
components: {
|
|
|
|
|
App
|
|
|
|
|
},
|
|
|
|
|
template: "<App/>"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|