|
|
|
|
@ -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,13 +24,17 @@ 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);
|
|
|
|
|
@ -38,11 +44,19 @@ import print from "vue-print-nb";
|
|
|
|
|
directives: {
|
|
|
|
|
print;
|
|
|
|
|
}
|
|
|
|
|
import { thousands } from "@/utils/index.js";
|
|
|
|
|
import {
|
|
|
|
|
thousands
|
|
|
|
|
} from "@/utils/index.js";
|
|
|
|
|
// 引入高精度精算
|
|
|
|
|
import { Decimal } from "decimal.js";
|
|
|
|
|
import {
|
|
|
|
|
Decimal
|
|
|
|
|
} from "decimal.js";
|
|
|
|
|
import {
|
|
|
|
|
parseTime
|
|
|
|
|
} from "./utils/index.js";
|
|
|
|
|
// 全局定义
|
|
|
|
|
Vue.prototype.$Decimal = Decimal;
|
|
|
|
|
Vue.prototype.$parseTime = parseTime;
|
|
|
|
|
|
|
|
|
|
import Vue from "vue";
|
|
|
|
|
import Router from "vue-router";
|
|
|
|
|
@ -54,7 +68,9 @@ 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)
|
|
|
|
|
|
|
|
|
|
@ -88,7 +104,7 @@ export function noRepeat(arr) {
|
|
|
|
|
Vue.prototype.noRepeat = noRepeat;
|
|
|
|
|
|
|
|
|
|
// 全局过滤器--时间戳格式化时间//.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");
|
|
|
|
|
@ -98,7 +114,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");
|
|
|
|
|
@ -108,10 +124,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) +
|
|
|
|
|
"**************" +
|
|
|
|
|
@ -119,11 +135,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, // 是否锁屏
|
|
|
|
|
@ -134,7 +150,7 @@ Vue.prototype.openLoading = function() {
|
|
|
|
|
body: true,
|
|
|
|
|
customClass: "mask" // 遮罩层新增类名
|
|
|
|
|
});
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
// 设定定时器,超时5S后自动关闭遮罩层,避免请求失败时,遮罩层一直存在的问题
|
|
|
|
|
loading.close(); // 关闭遮罩层
|
|
|
|
|
}, 5000);
|
|
|
|
|
|