车辆管理系统-后台管理系统web
spring
3 天以前 9a11bff3d98aea29f37abc34a00a17f5c92ade9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
// +----------------------------------------------------------------------
// | CMS [ CMS赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.CMS.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CMS并不是自由软件,未经许可不能去掉CMS相关版权
// +----------------------------------------------------------------------
// | Author: CMS Team <admin@CMS.com>
// +----------------------------------------------------------------------
 
import Vue from "vue";
import "@babel/polyfill";
// import 'babel-polyfill'
import Cookies from "js-cookie";
import "normalize.css/normalize.css"; // a modern alternative to CSS resets
import Element from "element-ui";
import "./styles/element-variables.scss";
import "@/styles/index.scss"; // global css
import "@/assets/iconfont/iconfont";
import "@/assets/iconfont/iconfont.css";
import VueAwesomeSwiper from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
import "vue-ydui/dist/ydui.base.css";
import {
  parseTime,
  resetForm,
  handleTree,
} from "@/utils/parsing";
// 懒加载
import VueLazyload from "vue-lazyload";
 
// import VConsole from "vconsole";
// const vConsole = new VConsole();
// vConsole.setOption("display", "box");
 
Vue.config.devtools = true;
import App from "./App";
import store from "./store";
import router from "./router";
import uploadPicture from "./components/uploadPicture/uploadFrom";
import UploadIndex from "@/components/uploadPicture/index.vue";
import UploadFile from "@/components/Upload/uploadFile.vue";
import iconFrom from "./components/iconFrom";
import TimeSelect from "@/components/TimeSelect";
import dialog from "@/libs/dialog";
import scroll from "@/libs/loading";
import schema from "async-validator";
// 切勿更改 此组件为表单生成中使用的图片上传组件
import SelfUpload from "@/components/uploadPicture/forGenrator/index.vue";
import util from "@/utils/utils";
import modalAttr from "@/libs/modal-attr";
import modalIcon from "@/libs/modal-icon";
import { modalSure } from "@/libs/public";
import timeOptions from "@/libs/timeOptions";
import { loadScriptQueue } from "@/components/FormGenerator/utils/loadScript";
import "./icons"; // icon
import "./permission"; // permission control
import "./utils/error-log"; // error integralLog
import * as filters from "./filters"; // global filters
import { parseQuery } from "@/utils";
import * as Auth from "@/libs/wechat";
import * as constants from "@/utils/constants.js";
import * as selfUtil from "@/utils/ZBKJIutil.js";
import plugins from "./plugins";
import directive from "./directive"; //directive
 
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: require("./assets/imgs/no.png"),
  loading: require("./assets/imgs/moren.jpg"),
  attempt: 1,
  listenEvents: [
    "scroll",
    "wheel",
    "mousewheel",
    "resize",
    "animationend",
    "transitionend",
    "touchmove",
  ],
});
 
Vue.use(uploadPicture);
// Vue.use(goodListFrom);
// Vue.use(couponFrom);
// Vue.use(articleFrom);
Vue.use(VueAwesomeSwiper);
Vue.use(plugins);
Vue.use(directive);
 
// Vue.component("attrFrom", attrFrom);
Vue.component("UploadIndex", UploadIndex);
Vue.component("SelfUpload", SelfUpload);
Vue.component("iconFrom", iconFrom);
Vue.component("uploadFile", UploadFile);
Vue.component("timeSelect", TimeSelect);
Vue.prototype.$modalSure = modalSure;
Vue.prototype.$modalAttr = modalAttr;
Vue.prototype.$modalIcon = modalIcon;
Vue.prototype.$dialog = dialog;
Vue.prototype.$scroll = scroll;
Vue.prototype.$wechat = Auth;
Vue.prototype.$util = util;
Vue.prototype.$constants = constants;
Vue.prototype.$selfUtil = selfUtil;
Vue.prototype.$timeOptions = timeOptions;
Vue.prototype.$validator = function (rule) {
  return new schema(rule);
};
Vue.prototype.handleTree = handleTree;
Vue.prototype.parseTime = parseTime;
Vue.prototype.resetForm = resetForm;
 
let cookieName = "VCONSOLE";
let query = parseQuery();
let urlSpread = query["spread"];
let vconsole = query[cookieName.toLowerCase()];
let md5CMS = "b14d1e9baeced9bb7525ab19ee35f2d2"; //CMS MD5 加密开启vconsole模式
let md5UnCMS = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
 
if (vconsole !== undefined) {
  if (vconsole === md5UnCMS && Cookies.has(cookieName))
    Cookies.remove(cookieName);
} else vconsole = Cookies.get(cookieName);
 
if (vconsole !== undefined && vconsole === md5CMS) {
  Cookies.set(cookieName, md5CMS, 3600);
  const module = () => import("vconsole");
  module().then((Module) => {
    new Module.default();
  });
}
// 自定义实现String 类型的replaceAll方法
String.prototype.replaceAll = function (s1, s2) {
  return this.replace(new RegExp(s1, "gm"), s2);
};
 
Vue.use(Element, {
  size: Cookies.get("size") || "mini", // set element-ui default size
});
 
// register global utility filters
Object.keys(filters).forEach((key) => {
  Vue.filter(key, filters[key]);
});
 
Vue.config.productionTip = false;
 
const $previewApp = document.getElementById("previewApp");
const childAttrs = {
  file: "",
  dialog:
    ' width="600px" class="dialog-width" v-if="visible" :visible.sync="visible" :modal-append-to-body="false" ',
};
 
window.addEventListener("message", init, false);
 
function buildLinks(links) {
  let strs = "";
  links.forEach((url) => {
    strs += `<link href="${url}" rel="stylesheet">`;
  });
  return strs;
}
 
function init(event) {
  if (event.data.type === "refreshFrame") {
    const code = event.data.data;
    const attrs = childAttrs[code.generateConf.type];
    let links = "";
 
    if (Array.isArray(code.links) && code.links.length > 0) {
      links = buildLinks(code.links);
    }
 
    $previewApp.innerHTML = `${links}<style>${code.css}</style><div id="app"></div>`;
 
    if (Array.isArray(code.scripts) && code.scripts.length > 0) {
      loadScriptQueue(code.scripts, () => {
        newVue(attrs, code.js, code.html);
      });
    } else {
      newVue(attrs, code.js, code.html);
    }
  }
}
 
function newVue(attrs, main, html) {
  // eslint-disable-next-line no-eval
  main = eval(`(${main})`);
  main.template = `<div>${html}</div>`;
  new Vue({
    components: {
      child: main,
    },
    data() {
      return {
        visible: true,
      };
    },
    template: `<div><child ${attrs}/></div>`,
  }).$mount("#app");
}
 
String.prototype.replaceAll = function (s1, s2) {
  return this.replace(new RegExp(s1, "gm"), s2);
};
 
// // 添加CMS chat 统计
// var __s = document.createElement("script");
// __s.src = `${SettingMer.apiBaseURL}/public/jsconfig/getCMSchatconfig`;
// document.head.appendChild(__s);
 
new Vue({
  el: "#app",
  router,
  store,
  render: (h) => h(App),
});