main.js
6.22 KB
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
import Vue from "vue";
import Element from "element-ui";
import "./assets/styles/element-variables.scss";
import "@/assets/styles/index.scss"; // global css
import "@/assets/styles/iClearExp.scss"; // iClearExp css
import "@/assets/styles/variables.scss";
import "@/assets/styles/fedex.scss";
import App from "./App";
import store from "./store";
import router from "./router";
import i18n from "@/assets/languages";
import permission from "./directive/permission";
import "./assets/icons"; // icon
import "./permission"; // permission control
import {
parseTime,
resetForm,
addDateRange,
selectDictLabel,
selectDictLabels,
download,
handleTree,
hscodeElementInfo,
elementTostring,
numberRound,
detailUnitConversion,
setDict,
sendNotificationHandler,
promptMessage,
upDateTokenTime,
sreachEntryLock,
tableFixedTypeChange,
getDownLoadFileStatus,
approvalPortType,
getSystemOption,
currencySystemDisableType,
imageTaskStatusShowType,
} from "@/utils/iClearExp";
import {
formatDate,
debounce,
alertWarningMsg,
alertSuccessMsg,
alertErrorMsg,
alertInfoMsg,
toHead,
compare,
createRandom,
ctho,
base64ConvertFile,
} from "@/utils/index";
import * as fileDownload from "@/utils/zipdownload.js";
import * as filters from "@/utils/filters.js";
import dictData from "@/utils/dict.js";
import regExp from "@/utils/regExp.js";
import Pagination from "@/components/Pagination";
// 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar";
import Table from "@/components/Table";
import Formitem from "@/components/Formitem";
import EditStep from "@/components/EditStep";
import FedexAlert from "@/components/FedexAlert";
import FedexEdit from "@/components/FedexEdit";
import Tooltip from "@/components/Tooltip";
import InputNodes from "@/components/InputNodes";
import AlterDialog from "@/components/AlterDialog";
import CustomTransfer from "@/components/CustomTransfer";
import CustomForm from "@/components/CustomForm";
import CustomTable from "@/components/CustomTable";
import EditTag from "@/components/EditTag";
import TablePopover from "@/components/TablePopover";
import FormTextareaInput from "@/components/FormTextareaInput";
import VxeUITable from "vxe-table";
import "vxe-table/lib/style.css";
(function () {
if (typeof EventTarget !== "undefined") {
let func = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function (type, fn, capture) {
this.func = func;
if (typeof capture !== "boolean") {
capture = capture || {};
capture.passive = false;
}
this.func(type, fn, capture);
};
}
})();
// 全局方法挂载
Vue.prototype.parseTime = parseTime;
Vue.prototype.resetForm = resetForm;
Vue.prototype.addDateRange = addDateRange;
Vue.prototype.selectDictLabel = selectDictLabel;
Vue.prototype.selectDictLabels = selectDictLabels;
Vue.prototype.download = download;
Vue.prototype.handleTree = handleTree;
Vue.prototype.hscodeElementInfo = hscodeElementInfo;
Vue.prototype.elementTostring = elementTostring;
Vue.prototype.formatDate = formatDate;
Vue.prototype.debounce = debounce;
Vue.prototype.regExp = regExp;
Vue.prototype.numberRound = numberRound;
Vue.prototype.detailUnitConversion = detailUnitConversion;
Vue.prototype.fileDownload = fileDownload;
Vue.prototype.alertWarningMsg = alertWarningMsg;
Vue.prototype.alertSuccessMsg = alertSuccessMsg;
Vue.prototype.alertErrorMsg = alertErrorMsg;
Vue.prototype.alertInfoMsg = alertInfoMsg;
Vue.prototype.toHead = toHead;
Vue.prototype.setDict = setDict;
Vue.prototype.compare = compare;
Vue.prototype.sendNotificationHandler = sendNotificationHandler;
Vue.prototype.promptMessage = promptMessage;
Vue.prototype.createRandom = createRandom;
Vue.prototype.upDateTokenTime = upDateTokenTime;
Vue.prototype.sreachEntryLock = sreachEntryLock;
Vue.prototype.tableFixedTypeChange = tableFixedTypeChange;
Vue.prototype.ctho = ctho;
Vue.prototype.getDownLoadFileStatus = getDownLoadFileStatus;
Vue.prototype.base64ConvertFile = base64ConvertFile;
Vue.prototype.approvalPortType = approvalPortType;
Vue.prototype.getSystemOption = getSystemOption;
Vue.prototype.currencySystemDisableType = currencySystemDisableType;
Vue.prototype.imageTaskStatusShowType = imageTaskStatusShowType;
Vue.prototype.dictData = dictData;
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });
};
Vue.prototype.msgError = function (msg) {
this.$message({ showClose: true, message: msg, type: "error" });
};
Vue.prototype.msgWarning = function (msg) {
this.$message({ showClose: true, message: msg, type: "warning" });
};
Vue.prototype.msgInfo = function (msg) {
this.$message.info(msg);
};
// 全局组件挂载
Vue.component("Pagination", Pagination);
Vue.component("RightToolbar", RightToolbar);
Vue.component("InputNodes", InputNodes);
Vue.component("Table", Table);
Vue.component("Formitem", Formitem);
Vue.component("EditStep", EditStep);
Vue.component("FedexAlert", FedexAlert);
Vue.component("FedexEdit", FedexEdit);
Vue.component("Tooltip", Tooltip);
Vue.component("AlterDialog", AlterDialog);
Vue.component("CustomTransfer", CustomTransfer);
Vue.component("CustomForm", CustomForm);
Vue.component("CustomTable", CustomTable);
Vue.component("EditTag", EditTag);
Vue.component("TablePopover", TablePopover);
Vue.component("FormTextareaInput", FormTextareaInput);
Vue.use(permission);
Vue.use(VxeUITable);
Object.keys(filters).forEach((key) => {
Vue.filter(key, filters[key]);
});
// window.addEventListener('resize', () => {
// // 获取当前的缩放级别
// const currentScale = window.devicePixelRatio;
// // 如果缩放发生变化,输出变化信息
// if (currentScale !== previousScale) {
// console.log(`Zoom changed from ${previousScale} to ${currentScale}`);
// previousScale = currentScale;
// }
// });
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
*/
Vue.use(Element, {
size: localStorage.getItem("size") || "medium", // set element-ui default size
});
Vue.config.productionTip = false;
new Vue({
el: "#app",
router,
store,
i18n,
render: (h) => h(App),
});