mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 12:35:07 +08:00
# Conflicts: # jsowell-ui/.env.development # jsowell-ui/.env.staging # jsowell-ui/bin/build-sit.bat # jsowell-ui/bin/build.bat # jsowell-ui/src/api/adapayMember/adapayMember.js # jsowell-ui/src/api/pile/merchant.js # jsowell-ui/src/router/index.js # jsowell-ui/src/views/financial/financeDetail.vue # jsowell-ui/src/views/financial/merchant.vue # jsowell-ui/src/views/homeIndex/homeIndex.vue # jsowell-ui/src/views/login.vue # jsowell-ui/src/views/pile/basic/detail.vue # jsowell-ui/src/views/pile/station/components/SiteInfo.vue # jsowell-ui/src/views/pile/station/detail.vue # jsowell-ui/src/views/pile/station/orderReport.vue
75 lines
1.4 KiB
JavaScript
75 lines
1.4 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
|
var _gzipSize = _interopRequireDefault(require("gzip-size"));
|
|
|
|
var _Node = _interopRequireDefault(require("./Node"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
class Module extends _Node.default {
|
|
constructor(name, data, parent) {
|
|
super(name, parent);
|
|
this.data = data;
|
|
}
|
|
|
|
get src() {
|
|
return this.data.parsedSrc;
|
|
}
|
|
|
|
set src(value) {
|
|
this.data.parsedSrc = value;
|
|
delete this._gzipSize;
|
|
}
|
|
|
|
get size() {
|
|
return this.data.size;
|
|
}
|
|
|
|
set size(value) {
|
|
this.data.size = value;
|
|
}
|
|
|
|
get parsedSize() {
|
|
return this.src ? this.src.length : undefined;
|
|
}
|
|
|
|
get gzipSize() {
|
|
if (!_lodash.default.has(this, '_gzipSize')) {
|
|
this._gzipSize = this.src ? _gzipSize.default.sync(this.src) : undefined;
|
|
}
|
|
|
|
return this._gzipSize;
|
|
}
|
|
|
|
mergeData(data) {
|
|
if (data.size) {
|
|
this.size += data.size;
|
|
}
|
|
|
|
if (data.parsedSrc) {
|
|
this.src = (this.src || '') + data.parsedSrc;
|
|
}
|
|
}
|
|
|
|
toChartData() {
|
|
return {
|
|
id: this.data.id,
|
|
label: this.name,
|
|
path: this.path,
|
|
statSize: this.size,
|
|
parsedSize: this.parsedSize,
|
|
gzipSize: this.gzipSize
|
|
};
|
|
}
|
|
|
|
}
|
|
|
|
exports.default = Module;
|
|
; |