fl-web-component 1.3.8 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/fl-web-component.common.js +5 -375
- package/dist/fl-web-component.common.js.map +1 -1
- package/package.json +1 -1
- package/src/main.js +0 -2
- package/src/utils/index.js +382 -1
package/README.md
CHANGED
|
@@ -22291,7 +22291,7 @@ Factory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBCompon
|
|
|
22291
22291
|
/***/ "9224":
|
|
22292
22292
|
/***/ (function(module) {
|
|
22293
22293
|
|
|
22294
|
-
module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"1.3.
|
|
22294
|
+
module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"1.3.11\",\"scripts\":{\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch\",\"watch\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\",\"patches\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.14\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\"},\"eslintConfig\":{\"root\":true,\"env\":{\"node\":true},\"extends\":[\"plugin:vue/essential\",\"eslint:recommended\"],\"parserOptions\":{\"parser\":\"babel-eslint\"},\"rules\":{}},\"browserslist\":[\"> 1%\",\"last 2 versions\",\"not dead\"]}");
|
|
22295
22295
|
|
|
22296
22296
|
/***/ }),
|
|
22297
22297
|
|
|
@@ -29256,7 +29256,7 @@ if (typeof window !== 'undefined') {
|
|
|
29256
29256
|
// Indicate to webpack that this file can be concatenated
|
|
29257
29257
|
/* harmony default export */ var setPublicPath = (null);
|
|
29258
29258
|
|
|
29259
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
29259
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"63a77627-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=67cfa148&scoped=true
|
|
29260
29260
|
var com_graphicsvue_type_template_id_67cfa148_scoped_true_render = function render() {
|
|
29261
29261
|
var _vm = this,
|
|
29262
29262
|
_c = _vm._self._c;
|
|
@@ -62722,7 +62722,7 @@ var component = normalizeComponent(
|
|
|
62722
62722
|
)
|
|
62723
62723
|
|
|
62724
62724
|
/* harmony default export */ var com_graphics = (component.exports);
|
|
62725
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
62725
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"63a77627-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=2fa9e609&scoped=true
|
|
62726
62726
|
var com_flcanvasvue_type_template_id_2fa9e609_scoped_true_render = function render() {
|
|
62727
62727
|
var _vm = this,
|
|
62728
62728
|
_c = _vm._self._c;
|
|
@@ -65941,7 +65941,7 @@ var com_flcanvas_component = normalizeComponent(
|
|
|
65941
65941
|
)
|
|
65942
65942
|
|
|
65943
65943
|
/* harmony default export */ var com_flcanvas = (com_flcanvas_component.exports);
|
|
65944
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
65944
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"63a77627-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
|
|
65945
65945
|
var per_controlvue_type_template_id_f547d5c6_scoped_true_render = function render() {
|
|
65946
65946
|
var _vm = this,
|
|
65947
65947
|
_c = _vm._self._c;
|
|
@@ -66049,7 +66049,7 @@ var per_control_component = normalizeComponent(
|
|
|
66049
66049
|
)
|
|
66050
66050
|
|
|
66051
66051
|
/* harmony default export */ var per_control = (per_control_component.exports);
|
|
66052
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
66052
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"63a77627-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=0ec35ee4&scoped=true
|
|
66053
66053
|
var pidvue_type_template_id_0ec35ee4_scoped_true_render = function render() {
|
|
66054
66054
|
var _vm = this,
|
|
66055
66055
|
_c = _vm._self._c;
|
|
@@ -66272,374 +66272,6 @@ var pid_component = normalizeComponent(
|
|
|
66272
66272
|
// EXTERNAL MODULE: ./package.json
|
|
66273
66273
|
var package_0 = __webpack_require__("9224");
|
|
66274
66274
|
|
|
66275
|
-
// CONCATENATED MODULE: ./src/utils/mini-devtool.js
|
|
66276
|
-
function mini_devtool_typeof(o) { "@babel/helpers - typeof"; return mini_devtool_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, mini_devtool_typeof(o); }
|
|
66277
|
-
// ========= Error & Console Panel (非阻塞右下角显示,包含 console.log 等) =========
|
|
66278
|
-
function installErrorConsolePanel() {
|
|
66279
|
-
// ========== 可配置项 ==========
|
|
66280
|
-
var MAX_ENTRIES = 400;
|
|
66281
|
-
var PANEL_ID = 'js-error-panel';
|
|
66282
|
-
var COLLAPSE_LENGTH = 1200; // 超过多少字符时折叠显示
|
|
66283
|
-
var CAPTURE_CONSOLE = true; // 是否捕获 console.log/info/warn/debug(保留原行为)
|
|
66284
|
-
// ================================
|
|
66285
|
-
|
|
66286
|
-
// 安全 stringify(处理循环引用)
|
|
66287
|
-
function getCircularReplacer() {
|
|
66288
|
-
var seen = new WeakSet();
|
|
66289
|
-
return function (key, value) {
|
|
66290
|
-
if (mini_devtool_typeof(value) === "object" && value !== null) {
|
|
66291
|
-
if (seen.has(value)) return "[Circular]";
|
|
66292
|
-
seen.add(value);
|
|
66293
|
-
}
|
|
66294
|
-
return value;
|
|
66295
|
-
};
|
|
66296
|
-
}
|
|
66297
|
-
function safeStringify(x) {
|
|
66298
|
-
try {
|
|
66299
|
-
if (typeof x === "string") return x;
|
|
66300
|
-
if (x instanceof Error) return x.stack || x.message || String(x);
|
|
66301
|
-
return JSON.stringify(x, getCircularReplacer(), 2);
|
|
66302
|
-
} catch (e) {
|
|
66303
|
-
try {
|
|
66304
|
-
return String(x);
|
|
66305
|
-
} catch (e2) {
|
|
66306
|
-
return "[unstringifiable]";
|
|
66307
|
-
}
|
|
66308
|
-
}
|
|
66309
|
-
}
|
|
66310
|
-
|
|
66311
|
-
// ========== Panel DOM 创建 ==========
|
|
66312
|
-
function createPanel() {
|
|
66313
|
-
if (document.getElementById(PANEL_ID)) return document.getElementById(PANEL_ID);
|
|
66314
|
-
var panel = document.createElement('div');
|
|
66315
|
-
panel.id = PANEL_ID;
|
|
66316
|
-
Object.assign(panel.style, {
|
|
66317
|
-
position: 'fixed',
|
|
66318
|
-
right: '12px',
|
|
66319
|
-
bottom: '12px',
|
|
66320
|
-
width: '460px',
|
|
66321
|
-
maxHeight: '45vh',
|
|
66322
|
-
boxSizing: 'border-box',
|
|
66323
|
-
overflow: 'hidden',
|
|
66324
|
-
zIndex: 2147483647,
|
|
66325
|
-
fontFamily: 'Menlo,Consolas,monospace',
|
|
66326
|
-
fontSize: '12px',
|
|
66327
|
-
color: '#fff',
|
|
66328
|
-
borderRadius: '8px',
|
|
66329
|
-
boxShadow: '0 6px 18px rgba(0,0,0,0.55)',
|
|
66330
|
-
background: 'linear-gradient(180deg, rgba(0,0,0,0.86), rgba(24,24,24,0.86))',
|
|
66331
|
-
display: 'flex',
|
|
66332
|
-
flexDirection: 'column',
|
|
66333
|
-
gap: '6px',
|
|
66334
|
-
padding: '8px'
|
|
66335
|
-
});
|
|
66336
|
-
|
|
66337
|
-
// header
|
|
66338
|
-
var header = document.createElement('div');
|
|
66339
|
-
Object.assign(header.style, {
|
|
66340
|
-
display: 'flex',
|
|
66341
|
-
justifyContent: 'space-between',
|
|
66342
|
-
alignItems: 'center',
|
|
66343
|
-
gap: '8px'
|
|
66344
|
-
});
|
|
66345
|
-
header.innerHTML = "<strong style=\"font-size:13px\">JS Logs / Errors</strong><span style=\"opacity:.7;font-size:11px\">\uFF08\u975E\u963B\u585E\uFF09</span>";
|
|
66346
|
-
var btns = document.createElement('div');
|
|
66347
|
-
var clearBtn = document.createElement('button');
|
|
66348
|
-
clearBtn.textContent = '清空';
|
|
66349
|
-
Object.assign(clearBtn.style, {
|
|
66350
|
-
marginLeft: '6px',
|
|
66351
|
-
cursor: 'pointer',
|
|
66352
|
-
fontSize: '12px'
|
|
66353
|
-
});
|
|
66354
|
-
clearBtn.onclick = function () {
|
|
66355
|
-
entriesContainer.innerHTML = '';
|
|
66356
|
-
entryCount = 0;
|
|
66357
|
-
updateStats();
|
|
66358
|
-
};
|
|
66359
|
-
var toggleBtn = document.createElement('button');
|
|
66360
|
-
toggleBtn.textContent = '隐藏';
|
|
66361
|
-
Object.assign(toggleBtn.style, {
|
|
66362
|
-
cursor: 'pointer',
|
|
66363
|
-
fontSize: '12px'
|
|
66364
|
-
});
|
|
66365
|
-
toggleBtn.onclick = function () {
|
|
66366
|
-
if (entriesContainer.style.display === 'none') {
|
|
66367
|
-
entriesContainer.style.display = '';
|
|
66368
|
-
toggleBtn.textContent = '隐藏';
|
|
66369
|
-
} else {
|
|
66370
|
-
entriesContainer.style.display = 'none';
|
|
66371
|
-
toggleBtn.textContent = '显示';
|
|
66372
|
-
}
|
|
66373
|
-
};
|
|
66374
|
-
var statsSpan = document.createElement('span');
|
|
66375
|
-
statsSpan.style.opacity = '.8';
|
|
66376
|
-
statsSpan.style.fontSize = '11px';
|
|
66377
|
-
statsSpan.textContent = '0 条';
|
|
66378
|
-
btns.appendChild(statsSpan);
|
|
66379
|
-
btns.appendChild(toggleBtn);
|
|
66380
|
-
btns.appendChild(clearBtn);
|
|
66381
|
-
header.appendChild(btns);
|
|
66382
|
-
|
|
66383
|
-
// entries container (scrollable)
|
|
66384
|
-
var entriesContainer = document.createElement('div');
|
|
66385
|
-
Object.assign(entriesContainer.style, {
|
|
66386
|
-
overflowY: 'auto',
|
|
66387
|
-
padding: '6px',
|
|
66388
|
-
borderRadius: '6px',
|
|
66389
|
-
background: 'rgba(0,0,0,0.32)',
|
|
66390
|
-
maxHeight: 'calc(45vh - 48px)',
|
|
66391
|
-
boxSizing: 'border-box'
|
|
66392
|
-
});
|
|
66393
|
-
panel.appendChild(header);
|
|
66394
|
-
panel.appendChild(entriesContainer);
|
|
66395
|
-
document.body.appendChild(panel);
|
|
66396
|
-
|
|
66397
|
-
// helper to update stats
|
|
66398
|
-
function updateStats() {
|
|
66399
|
-
statsSpan.textContent = "".concat(entryCount, " \u6761");
|
|
66400
|
-
}
|
|
66401
|
-
panel._entriesContainer = entriesContainer;
|
|
66402
|
-
panel._statsUpdater = updateStats;
|
|
66403
|
-
return panel;
|
|
66404
|
-
}
|
|
66405
|
-
|
|
66406
|
-
// ========== 添加条目 ==========
|
|
66407
|
-
var entryCount = 0;
|
|
66408
|
-
function addEntry(_ref) {
|
|
66409
|
-
var _ref$type = _ref.type,
|
|
66410
|
-
type = _ref$type === void 0 ? 'log' : _ref$type,
|
|
66411
|
-
_ref$message = _ref.message,
|
|
66412
|
-
message = _ref$message === void 0 ? '' : _ref$message,
|
|
66413
|
-
_ref$time = _ref.time,
|
|
66414
|
-
time = _ref$time === void 0 ? new Date().toLocaleString() : _ref$time,
|
|
66415
|
-
_ref$meta = _ref.meta,
|
|
66416
|
-
meta = _ref$meta === void 0 ? null : _ref$meta;
|
|
66417
|
-
var panel = createPanel();
|
|
66418
|
-
var entriesContainer = panel._entriesContainer;
|
|
66419
|
-
var updateStats = panel._statsUpdater;
|
|
66420
|
-
|
|
66421
|
-
// 限制数量
|
|
66422
|
-
if (entryCount >= MAX_ENTRIES) {
|
|
66423
|
-
var first = entriesContainer.firstChild;
|
|
66424
|
-
if (first) entriesContainer.removeChild(first);
|
|
66425
|
-
entryCount--;
|
|
66426
|
-
}
|
|
66427
|
-
var entry = document.createElement('div');
|
|
66428
|
-
Object.assign(entry.style, {
|
|
66429
|
-
padding: '6px',
|
|
66430
|
-
marginBottom: '6px',
|
|
66431
|
-
borderRadius: '6px',
|
|
66432
|
-
background: 'rgba(255,255,255,0.03)'
|
|
66433
|
-
});
|
|
66434
|
-
var header = document.createElement('div');
|
|
66435
|
-
header.style.display = 'flex';
|
|
66436
|
-
header.style.justifyContent = 'space-between';
|
|
66437
|
-
header.style.alignItems = 'center';
|
|
66438
|
-
header.style.gap = '8px';
|
|
66439
|
-
var left = document.createElement('div');
|
|
66440
|
-
// 彩色 type 标签
|
|
66441
|
-
var colorMap = {
|
|
66442
|
-
error: '#ff6b6b',
|
|
66443
|
-
'window.onerror': '#ff6b6b',
|
|
66444
|
-
resource: '#ff9966',
|
|
66445
|
-
'unhandledrejection': '#ff8c66',
|
|
66446
|
-
'console.error': '#ff6b6b',
|
|
66447
|
-
'console.warn': '#ffd966',
|
|
66448
|
-
'console.info': '#66bfff',
|
|
66449
|
-
'console.log': '#bfbfbf',
|
|
66450
|
-
'console.debug': '#a0a0a0',
|
|
66451
|
-
'Vue.error (2)': '#ff6b6b',
|
|
66452
|
-
'Vue.error (3)': '#ff6b6b'
|
|
66453
|
-
};
|
|
66454
|
-
var tagColor = colorMap[type] || '#bfbfbf';
|
|
66455
|
-
left.innerHTML = "<span style=\"font-weight:700;color:".concat(tagColor, "\">").concat(type, "</span> <span style=\"opacity:.7;font-size:11px\"> ").concat(time, "</span>");
|
|
66456
|
-
var right = document.createElement('div');
|
|
66457
|
-
right.style.display = 'flex';
|
|
66458
|
-
right.style.gap = '6px';
|
|
66459
|
-
var copyBtn = document.createElement('button');
|
|
66460
|
-
copyBtn.textContent = '复制';
|
|
66461
|
-
Object.assign(copyBtn.style, {
|
|
66462
|
-
cursor: 'pointer',
|
|
66463
|
-
fontSize: '11px'
|
|
66464
|
-
});
|
|
66465
|
-
var expandBtn = document.createElement('button');
|
|
66466
|
-
expandBtn.textContent = '展开';
|
|
66467
|
-
Object.assign(expandBtn.style, {
|
|
66468
|
-
cursor: 'pointer',
|
|
66469
|
-
fontSize: '11px'
|
|
66470
|
-
});
|
|
66471
|
-
right.appendChild(copyBtn);
|
|
66472
|
-
right.appendChild(expandBtn);
|
|
66473
|
-
header.appendChild(left);
|
|
66474
|
-
header.appendChild(right);
|
|
66475
|
-
var content = document.createElement('pre');
|
|
66476
|
-
Object.assign(content.style, {
|
|
66477
|
-
whiteSpace: 'pre-wrap',
|
|
66478
|
-
wordBreak: 'break-word',
|
|
66479
|
-
margin: '6px 0 0 0',
|
|
66480
|
-
maxHeight: '240px',
|
|
66481
|
-
overflow: 'auto',
|
|
66482
|
-
fontSize: '12px',
|
|
66483
|
-
lineHeight: '1.3',
|
|
66484
|
-
display: 'block'
|
|
66485
|
-
});
|
|
66486
|
-
|
|
66487
|
-
// 合成文本(message + meta)
|
|
66488
|
-
var txt = typeof message === 'string' ? message : safeStringify(message);
|
|
66489
|
-
if (meta) {
|
|
66490
|
-
try {
|
|
66491
|
-
var metaStr = safeStringify(meta);
|
|
66492
|
-
txt = "".concat(txt, "\n\n[meta]\n").concat(metaStr);
|
|
66493
|
-
} catch (e) {}
|
|
66494
|
-
}
|
|
66495
|
-
var fullText = txt;
|
|
66496
|
-
if (txt.length > COLLAPSE_LENGTH) {
|
|
66497
|
-
content.textContent = txt.slice(0, COLLAPSE_LENGTH) + '\n\n...(已折叠,点击展开查看全部)';
|
|
66498
|
-
expandBtn.onclick = function () {
|
|
66499
|
-
content.textContent = fullText;
|
|
66500
|
-
expandBtn.style.display = 'none';
|
|
66501
|
-
entriesContainer.scrollTop = entriesContainer.scrollHeight;
|
|
66502
|
-
};
|
|
66503
|
-
} else {
|
|
66504
|
-
content.textContent = txt;
|
|
66505
|
-
expandBtn.style.display = 'none';
|
|
66506
|
-
}
|
|
66507
|
-
copyBtn.onclick = function () {
|
|
66508
|
-
try {
|
|
66509
|
-
navigator.clipboard.writeText(fullText);
|
|
66510
|
-
} catch (e) {
|
|
66511
|
-
try {
|
|
66512
|
-
prompt('复制文本:Ctrl+C, Enter', fullText);
|
|
66513
|
-
} catch (ee) {}
|
|
66514
|
-
}
|
|
66515
|
-
};
|
|
66516
|
-
entry.appendChild(header);
|
|
66517
|
-
entry.appendChild(content);
|
|
66518
|
-
entriesContainer.appendChild(entry);
|
|
66519
|
-
entryCount++;
|
|
66520
|
-
updateStats();
|
|
66521
|
-
|
|
66522
|
-
// 自动滚到底部
|
|
66523
|
-
entriesContainer.scrollTop = entriesContainer.scrollHeight;
|
|
66524
|
-
}
|
|
66525
|
-
|
|
66526
|
-
// 报告包装
|
|
66527
|
-
function report(obj) {
|
|
66528
|
-
try {
|
|
66529
|
-
addEntry({
|
|
66530
|
-
type: obj.type || 'log',
|
|
66531
|
-
message: obj.message || safeStringify(obj),
|
|
66532
|
-
time: new Date().toLocaleString(),
|
|
66533
|
-
meta: obj.meta || null
|
|
66534
|
-
});
|
|
66535
|
-
} catch (e) {
|
|
66536
|
-
console.warn('Error panel report failed', e);
|
|
66537
|
-
}
|
|
66538
|
-
}
|
|
66539
|
-
|
|
66540
|
-
// ========== 捕获逻辑 ==========
|
|
66541
|
-
|
|
66542
|
-
// 传统同步错误
|
|
66543
|
-
window.onerror = function (message, source, lineno, colno, error) {
|
|
66544
|
-
var msg = "".concat(message, "\n at ").concat(source, ":").concat(lineno, ":").concat(colno, "\n").concat(error && error.stack ? error.stack : '');
|
|
66545
|
-
report({
|
|
66546
|
-
type: 'window.onerror',
|
|
66547
|
-
message: msg
|
|
66548
|
-
});
|
|
66549
|
-
return false;
|
|
66550
|
-
};
|
|
66551
|
-
|
|
66552
|
-
// 资源加载错误(图片/script/css 等)
|
|
66553
|
-
window.addEventListener('error', function (event) {
|
|
66554
|
-
var target = event.target || event.srcElement;
|
|
66555
|
-
if (target && (target.src || target.href)) {
|
|
66556
|
-
var tag = target.tagName;
|
|
66557
|
-
var url = target.src || target.href;
|
|
66558
|
-
report({
|
|
66559
|
-
type: 'resource',
|
|
66560
|
-
message: "Failed to load resource: <".concat(tag, "> ").concat(url)
|
|
66561
|
-
});
|
|
66562
|
-
}
|
|
66563
|
-
}, true);
|
|
66564
|
-
|
|
66565
|
-
// 未处理的 Promise 拒绝
|
|
66566
|
-
window.addEventListener('unhandledrejection', function (event) {
|
|
66567
|
-
report({
|
|
66568
|
-
type: 'unhandledrejection',
|
|
66569
|
-
message: safeStringify(event.reason)
|
|
66570
|
-
});
|
|
66571
|
-
});
|
|
66572
|
-
|
|
66573
|
-
// 捕获 console.*(可选)
|
|
66574
|
-
if (CAPTURE_CONSOLE && typeof console !== 'undefined') {
|
|
66575
|
-
var methods = ['log', 'info', 'warn', 'error', 'debug'];
|
|
66576
|
-
methods.forEach(function (m) {
|
|
66577
|
-
if (!(m in console)) return;
|
|
66578
|
-
var orig = console[m].bind(console);
|
|
66579
|
-
console[m] = function () {
|
|
66580
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
66581
|
-
args[_key] = arguments[_key];
|
|
66582
|
-
}
|
|
66583
|
-
try {
|
|
66584
|
-
// 生成调用栈(方便定位是谁调用了 console)
|
|
66585
|
-
var stack = null;
|
|
66586
|
-
try {
|
|
66587
|
-
var err = new Error();
|
|
66588
|
-
if (err.stack) {
|
|
66589
|
-
// 移除前两行(Error + 本函数)
|
|
66590
|
-
stack = err.stack.split('\n').slice(2).join('\n');
|
|
66591
|
-
}
|
|
66592
|
-
} catch (e) {
|
|
66593
|
-
stack = null;
|
|
66594
|
-
}
|
|
66595
|
-
var payload = {
|
|
66596
|
-
type: "console.".concat(m),
|
|
66597
|
-
message: args.map(function (a) {
|
|
66598
|
-
return safeStringify(a);
|
|
66599
|
-
}).join(' '),
|
|
66600
|
-
meta: stack
|
|
66601
|
-
};
|
|
66602
|
-
report(payload);
|
|
66603
|
-
} catch (e) {
|
|
66604
|
-
// noop
|
|
66605
|
-
}
|
|
66606
|
-
// 保持原有行为
|
|
66607
|
-
try {
|
|
66608
|
-
orig.apply(void 0, args);
|
|
66609
|
-
} catch (e) {}
|
|
66610
|
-
};
|
|
66611
|
-
});
|
|
66612
|
-
}
|
|
66613
|
-
|
|
66614
|
-
// Vue 2 支持(若使用全局 Vue)
|
|
66615
|
-
if (typeof Vue !== 'undefined' && Vue && Vue.config) {
|
|
66616
|
-
try {
|
|
66617
|
-
Vue.config.errorHandler = function (err, vm, info) {
|
|
66618
|
-
report({
|
|
66619
|
-
type: 'Vue.error (2)',
|
|
66620
|
-
message: "".concat(info, "\n").concat(err && err.stack ? err.stack : safeStringify(err))
|
|
66621
|
-
});
|
|
66622
|
-
};
|
|
66623
|
-
} catch (e) {/* ignore */}
|
|
66624
|
-
}
|
|
66625
|
-
|
|
66626
|
-
// Vue 3 注册函数(在 main.js 创建 app 后调用)
|
|
66627
|
-
window.registerVue3ErrorHandler = function (app) {
|
|
66628
|
-
if (!app || !app.config) return;
|
|
66629
|
-
app.config.errorHandler = function (err, instance, info) {
|
|
66630
|
-
report({
|
|
66631
|
-
type: 'Vue.error (3)',
|
|
66632
|
-
message: "".concat(info, "\n").concat(err && err.stack ? err.stack : safeStringify(err))
|
|
66633
|
-
});
|
|
66634
|
-
};
|
|
66635
|
-
};
|
|
66636
|
-
|
|
66637
|
-
// 立即创建 panel(或可改为按需)
|
|
66638
|
-
if (document.readyState === 'loading') {
|
|
66639
|
-
document.addEventListener('DOMContentLoaded', createPanel);
|
|
66640
|
-
} else createPanel();
|
|
66641
|
-
}
|
|
66642
|
-
// ========= End Panel =========
|
|
66643
66275
|
// CONCATENATED MODULE: ./src/main.js
|
|
66644
66276
|
|
|
66645
66277
|
|
|
@@ -66647,7 +66279,6 @@ function installErrorConsolePanel() {
|
|
|
66647
66279
|
|
|
66648
66280
|
|
|
66649
66281
|
|
|
66650
|
-
|
|
66651
66282
|
var components = [com_graphics, com_flcanvas, per_control, pid];
|
|
66652
66283
|
var main_install = function install(Vue) {
|
|
66653
66284
|
Vue.prototype.THREE = three_module_namespaceObject;
|
|
@@ -66659,7 +66290,6 @@ var main_install = function install(Vue) {
|
|
|
66659
66290
|
// 支持浏览器环境直接引入
|
|
66660
66291
|
if (typeof window !== 'undefined') {
|
|
66661
66292
|
window.FLVersion = package_0.version;
|
|
66662
|
-
window.FLDevTools = installErrorConsolePanel;
|
|
66663
66293
|
}
|
|
66664
66294
|
/* harmony default export */ var main = ({
|
|
66665
66295
|
install: main_install,
|