|
@@ -1,3 +1,6 @@
|
|
|
|
+import { throttle } from "lodash";
|
|
|
|
+import { createLog } from "./logger";
|
|
|
|
+
|
|
export function toChineseNumber(num) {
|
|
export function toChineseNumber(num) {
|
|
let ret;
|
|
let ret;
|
|
if (num < 10) {
|
|
if (num < 10) {
|
|
@@ -35,6 +38,26 @@ export function isElectron() {
|
|
return typeof nodeRequire != "undefined";
|
|
return typeof nodeRequire != "undefined";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+export function registerOnResize() {
|
|
|
|
+ const throttledResizeLog = throttle(() => {
|
|
|
|
+ createLog({
|
|
|
|
+ page: window.location.pathname,
|
|
|
|
+ action: "registerOnResize",
|
|
|
|
+ width: window.screen.width,
|
|
|
|
+ height: window.screen.height,
|
|
|
|
+ screenX: window.screen.availWidth,
|
|
|
|
+ screenY: window.screen.availHeight,
|
|
|
|
+ clientWidth: document.documentElement.clientWidth,
|
|
|
|
+ clientHeight: document.documentElement.clientHeight,
|
|
|
|
+ windowInnerWidth: window.innerWidth,
|
|
|
|
+ windowInnerHeight: window.innerHeight,
|
|
|
|
+ windowOuterWidth: window.outerWidth,
|
|
|
|
+ windowOuterHeight: window.outerHeight,
|
|
|
|
+ });
|
|
|
|
+ }, 3000);
|
|
|
|
+ window.onresize = throttledResizeLog;
|
|
|
|
+}
|
|
|
|
+
|
|
// 下载文件
|
|
// 下载文件
|
|
export async function downloadFileURL(url, name) {
|
|
export async function downloadFileURL(url, name) {
|
|
const link = document.createElement("a");
|
|
const link = document.createElement("a");
|