@ibiz-template/runtime 0.7.41-alpha.30 → 0.7.41-alpha.32
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/dist/index.esm.js +3299 -375
- package/dist/index.system.min.js +1 -1
- package/out/app-hub.d.ts +31 -1
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +44 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +2 -0
- package/out/controller/control/report-panel/generator/base-generator.d.ts +17 -0
- package/out/controller/control/report-panel/generator/base-generator.d.ts.map +1 -1
- package/out/controller/control/report-panel/generator/base-generator.js +9 -0
- package/out/controller/control/report-panel/generator/bi-converter/area-converter.d.ts +33 -0
- package/out/controller/control/report-panel/generator/bi-converter/area-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/area-converter.js +105 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/bar-converter-base.d.ts +36 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/bar-converter-base.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/bar-converter-base.js +104 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/converter-base.d.ts +74 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/converter-base.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/converter-base.js +80 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/echart-converter-base.d.ts +100 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/echart-converter-base.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/echart-converter-base.js +430 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/grid-converter-base.d.ts +39 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/grid-converter-base.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/grid-converter-base.js +180 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/index.d.ts +6 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/index.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/index.js +5 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/multi-series-converter.d.ts +21 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/multi-series-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/multi-series-converter.js +49 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/zone-converter-base.d.ts +38 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/zone-converter-base.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/base/zone-converter-base.js +97 -0
- package/out/controller/control/report-panel/generator/bi-converter/converter-factory.d.ts +32 -0
- package/out/controller/control/report-panel/generator/bi-converter/converter-factory.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/converter-factory.js +79 -0
- package/out/controller/control/report-panel/generator/bi-converter/cross-table-converter.d.ts +126 -0
- package/out/controller/control/report-panel/generator/bi-converter/cross-table-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/cross-table-converter.js +338 -0
- package/out/controller/control/report-panel/generator/bi-converter/gauge-converter.d.ts +49 -0
- package/out/controller/control/report-panel/generator/bi-converter/gauge-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/gauge-converter.js +167 -0
- package/out/controller/control/report-panel/generator/bi-converter/grid-converter.d.ts +40 -0
- package/out/controller/control/report-panel/generator/bi-converter/grid-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/grid-converter.js +114 -0
- package/out/controller/control/report-panel/generator/bi-converter/index.d.ts +17 -0
- package/out/controller/control/report-panel/generator/bi-converter/index.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/index.js +16 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-bar-converter.d.ts +22 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-bar-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-bar-converter.js +86 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-col-converter.d.ts +22 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-col-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-col-converter.js +86 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-line-converter.d.ts +30 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-line-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/multi-series-line-converter.js +103 -0
- package/out/controller/control/report-panel/generator/bi-converter/number-converter.d.ts +21 -0
- package/out/controller/control/report-panel/generator/bi-converter/number-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/number-converter.js +32 -0
- package/out/controller/control/report-panel/generator/bi-converter/pie-converter.d.ts +41 -0
- package/out/controller/control/report-panel/generator/bi-converter/pie-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/pie-converter.js +135 -0
- package/out/controller/control/report-panel/generator/bi-converter/radar-converter.d.ts +41 -0
- package/out/controller/control/report-panel/generator/bi-converter/radar-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/radar-converter.js +127 -0
- package/out/controller/control/report-panel/generator/bi-converter/scatter-converter.d.ts +30 -0
- package/out/controller/control/report-panel/generator/bi-converter/scatter-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/scatter-converter.js +100 -0
- package/out/controller/control/report-panel/generator/bi-converter/stack-bar-converter.d.ts +33 -0
- package/out/controller/control/report-panel/generator/bi-converter/stack-bar-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/stack-bar-converter.js +106 -0
- package/out/controller/control/report-panel/generator/bi-converter/stack-col-converter.d.ts +33 -0
- package/out/controller/control/report-panel/generator/bi-converter/stack-col-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/stack-col-converter.js +106 -0
- package/out/controller/control/report-panel/generator/bi-converter/utils/chart-util.d.ts +30 -0
- package/out/controller/control/report-panel/generator/bi-converter/utils/chart-util.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/utils/chart-util.js +83 -0
- package/out/controller/control/report-panel/generator/bi-converter/utils/index.d.ts +2 -0
- package/out/controller/control/report-panel/generator/bi-converter/utils/index.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/utils/index.js +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/zone-col-converter.d.ts +22 -0
- package/out/controller/control/report-panel/generator/bi-converter/zone-col-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/zone-col-converter.js +86 -0
- package/out/controller/control/report-panel/generator/bi-converter/zone-line-converter.d.ts +22 -0
- package/out/controller/control/report-panel/generator/bi-converter/zone-line-converter.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/bi-converter/zone-line-converter.js +86 -0
- package/out/controller/control/report-panel/generator/bi-generator.d.ts +31 -16
- package/out/controller/control/report-panel/generator/bi-generator.d.ts.map +1 -1
- package/out/controller/control/report-panel/generator/bi-generator.js +38 -19
- package/out/controller/control/report-panel/generator/index.d.ts +6 -0
- package/out/controller/control/report-panel/generator/index.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/index.js +5 -0
- package/out/controller/control/report-panel/index.d.ts +1 -0
- package/out/controller/control/report-panel/index.d.ts.map +1 -1
- package/out/controller/control/report-panel/index.js +1 -0
- package/out/controller/control/report-panel/report-panel.controller.d.ts +36 -43
- package/out/controller/control/report-panel/report-panel.controller.d.ts.map +1 -1
- package/out/controller/control/report-panel/report-panel.controller.js +109 -80
- package/out/controller/control/report-panel/report-panel.service.d.ts +7 -12
- package/out/controller/control/report-panel/report-panel.service.d.ts.map +1 -1
- package/out/controller/control/report-panel/report-panel.service.js +8 -6
- package/out/interface/api/state/control/i-api-report-panel.state.d.ts +2 -9
- package/out/interface/api/state/control/i-api-report-panel.state.d.ts.map +1 -1
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +19 -1
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-report-panel.state.d.ts +22 -0
- package/out/interface/controller/state/control/i-report-panel.state.d.ts.map +1 -1
- package/out/interface/provider/model-loader.provider.d.ts +8 -1
- package/out/interface/provider/model-loader.provider.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.d.ts +7 -0
- package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.js +17 -1
- package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.js +7 -3
- package/out/utils/theme-util/theme-util.d.ts +6 -0
- package/out/utils/theme-util/theme-util.d.ts.map +1 -1
- package/out/utils/theme-util/theme-util.js +8 -0
- package/out/utils/water-mark-util/water-mark-util.d.ts.map +1 -1
- package/out/utils/water-mark-util/water-mark-util.js +11 -3
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -16821,25 +16821,25 @@ var require_html2canvas = __commonJS({
|
|
|
16821
16821
|
if (isStyleElement(node)) {
|
|
16822
16822
|
return this.createStyleClone(node);
|
|
16823
16823
|
}
|
|
16824
|
-
var
|
|
16825
|
-
if (isImageElement(
|
|
16824
|
+
var clone61 = node.cloneNode(false);
|
|
16825
|
+
if (isImageElement(clone61)) {
|
|
16826
16826
|
if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) {
|
|
16827
|
-
|
|
16828
|
-
|
|
16827
|
+
clone61.src = node.currentSrc;
|
|
16828
|
+
clone61.srcset = "";
|
|
16829
16829
|
}
|
|
16830
|
-
if (
|
|
16831
|
-
|
|
16830
|
+
if (clone61.loading === "lazy") {
|
|
16831
|
+
clone61.loading = "eager";
|
|
16832
16832
|
}
|
|
16833
16833
|
}
|
|
16834
|
-
if (isCustomElement(
|
|
16835
|
-
return this.createCustomElementClone(
|
|
16834
|
+
if (isCustomElement(clone61)) {
|
|
16835
|
+
return this.createCustomElementClone(clone61);
|
|
16836
16836
|
}
|
|
16837
|
-
return
|
|
16837
|
+
return clone61;
|
|
16838
16838
|
};
|
|
16839
16839
|
DocumentCloner2.prototype.createCustomElementClone = function(node) {
|
|
16840
|
-
var
|
|
16841
|
-
copyCSSStyles(node.style,
|
|
16842
|
-
return
|
|
16840
|
+
var clone61 = document.createElement("html2canvascustomelement");
|
|
16841
|
+
copyCSSStyles(node.style, clone61);
|
|
16842
|
+
return clone61;
|
|
16843
16843
|
};
|
|
16844
16844
|
DocumentCloner2.prototype.createStyleClone = function(node) {
|
|
16845
16845
|
try {
|
|
@@ -16921,25 +16921,25 @@ var require_html2canvas = __commonJS({
|
|
|
16921
16921
|
blankCanvas.height = video.offsetHeight;
|
|
16922
16922
|
return blankCanvas;
|
|
16923
16923
|
};
|
|
16924
|
-
DocumentCloner2.prototype.appendChildNode = function(
|
|
16924
|
+
DocumentCloner2.prototype.appendChildNode = function(clone61, child, copyStyles) {
|
|
16925
16925
|
if (!isElementNode(child) || !isScriptElement(child) && !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== "function" || !this.options.ignoreElements(child))) {
|
|
16926
16926
|
if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {
|
|
16927
|
-
|
|
16927
|
+
clone61.appendChild(this.cloneNode(child, copyStyles));
|
|
16928
16928
|
}
|
|
16929
16929
|
}
|
|
16930
16930
|
};
|
|
16931
|
-
DocumentCloner2.prototype.cloneChildNodes = function(node,
|
|
16931
|
+
DocumentCloner2.prototype.cloneChildNodes = function(node, clone61, copyStyles) {
|
|
16932
16932
|
var _this = this;
|
|
16933
16933
|
for (var child = node.shadowRoot ? node.shadowRoot.firstChild : node.firstChild; child; child = child.nextSibling) {
|
|
16934
16934
|
if (isElementNode(child) && isSlotElement(child) && typeof child.assignedNodes === "function") {
|
|
16935
16935
|
var assignedNodes = child.assignedNodes();
|
|
16936
16936
|
if (assignedNodes.length) {
|
|
16937
16937
|
assignedNodes.forEach(function(assignedNode) {
|
|
16938
|
-
return _this.appendChildNode(
|
|
16938
|
+
return _this.appendChildNode(clone61, assignedNode, copyStyles);
|
|
16939
16939
|
});
|
|
16940
16940
|
}
|
|
16941
16941
|
} else {
|
|
16942
|
-
this.appendChildNode(
|
|
16942
|
+
this.appendChildNode(clone61, child, copyStyles);
|
|
16943
16943
|
}
|
|
16944
16944
|
}
|
|
16945
16945
|
};
|
|
@@ -16952,53 +16952,53 @@ var require_html2canvas = __commonJS({
|
|
|
16952
16952
|
}
|
|
16953
16953
|
var window2 = node.ownerDocument.defaultView;
|
|
16954
16954
|
if (window2 && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) {
|
|
16955
|
-
var
|
|
16956
|
-
|
|
16955
|
+
var clone61 = this.createElementClone(node);
|
|
16956
|
+
clone61.style.transitionProperty = "none";
|
|
16957
16957
|
var style = window2.getComputedStyle(node);
|
|
16958
16958
|
var styleBefore = window2.getComputedStyle(node, ":before");
|
|
16959
16959
|
var styleAfter = window2.getComputedStyle(node, ":after");
|
|
16960
|
-
if (this.referenceElement === node && isHTMLElementNode(
|
|
16961
|
-
this.clonedReferenceElement =
|
|
16960
|
+
if (this.referenceElement === node && isHTMLElementNode(clone61)) {
|
|
16961
|
+
this.clonedReferenceElement = clone61;
|
|
16962
16962
|
}
|
|
16963
|
-
if (isBodyElement(
|
|
16964
|
-
createPseudoHideStyles(
|
|
16963
|
+
if (isBodyElement(clone61)) {
|
|
16964
|
+
createPseudoHideStyles(clone61);
|
|
16965
16965
|
}
|
|
16966
16966
|
var counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));
|
|
16967
|
-
var before = this.resolvePseudoContent(node,
|
|
16967
|
+
var before = this.resolvePseudoContent(node, clone61, styleBefore, PseudoElementType.BEFORE);
|
|
16968
16968
|
if (isCustomElement(node)) {
|
|
16969
16969
|
copyStyles = true;
|
|
16970
16970
|
}
|
|
16971
16971
|
if (!isVideoElement(node)) {
|
|
16972
|
-
this.cloneChildNodes(node,
|
|
16972
|
+
this.cloneChildNodes(node, clone61, copyStyles);
|
|
16973
16973
|
}
|
|
16974
16974
|
if (before) {
|
|
16975
|
-
|
|
16975
|
+
clone61.insertBefore(before, clone61.firstChild);
|
|
16976
16976
|
}
|
|
16977
|
-
var after = this.resolvePseudoContent(node,
|
|
16977
|
+
var after = this.resolvePseudoContent(node, clone61, styleAfter, PseudoElementType.AFTER);
|
|
16978
16978
|
if (after) {
|
|
16979
|
-
|
|
16979
|
+
clone61.appendChild(after);
|
|
16980
16980
|
}
|
|
16981
16981
|
this.counters.pop(counters);
|
|
16982
16982
|
if (style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node) || copyStyles) {
|
|
16983
|
-
copyCSSStyles(style,
|
|
16983
|
+
copyCSSStyles(style, clone61);
|
|
16984
16984
|
}
|
|
16985
16985
|
if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
|
|
16986
|
-
this.scrolledElements.push([
|
|
16986
|
+
this.scrolledElements.push([clone61, node.scrollLeft, node.scrollTop]);
|
|
16987
16987
|
}
|
|
16988
|
-
if ((isTextareaElement(node) || isSelectElement(node)) && (isTextareaElement(
|
|
16989
|
-
|
|
16988
|
+
if ((isTextareaElement(node) || isSelectElement(node)) && (isTextareaElement(clone61) || isSelectElement(clone61))) {
|
|
16989
|
+
clone61.value = node.value;
|
|
16990
16990
|
}
|
|
16991
|
-
return
|
|
16991
|
+
return clone61;
|
|
16992
16992
|
}
|
|
16993
16993
|
return node.cloneNode(false);
|
|
16994
16994
|
};
|
|
16995
|
-
DocumentCloner2.prototype.resolvePseudoContent = function(node,
|
|
16995
|
+
DocumentCloner2.prototype.resolvePseudoContent = function(node, clone61, style, pseudoElt) {
|
|
16996
16996
|
var _this = this;
|
|
16997
16997
|
if (!style) {
|
|
16998
16998
|
return;
|
|
16999
16999
|
}
|
|
17000
17000
|
var value = style.content;
|
|
17001
|
-
var document2 =
|
|
17001
|
+
var document2 = clone61.ownerDocument;
|
|
17002
17002
|
if (!document2 || !value || value === "none" || value === "-moz-alt-content" || style.display === "none") {
|
|
17003
17003
|
return;
|
|
17004
17004
|
}
|
|
@@ -17055,10 +17055,10 @@ var require_html2canvas = __commonJS({
|
|
|
17055
17055
|
});
|
|
17056
17056
|
anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
|
|
17057
17057
|
var newClassName = pseudoElt === PseudoElementType.BEFORE ? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
|
|
17058
|
-
if (isSVGElementNode(
|
|
17059
|
-
|
|
17058
|
+
if (isSVGElementNode(clone61)) {
|
|
17059
|
+
clone61.className.baseValue += newClassName;
|
|
17060
17060
|
} else {
|
|
17061
|
-
|
|
17061
|
+
clone61.className += newClassName;
|
|
17062
17062
|
}
|
|
17063
17063
|
return anonymousReplacedElement;
|
|
17064
17064
|
};
|
|
@@ -22792,7 +22792,7 @@ var TextUtil = class {
|
|
|
22792
22792
|
};
|
|
22793
22793
|
|
|
22794
22794
|
// src/utils/theme-util/theme-util.ts
|
|
22795
|
-
import { clone as
|
|
22795
|
+
import { clone as clone55 } from "ramda";
|
|
22796
22796
|
|
|
22797
22797
|
// src/utils/theme-util/custom-theme-util.ts
|
|
22798
22798
|
import { notNilEmpty as notNilEmpty7 } from "qx-util";
|
|
@@ -27681,6 +27681,13 @@ var CodeListService = class {
|
|
|
27681
27681
|
* @type {Map<string, CodeListItem[]>}
|
|
27682
27682
|
*/
|
|
27683
27683
|
this.cache = /* @__PURE__ */ new Map();
|
|
27684
|
+
/**
|
|
27685
|
+
* 已合并子应用代码表标识缓存
|
|
27686
|
+
*
|
|
27687
|
+
* @protected
|
|
27688
|
+
* @type {Map<string, DynamicCodeListCache>}
|
|
27689
|
+
*/
|
|
27690
|
+
this.mergedSubCodeListCache = [];
|
|
27684
27691
|
}
|
|
27685
27692
|
/**
|
|
27686
27693
|
* 获取静态代码表
|
|
@@ -27727,7 +27734,12 @@ var CodeListService = class {
|
|
|
27727
27734
|
* @returns {*}
|
|
27728
27735
|
*/
|
|
27729
27736
|
getCodeList(tag) {
|
|
27730
|
-
|
|
27737
|
+
const codelist = this.allCodeLists.get(tag);
|
|
27738
|
+
if (this.appModel.appId === ibiz.env.appId && codelist && !this.mergedSubCodeListCache.includes(codelist.codeListTag)) {
|
|
27739
|
+
ibiz.hub.mergeSubAppCodeList(codelist);
|
|
27740
|
+
this.mergedSubCodeListCache.push(codelist.codeListTag);
|
|
27741
|
+
}
|
|
27742
|
+
return codelist;
|
|
27731
27743
|
}
|
|
27732
27744
|
/**
|
|
27733
27745
|
* 格式化代码表
|
|
@@ -40540,7 +40552,12 @@ var DEActionNode2 = class extends UILogicNode {
|
|
|
40540
40552
|
import { RuntimeModelError as RuntimeModelError30 } from "@ibiz-template/core";
|
|
40541
40553
|
var DEUIActionNode = class extends UILogicNode {
|
|
40542
40554
|
async exec(ctx) {
|
|
40543
|
-
const {
|
|
40555
|
+
const {
|
|
40556
|
+
dstAppDEUIActionId,
|
|
40557
|
+
dstDEUILogicParamId,
|
|
40558
|
+
dstAppDataEntityId,
|
|
40559
|
+
retDEUILogicParamId
|
|
40560
|
+
} = this.model;
|
|
40544
40561
|
const { data, parameters } = ctx;
|
|
40545
40562
|
if (!dstAppDEUIActionId) {
|
|
40546
40563
|
throw new RuntimeModelError30(
|
|
@@ -40557,15 +40574,7 @@ var DEUIActionNode = class extends UILogicNode {
|
|
|
40557
40574
|
actionData = [param];
|
|
40558
40575
|
}
|
|
40559
40576
|
}
|
|
40560
|
-
|
|
40561
|
-
ibiz.i18n.t("runtime.uiLogic.interfaceLogicNodeEntityInterfaceAction", {
|
|
40562
|
-
id: this.model.id,
|
|
40563
|
-
dstAppDEUIActionId,
|
|
40564
|
-
dstAppDataEntityId,
|
|
40565
|
-
dstDEUILogicParamId
|
|
40566
|
-
})
|
|
40567
|
-
);
|
|
40568
|
-
await UIActionUtil.execAndResolved(
|
|
40577
|
+
const res = await UIActionUtil.exec(
|
|
40569
40578
|
dstAppDEUIActionId,
|
|
40570
40579
|
{
|
|
40571
40580
|
...parameters,
|
|
@@ -40575,6 +40584,19 @@ var DEUIActionNode = class extends UILogicNode {
|
|
|
40575
40584
|
},
|
|
40576
40585
|
this.model.appId
|
|
40577
40586
|
);
|
|
40587
|
+
if (!res.cancel) {
|
|
40588
|
+
ctx.params[retDEUILogicParamId] = res.data;
|
|
40589
|
+
ctx.setLastReturn(ctx.params[retDEUILogicParamId]);
|
|
40590
|
+
}
|
|
40591
|
+
ibiz.log.debug(
|
|
40592
|
+
ibiz.i18n.t("runtime.uiLogic.interfaceLogicNodeEntityInterfaceAction", {
|
|
40593
|
+
id: this.model.id,
|
|
40594
|
+
dstAppDEUIActionId,
|
|
40595
|
+
dstAppDataEntityId,
|
|
40596
|
+
dstDEUILogicParamId
|
|
40597
|
+
}),
|
|
40598
|
+
ctx.params[retDEUILogicParamId]
|
|
40599
|
+
);
|
|
40578
40600
|
}
|
|
40579
40601
|
};
|
|
40580
40602
|
|
|
@@ -56492,6 +56514,7 @@ var EditFormController = class extends FormController {
|
|
|
56492
56514
|
}
|
|
56493
56515
|
res.data.srfkey = void 0;
|
|
56494
56516
|
res.data.tempsrfkey = createUUID16();
|
|
56517
|
+
res.data.srfuf = 0 /* CREATE */;
|
|
56495
56518
|
this.state.modified = false;
|
|
56496
56519
|
this.state.data = res.data;
|
|
56497
56520
|
this.changeTracker.reset(this.data.clone());
|
|
@@ -67744,18 +67767,20 @@ var MapController = class extends MDControlController {
|
|
|
67744
67767
|
// src/controller/control/report-panel/report-panel.service.ts
|
|
67745
67768
|
var ReportPanelService = class extends ControlService {
|
|
67746
67769
|
/**
|
|
67747
|
-
*
|
|
67748
|
-
*
|
|
67770
|
+
* @description 查询报表数据
|
|
67771
|
+
* @param {string} reportTag 报表标识
|
|
67772
|
+
* @param {string} appDataEntityId 报表实体标识
|
|
67749
67773
|
* @param {IContext} context 上下文
|
|
67750
67774
|
* @param {IParams} [params={}] 视图参数
|
|
67751
|
-
* @returns {*} {Promise<IHttpResponse
|
|
67775
|
+
* @returns {*} {Promise<IHttpResponse<ControlVO[]>>}
|
|
67776
|
+
* @memberof ReportPanelService
|
|
67752
67777
|
*/
|
|
67753
|
-
async fetch(context, params = {}) {
|
|
67754
|
-
|
|
67755
|
-
|
|
67778
|
+
async fetch(reportTag, appDataEntityId, context, params = {}) {
|
|
67779
|
+
const dataEntity = await ibiz.hub.getAppDataEntity(
|
|
67780
|
+
appDataEntityId,
|
|
67756
67781
|
this.model.appId
|
|
67757
67782
|
);
|
|
67758
|
-
const url = "".concat(
|
|
67783
|
+
const url = "".concat(dataEntity.deapicodeName2, "/report?srfreporttag=").concat(reportTag);
|
|
67759
67784
|
let res = await ibiz.net.request(url, {
|
|
67760
67785
|
method: "post",
|
|
67761
67786
|
data: params
|
|
@@ -67810,6 +67835,15 @@ var ReportPanelBaseGenerator = class {
|
|
|
67810
67835
|
load(data = {}) {
|
|
67811
67836
|
return Promise.resolve(data);
|
|
67812
67837
|
}
|
|
67838
|
+
/**
|
|
67839
|
+
* @description 生成
|
|
67840
|
+
* @param {IData[]} _items
|
|
67841
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
67842
|
+
* @memberof ReportPanelBaseGenerator
|
|
67843
|
+
*/
|
|
67844
|
+
generate(_items) {
|
|
67845
|
+
return void 0;
|
|
67846
|
+
}
|
|
67813
67847
|
};
|
|
67814
67848
|
|
|
67815
67849
|
// src/controller/control/report-panel/generator/user-generator.ts
|
|
@@ -67877,373 +67911,3181 @@ var UserReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
|
67877
67911
|
var User2ReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
67878
67912
|
};
|
|
67879
67913
|
|
|
67880
|
-
// src/controller/control/report-panel/generator/bi-
|
|
67881
|
-
var
|
|
67914
|
+
// src/controller/control/report-panel/generator/bi-converter/base/converter-base.ts
|
|
67915
|
+
var ConverterBase = class {
|
|
67882
67916
|
/**
|
|
67883
|
-
*
|
|
67884
|
-
*
|
|
67885
|
-
* @
|
|
67886
|
-
* @
|
|
67887
|
-
* @
|
|
67917
|
+
* Creates an instance of ConverterBase.
|
|
67918
|
+
* @param {IAppBIReport} appBIReport 智能报表模型
|
|
67919
|
+
* @param {IContext} context 上下文
|
|
67920
|
+
* @param {IParams} params 视图参数
|
|
67921
|
+
* @memberof ConverterBase
|
|
67888
67922
|
*/
|
|
67889
|
-
|
|
67890
|
-
|
|
67891
|
-
|
|
67892
|
-
|
|
67893
|
-
|
|
67894
|
-
|
|
67923
|
+
constructor(appBIReport, context, params) {
|
|
67924
|
+
this.appBIReport = appBIReport;
|
|
67925
|
+
this.context = context;
|
|
67926
|
+
this.params = params;
|
|
67927
|
+
/**
|
|
67928
|
+
* @description 仿真模型
|
|
67929
|
+
* @type {IModel}
|
|
67930
|
+
* @memberof ConverterBase
|
|
67931
|
+
*/
|
|
67932
|
+
this.mockModel = {};
|
|
67933
|
+
/**
|
|
67934
|
+
* @description 报表前端模型(原始模型)
|
|
67935
|
+
* @type {IData}
|
|
67936
|
+
* @memberof ConverterBase
|
|
67937
|
+
*/
|
|
67938
|
+
this.reportUIModel = {};
|
|
67939
|
+
/**
|
|
67940
|
+
* @description 指标模型集合
|
|
67941
|
+
* @type {IAppBIReportMeasure[]}
|
|
67942
|
+
* @memberof ConverterBase
|
|
67943
|
+
*/
|
|
67944
|
+
this.measures = [];
|
|
67945
|
+
/**
|
|
67946
|
+
* @description 维度模型集合
|
|
67947
|
+
* @type {IAppBIReportDimension[]}
|
|
67948
|
+
* @memberof ConverterBase
|
|
67949
|
+
*/
|
|
67950
|
+
this.dimensions = [];
|
|
67895
67951
|
}
|
|
67896
67952
|
/**
|
|
67897
|
-
*
|
|
67898
|
-
*
|
|
67899
|
-
* @author tony001
|
|
67900
|
-
* @date 2024-06-20 11:06:52
|
|
67901
|
-
* @param {IData} data
|
|
67902
|
-
* @return {*} {Promise<IData>}
|
|
67953
|
+
* @description 初始化
|
|
67954
|
+
* @memberof ConverterBase
|
|
67903
67955
|
*/
|
|
67904
|
-
|
|
67905
|
-
|
|
67906
|
-
this.
|
|
67956
|
+
async init() {
|
|
67957
|
+
try {
|
|
67958
|
+
const { reportUIModel, appBIReportMeasures, appBIReportDimensions } = this.appBIReport;
|
|
67959
|
+
this.reportUIModel = reportUIModel ? JSON.parse(reportUIModel) : void 0;
|
|
67960
|
+
this.measures = appBIReportMeasures || [];
|
|
67961
|
+
this.dimensions = (appBIReportDimensions == null ? void 0 : appBIReportDimensions.filter(
|
|
67962
|
+
(dimension) => dimension.dimensionTag !== this.reportUIModel.group_tags
|
|
67963
|
+
)) || [];
|
|
67964
|
+
this.groupDimension = appBIReportDimensions == null ? void 0 : appBIReportDimensions.find(
|
|
67965
|
+
(dimension) => dimension.dimensionTag === this.reportUIModel.group_tags
|
|
67966
|
+
);
|
|
67967
|
+
await this.onInit();
|
|
67968
|
+
} catch (error) {
|
|
67969
|
+
ibiz.log.error(error);
|
|
67907
67970
|
}
|
|
67908
|
-
|
|
67971
|
+
}
|
|
67972
|
+
/**
|
|
67973
|
+
* @description 初始化-子类重写
|
|
67974
|
+
* @protected
|
|
67975
|
+
* @returns {*} {Promise<void>}
|
|
67976
|
+
* @memberof ConverterBase
|
|
67977
|
+
*/
|
|
67978
|
+
async onInit() {
|
|
67979
|
+
}
|
|
67980
|
+
/**
|
|
67981
|
+
* @description 转化数据到报表
|
|
67982
|
+
* @param {IData[]} _items
|
|
67983
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
67984
|
+
* @memberof ConverterBase
|
|
67985
|
+
*/
|
|
67986
|
+
translateDataToReport(_items) {
|
|
67987
|
+
return void 0;
|
|
67909
67988
|
}
|
|
67910
67989
|
};
|
|
67911
67990
|
|
|
67912
|
-
// src/controller/control/report-panel/generator/
|
|
67913
|
-
var
|
|
67991
|
+
// src/controller/control/report-panel/generator/bi-converter/number-converter.ts
|
|
67992
|
+
var NumberConverter = class extends ConverterBase {
|
|
67914
67993
|
/**
|
|
67915
|
-
*
|
|
67916
|
-
*
|
|
67917
|
-
* @
|
|
67918
|
-
* @
|
|
67919
|
-
* @static
|
|
67920
|
-
* @param {IDEReportPanel} model
|
|
67921
|
-
* @param {IReportPanelController} reportPanel
|
|
67922
|
-
* @return {*} {ReportPanelBaseGenerator}
|
|
67994
|
+
* @description 转化数据到报表
|
|
67995
|
+
* @param {IData[]} items
|
|
67996
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
67997
|
+
* @memberof NumberConverter
|
|
67923
67998
|
*/
|
|
67924
|
-
|
|
67925
|
-
|
|
67926
|
-
|
|
67927
|
-
|
|
67928
|
-
|
|
67929
|
-
|
|
67930
|
-
|
|
67931
|
-
|
|
67932
|
-
|
|
67933
|
-
|
|
67934
|
-
|
|
67935
|
-
|
|
67936
|
-
|
|
67937
|
-
|
|
67938
|
-
|
|
67939
|
-
|
|
67940
|
-
|
|
67941
|
-
|
|
67942
|
-
|
|
67943
|
-
|
|
67944
|
-
|
|
67945
|
-
|
|
67946
|
-
|
|
67947
|
-
|
|
67948
|
-
|
|
67949
|
-
}
|
|
67999
|
+
translateDataToReport(items) {
|
|
68000
|
+
const {
|
|
68001
|
+
period,
|
|
68002
|
+
chart_type,
|
|
68003
|
+
number_fontsize,
|
|
68004
|
+
number_yoy_show,
|
|
68005
|
+
number_qoq_show,
|
|
68006
|
+
number_fontcolor,
|
|
68007
|
+
number_yoy_value,
|
|
68008
|
+
number_qoq_value,
|
|
68009
|
+
number_fontstyle
|
|
68010
|
+
} = this.reportUIModel;
|
|
68011
|
+
const model = {
|
|
68012
|
+
period,
|
|
68013
|
+
chart_type,
|
|
68014
|
+
number_fontsize,
|
|
68015
|
+
number_yoy_show,
|
|
68016
|
+
number_qoq_show,
|
|
68017
|
+
number_fontcolor,
|
|
68018
|
+
number_yoy_value,
|
|
68019
|
+
number_qoq_value,
|
|
68020
|
+
number_fontstyle,
|
|
68021
|
+
measure: this.measures[0]
|
|
68022
|
+
};
|
|
68023
|
+
return { model, options: {}, data: items };
|
|
67950
68024
|
}
|
|
67951
68025
|
};
|
|
67952
68026
|
|
|
67953
|
-
// src/controller/control/report-panel/
|
|
67954
|
-
var
|
|
68027
|
+
// src/controller/control/report-panel/generator/bi-converter/utils/chart-util.ts
|
|
68028
|
+
var ChartUtil = class {
|
|
67955
68029
|
/**
|
|
67956
|
-
*
|
|
67957
|
-
*
|
|
67958
|
-
* @
|
|
67959
|
-
* @
|
|
67960
|
-
* @type {ControllerEvent<IReportPanelEvent>}
|
|
67961
|
-
* @memberof ReportPanelController
|
|
68030
|
+
* @description x轴标签标题
|
|
68031
|
+
* @static
|
|
68032
|
+
* @returns {*}
|
|
68033
|
+
* @memberof ChartUtil
|
|
67962
68034
|
*/
|
|
67963
|
-
|
|
67964
|
-
|
|
68035
|
+
static xAxisLabel() {
|
|
68036
|
+
const options = {};
|
|
68037
|
+
options.formatter = "function(param) {\n if (param && param.includes(' ')) {\n const time = new Date(param);\n if (time.toString() !== 'Invalid Date') {\n return time.toLocaleDateString().replaceAll('/','-');\n }\n }\n if(param.indexOf('_') < 0){\n return param;\n }\n const str = param.split('_').pop();\n if(str.length > 4){\n return str.slice(0,4) + '...'\n }\n return str;\n }";
|
|
68038
|
+
return options;
|
|
67965
68039
|
}
|
|
67966
68040
|
/**
|
|
67967
|
-
*
|
|
67968
|
-
*
|
|
67969
|
-
* @
|
|
67970
|
-
* @
|
|
67971
|
-
* @
|
|
68041
|
+
* @description 使用间隔的时候加上省略限制
|
|
68042
|
+
* @static
|
|
68043
|
+
* @param {number} [labelInterval=1]
|
|
68044
|
+
* @returns {*}
|
|
68045
|
+
* @memberof ChartUtil
|
|
67972
68046
|
*/
|
|
67973
|
-
|
|
67974
|
-
|
|
67975
|
-
|
|
68047
|
+
static computeLabelEllipsis(labelInterval = 1) {
|
|
68048
|
+
return {
|
|
68049
|
+
width: 60 * (labelInterval > 0 ? labelInterval : 1),
|
|
68050
|
+
overflow: "truncate",
|
|
68051
|
+
ellipsis: "..."
|
|
68052
|
+
};
|
|
68053
|
+
}
|
|
68054
|
+
/**
|
|
68055
|
+
* @description 获取图例位置
|
|
68056
|
+
* @static
|
|
68057
|
+
* @param {string} position
|
|
68058
|
+
* @returns {*} {IData}
|
|
68059
|
+
* @memberof ChartUtil
|
|
68060
|
+
*/
|
|
68061
|
+
static getLegendPosition(position) {
|
|
68062
|
+
const legendGap = 20;
|
|
68063
|
+
const options = {
|
|
68064
|
+
type: "scroll"
|
|
68065
|
+
};
|
|
68066
|
+
if (position === "left" || position === "right") {
|
|
68067
|
+
options.orient = "vertical";
|
|
68068
|
+
options[position] = legendGap;
|
|
68069
|
+
options.top = "middle";
|
|
67976
68070
|
}
|
|
67977
|
-
|
|
68071
|
+
if (position === "top" || position === "bottom") {
|
|
68072
|
+
options.left = "center";
|
|
68073
|
+
options.top = position;
|
|
68074
|
+
}
|
|
68075
|
+
if (position === "left-top") {
|
|
68076
|
+
options.left = legendGap;
|
|
68077
|
+
options.top = "top";
|
|
68078
|
+
}
|
|
68079
|
+
if (position === "right-top") {
|
|
68080
|
+
options.right = legendGap;
|
|
68081
|
+
options.top = "top";
|
|
68082
|
+
}
|
|
68083
|
+
if (position === "left-bottom") {
|
|
68084
|
+
options.left = legendGap;
|
|
68085
|
+
options.top = "bottom";
|
|
68086
|
+
}
|
|
68087
|
+
if (position === "right-bottom") {
|
|
68088
|
+
options.right = legendGap;
|
|
68089
|
+
options.top = "bottom";
|
|
68090
|
+
}
|
|
68091
|
+
return options;
|
|
68092
|
+
}
|
|
68093
|
+
};
|
|
68094
|
+
|
|
68095
|
+
// src/controller/control/report-panel/generator/bi-converter/base/echart-converter-base.ts
|
|
68096
|
+
import { clone as clone50 } from "ramda";
|
|
68097
|
+
var EchartConverterBase = class extends ConverterBase {
|
|
68098
|
+
constructor() {
|
|
68099
|
+
super(...arguments);
|
|
68100
|
+
/**
|
|
68101
|
+
* @description 仿真序列模型
|
|
68102
|
+
* @type {IModel}
|
|
68103
|
+
* @memberof EchartConverterBase
|
|
68104
|
+
*/
|
|
68105
|
+
this.mockSerieModel = {};
|
|
67978
68106
|
}
|
|
67979
68107
|
/**
|
|
67980
|
-
*
|
|
67981
|
-
*
|
|
67982
|
-
* @
|
|
67983
|
-
* @memberof ReportPanelController
|
|
68108
|
+
* @description 获取图表颜色参数
|
|
68109
|
+
* @returns {*} {IData}
|
|
68110
|
+
* @memberof EchartConverterBase
|
|
67984
68111
|
*/
|
|
67985
|
-
|
|
67986
|
-
|
|
67987
|
-
|
|
67988
|
-
|
|
67989
|
-
|
|
68112
|
+
getChartColorParams() {
|
|
68113
|
+
const params = {};
|
|
68114
|
+
const { chart_color } = this.reportUIModel;
|
|
68115
|
+
if (chart_color)
|
|
68116
|
+
params["EC.color"] = JSON.stringify(chart_color);
|
|
68117
|
+
return params;
|
|
67990
68118
|
}
|
|
67991
68119
|
/**
|
|
67992
|
-
*
|
|
67993
|
-
*
|
|
67994
|
-
* @
|
|
67995
|
-
* @returns {*} {Promise<void>}
|
|
68120
|
+
* @description 获取图表X轴参数
|
|
68121
|
+
* @returns {*} {IData}
|
|
68122
|
+
* @memberof EchartConverterBase
|
|
67996
68123
|
*/
|
|
67997
|
-
|
|
67998
|
-
|
|
67999
|
-
|
|
68000
|
-
|
|
68001
|
-
|
|
68124
|
+
getChartXAxisParams() {
|
|
68125
|
+
const {
|
|
68126
|
+
xaxis_name,
|
|
68127
|
+
xaxis_nametextstyle_fontstyle,
|
|
68128
|
+
xaxis_nametextstyle_fontsize,
|
|
68129
|
+
xaxis_nametextstyle_fontcolor,
|
|
68130
|
+
xaxis_axislabel_show,
|
|
68131
|
+
xaxis_axislabel_fontstyle,
|
|
68132
|
+
xaxis_axislabel_fontsize,
|
|
68133
|
+
xaxis_axislabel_fontcolor,
|
|
68134
|
+
xaxis_axisline_show,
|
|
68135
|
+
xaxis_axisline_linestyle_type,
|
|
68136
|
+
xaxis_axisline_linestyle_width,
|
|
68137
|
+
xaxis_axisline_linestyle_color,
|
|
68138
|
+
xaxis_splitline_show,
|
|
68139
|
+
xaxis_splitline_linestyle_type,
|
|
68140
|
+
xaxis_splitline_linestyle_width,
|
|
68141
|
+
xaxis_splitline_linestyle_color,
|
|
68142
|
+
xaxis_axislabel_interval
|
|
68143
|
+
} = this.reportUIModel;
|
|
68144
|
+
let tempName = "";
|
|
68145
|
+
if (xaxis_name == "1") {
|
|
68146
|
+
tempName = void 0;
|
|
68002
68147
|
}
|
|
68003
|
-
|
|
68004
|
-
|
|
68005
|
-
|
|
68006
|
-
|
|
68007
|
-
|
|
68008
|
-
|
|
68148
|
+
const options = {
|
|
68149
|
+
show: true,
|
|
68150
|
+
showTitle: xaxis_name == "1",
|
|
68151
|
+
// 分层时,模板需要根据这个字段计算对应的标题
|
|
68152
|
+
type: "category",
|
|
68153
|
+
name: tempName,
|
|
68154
|
+
// 显示轴标题
|
|
68155
|
+
minorSplitLine: {
|
|
68156
|
+
show: false
|
|
68157
|
+
}
|
|
68158
|
+
};
|
|
68159
|
+
const nameTextStyle = {};
|
|
68160
|
+
if (xaxis_nametextstyle_fontstyle) {
|
|
68161
|
+
xaxis_nametextstyle_fontstyle === "bold" ? nameTextStyle.fontWeight = xaxis_nametextstyle_fontstyle : nameTextStyle.fontStyle = xaxis_nametextstyle_fontstyle;
|
|
68162
|
+
}
|
|
68163
|
+
if (xaxis_nametextstyle_fontsize) {
|
|
68164
|
+
nameTextStyle.fontSize = xaxis_nametextstyle_fontsize;
|
|
68165
|
+
}
|
|
68166
|
+
if (xaxis_nametextstyle_fontcolor) {
|
|
68167
|
+
nameTextStyle.color = xaxis_nametextstyle_fontcolor;
|
|
68168
|
+
}
|
|
68169
|
+
options.nameTextStyle = nameTextStyle;
|
|
68170
|
+
const axisLabel = {
|
|
68171
|
+
show: xaxis_axislabel_show == "1",
|
|
68172
|
+
interval: xaxis_axislabel_interval || "auto",
|
|
68173
|
+
...ChartUtil.xAxisLabel(),
|
|
68174
|
+
...ChartUtil.computeLabelEllipsis(xaxis_axislabel_interval)
|
|
68175
|
+
};
|
|
68176
|
+
if (xaxis_axislabel_fontstyle) {
|
|
68177
|
+
xaxis_axislabel_fontstyle === "bold" ? axisLabel.fontWeight = xaxis_axislabel_fontstyle : axisLabel.fontStyle = xaxis_axislabel_fontstyle;
|
|
68178
|
+
}
|
|
68179
|
+
if (xaxis_axislabel_fontsize) {
|
|
68180
|
+
axisLabel.fontSize = xaxis_axislabel_fontsize;
|
|
68181
|
+
}
|
|
68182
|
+
if (xaxis_axislabel_fontcolor) {
|
|
68183
|
+
axisLabel.color = xaxis_axislabel_fontcolor;
|
|
68184
|
+
}
|
|
68185
|
+
options.axisLabel = axisLabel;
|
|
68186
|
+
const axisLine = {
|
|
68187
|
+
show: xaxis_axisline_show == "1",
|
|
68188
|
+
lineStyle: {
|
|
68189
|
+
type: xaxis_axisline_linestyle_type === "doubleDashed" ? [15] : xaxis_axisline_linestyle_type,
|
|
68190
|
+
width: xaxis_axisline_linestyle_width,
|
|
68191
|
+
color: xaxis_axisline_linestyle_color
|
|
68192
|
+
// 轴线颜色
|
|
68193
|
+
}
|
|
68194
|
+
};
|
|
68195
|
+
options.axisLine = axisLine;
|
|
68196
|
+
const splitLine = {
|
|
68197
|
+
show: xaxis_splitline_show == "1",
|
|
68198
|
+
lineStyle: {
|
|
68199
|
+
type: xaxis_splitline_linestyle_type === "doubleDashed" ? [15] : xaxis_splitline_linestyle_type,
|
|
68200
|
+
width: xaxis_splitline_linestyle_width,
|
|
68201
|
+
color: xaxis_splitline_linestyle_color
|
|
68202
|
+
// 轴线颜色
|
|
68203
|
+
}
|
|
68204
|
+
};
|
|
68205
|
+
options.splitLine = splitLine;
|
|
68206
|
+
return { "EC.xAxis": JSON.stringify(options) };
|
|
68009
68207
|
}
|
|
68010
68208
|
/**
|
|
68011
|
-
*
|
|
68012
|
-
*
|
|
68013
|
-
* @
|
|
68014
|
-
* @return {*} {Promise<void>}
|
|
68015
|
-
* @memberof ReportPanelController
|
|
68209
|
+
* @description 获取图表Y轴参数
|
|
68210
|
+
* @returns {*} {IData}
|
|
68211
|
+
* @memberof EchartConverterBase
|
|
68016
68212
|
*/
|
|
68017
|
-
|
|
68018
|
-
|
|
68019
|
-
|
|
68020
|
-
|
|
68213
|
+
getChartYAxisParams() {
|
|
68214
|
+
const {
|
|
68215
|
+
yaxis_name,
|
|
68216
|
+
yaxis_nametextstyle_fontstyle,
|
|
68217
|
+
yaxis_nametextstyle_fontsize,
|
|
68218
|
+
yaxis_nametextstyle_fontcolor,
|
|
68219
|
+
yaxis_axislabel_show,
|
|
68220
|
+
yaxis_axislabel_fontstyle,
|
|
68221
|
+
yaxis_axislabel_fontsize,
|
|
68222
|
+
yaxis_axislabel_fontcolor,
|
|
68223
|
+
yaxis_axisline_show,
|
|
68224
|
+
yaxis_axisline_linestyle_type,
|
|
68225
|
+
yaxis_axisline_linestyle_width,
|
|
68226
|
+
yaxis_axisline_linestyle_color,
|
|
68227
|
+
yaxis_splitline_show,
|
|
68228
|
+
yaxis_splitline_linestyle_type,
|
|
68229
|
+
yaxis_splitline_linestyle_width,
|
|
68230
|
+
yaxis_splitline_linestyle_color
|
|
68231
|
+
} = this.reportUIModel;
|
|
68232
|
+
const options = {
|
|
68233
|
+
show: true,
|
|
68234
|
+
type: "value",
|
|
68235
|
+
showTitle: yaxis_name == "1",
|
|
68236
|
+
minorSplitLine: {
|
|
68237
|
+
show: false
|
|
68238
|
+
}
|
|
68239
|
+
};
|
|
68240
|
+
const nameTextStyle = {};
|
|
68241
|
+
yaxis_nametextstyle_fontstyle === "bold" ? nameTextStyle.fontWeight = yaxis_nametextstyle_fontstyle : nameTextStyle.fontStyle = yaxis_nametextstyle_fontstyle;
|
|
68242
|
+
if (yaxis_nametextstyle_fontsize) {
|
|
68243
|
+
nameTextStyle.fontSize = yaxis_nametextstyle_fontsize;
|
|
68244
|
+
}
|
|
68245
|
+
if (yaxis_nametextstyle_fontcolor) {
|
|
68246
|
+
nameTextStyle.color = yaxis_nametextstyle_fontcolor;
|
|
68247
|
+
}
|
|
68248
|
+
options.nameTextStyle = nameTextStyle;
|
|
68249
|
+
const axisLabel = {
|
|
68250
|
+
show: yaxis_axislabel_show == "1"
|
|
68251
|
+
};
|
|
68252
|
+
if (yaxis_axislabel_fontstyle) {
|
|
68253
|
+
yaxis_axislabel_fontstyle === "bold" ? axisLabel.fontWeight = yaxis_axislabel_fontstyle : axisLabel.fontStyle = yaxis_axislabel_fontstyle;
|
|
68254
|
+
}
|
|
68255
|
+
if (yaxis_axislabel_fontsize) {
|
|
68256
|
+
axisLabel.fontSize = yaxis_axislabel_fontsize;
|
|
68021
68257
|
}
|
|
68258
|
+
if (yaxis_axislabel_fontcolor) {
|
|
68259
|
+
axisLabel.color = yaxis_axislabel_fontcolor;
|
|
68260
|
+
}
|
|
68261
|
+
options.axisLabel = axisLabel;
|
|
68262
|
+
const axisLine = {
|
|
68263
|
+
show: yaxis_axisline_show == "1",
|
|
68264
|
+
lineStyle: {
|
|
68265
|
+
type: yaxis_axisline_linestyle_type === "doubleDashed" ? [15] : yaxis_axisline_linestyle_type,
|
|
68266
|
+
width: yaxis_axisline_linestyle_width,
|
|
68267
|
+
color: yaxis_axisline_linestyle_color
|
|
68268
|
+
}
|
|
68269
|
+
};
|
|
68270
|
+
options.axisLine = axisLine;
|
|
68271
|
+
const splitLine = {
|
|
68272
|
+
show: yaxis_splitline_show == "1",
|
|
68273
|
+
lineStyle: {
|
|
68274
|
+
type: yaxis_splitline_linestyle_type === "doubleDashed" ? [15] : yaxis_splitline_linestyle_type,
|
|
68275
|
+
width: yaxis_splitline_linestyle_width,
|
|
68276
|
+
color: yaxis_splitline_linestyle_color
|
|
68277
|
+
// 轴线颜色
|
|
68278
|
+
}
|
|
68279
|
+
};
|
|
68280
|
+
options.splitLine = splitLine;
|
|
68281
|
+
return { "EC.yAxis": JSON.stringify(options) };
|
|
68022
68282
|
}
|
|
68023
68283
|
/**
|
|
68024
|
-
*
|
|
68025
|
-
*
|
|
68026
|
-
* @
|
|
68027
|
-
* @
|
|
68028
|
-
* @memberof
|
|
68284
|
+
* @description 计算最大值最小值
|
|
68285
|
+
* @param {IModel} seriesModel
|
|
68286
|
+
* @param {IData[]} items
|
|
68287
|
+
* @returns {*} {{ max: number; min: number }}
|
|
68288
|
+
* @memberof EchartConverterBase
|
|
68029
68289
|
*/
|
|
68030
|
-
|
|
68031
|
-
|
|
68290
|
+
calcMaxMin(seriesModel, items) {
|
|
68291
|
+
const { valueField, catalogField, seriesField } = seriesModel;
|
|
68292
|
+
const catalogFields = this.dimensions.map(
|
|
68293
|
+
(d) => d.dimensionTag.toLowerCase()
|
|
68294
|
+
);
|
|
68295
|
+
const count = items.reduce((acc, item) => {
|
|
68296
|
+
let catalogName = "";
|
|
68297
|
+
if (catalogFields.length) {
|
|
68298
|
+
catalogFields.forEach((key) => {
|
|
68299
|
+
catalogName += item[key];
|
|
68300
|
+
});
|
|
68301
|
+
} else {
|
|
68302
|
+
catalogName = item[catalogField];
|
|
68303
|
+
}
|
|
68304
|
+
const name2 = seriesField ? "".concat(item[seriesField], "_").concat(catalogName) : "".concat(catalogName);
|
|
68305
|
+
const value = item[valueField];
|
|
68306
|
+
if (!acc[name2]) {
|
|
68307
|
+
acc[name2] = {
|
|
68308
|
+
sum: 0,
|
|
68309
|
+
max: -Infinity,
|
|
68310
|
+
// 初始化为极小值
|
|
68311
|
+
min: Infinity
|
|
68312
|
+
// 初始化为极大值
|
|
68313
|
+
};
|
|
68314
|
+
}
|
|
68315
|
+
acc[name2].sum += value;
|
|
68316
|
+
acc[name2].max = Math.max(acc[name2].max, value);
|
|
68317
|
+
acc[name2].min = Math.min(acc[name2].min, value);
|
|
68318
|
+
return acc;
|
|
68319
|
+
}, {});
|
|
68320
|
+
const allSums = Object.values(count).map((item) => item.sum);
|
|
68321
|
+
const max2 = Math.max(...allSums);
|
|
68322
|
+
const min = Math.min(...allSums);
|
|
68323
|
+
return { max: max2, min };
|
|
68032
68324
|
}
|
|
68033
68325
|
/**
|
|
68034
|
-
*
|
|
68035
|
-
*
|
|
68036
|
-
* @
|
|
68037
|
-
* @
|
|
68038
|
-
* @
|
|
68039
|
-
* @memberof ReportPanelController
|
|
68326
|
+
* @description 获取标签参数
|
|
68327
|
+
* @param {IModel} seriesModel
|
|
68328
|
+
* @param {IData[]} items
|
|
68329
|
+
* @returns {*} {IData}
|
|
68330
|
+
* @memberof EchartConverterBase
|
|
68040
68331
|
*/
|
|
68041
|
-
|
|
68042
|
-
|
|
68043
|
-
|
|
68332
|
+
getChartLabelParams(seriesModel, items) {
|
|
68333
|
+
const {
|
|
68334
|
+
series_label_show,
|
|
68335
|
+
series_label_position,
|
|
68336
|
+
series_label_fontsize,
|
|
68337
|
+
series_label_fontstyle,
|
|
68338
|
+
series_label_fontcolor,
|
|
68339
|
+
series_label_data_range
|
|
68340
|
+
} = this.reportUIModel;
|
|
68341
|
+
const options = {
|
|
68342
|
+
show: series_label_show == "1",
|
|
68343
|
+
position: series_label_position
|
|
68344
|
+
};
|
|
68345
|
+
if (series_label_fontstyle) {
|
|
68346
|
+
series_label_fontstyle === "bold" ? options.fontWeight = series_label_fontstyle : options.fontStyle = series_label_fontstyle;
|
|
68044
68347
|
}
|
|
68045
|
-
|
|
68046
|
-
|
|
68047
|
-
const { context } = this.handlerAbilityParams(args);
|
|
68048
|
-
const params = await this.getFetchParams(args == null ? void 0 : args.viewParam);
|
|
68049
|
-
const res = await this.service.fetch(context, params);
|
|
68050
|
-
this.state.data = res.data;
|
|
68051
|
-
await this.afterLoad(args, res.data);
|
|
68052
|
-
this.state.isLoaded = true;
|
|
68053
|
-
await this._evt.emit("onLoadSuccess", void 0);
|
|
68054
|
-
} catch (error) {
|
|
68055
|
-
await this._evt.emit("onLoadError", void 0);
|
|
68056
|
-
this.actionNotification("FETCHERROR", {
|
|
68057
|
-
error
|
|
68058
|
-
});
|
|
68059
|
-
throw error;
|
|
68060
|
-
} finally {
|
|
68061
|
-
await this.endLoading();
|
|
68348
|
+
if (series_label_fontsize) {
|
|
68349
|
+
options.fontSize = Number(series_label_fontsize);
|
|
68062
68350
|
}
|
|
68063
|
-
|
|
68064
|
-
|
|
68351
|
+
if (series_label_fontcolor) {
|
|
68352
|
+
options.color = series_label_fontcolor;
|
|
68353
|
+
}
|
|
68354
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
68355
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
68356
|
+
options.formatter = "function(param) { \n if(param.value[1] === ".concat(max2, " || param.value[1] === ").concat(min, "){\n return param.value[1];\n }\n return '';\n }");
|
|
68357
|
+
}
|
|
68358
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
68359
|
+
options.formatter = "function(param) {\n return param.value[1];\n }";
|
|
68360
|
+
}
|
|
68361
|
+
return { "EC.label": JSON.stringify(options) };
|
|
68065
68362
|
}
|
|
68066
68363
|
/**
|
|
68067
|
-
*
|
|
68068
|
-
*
|
|
68069
|
-
* @
|
|
68070
|
-
* @date 2023-06-21 15:06:44
|
|
68071
|
-
* @param {MDCtrlLoadParams} args 本次请求参数
|
|
68072
|
-
* @param {IData[]} items 上游处理的数据(默认是后台数据)
|
|
68073
|
-
* @return {*} {Promise<IData[]>} 返回给后续处理的数据
|
|
68364
|
+
* @description 获取图例参数
|
|
68365
|
+
* @returns {*} {IData}
|
|
68366
|
+
* @memberof EchartConverterBase
|
|
68074
68367
|
*/
|
|
68075
|
-
|
|
68076
|
-
|
|
68368
|
+
getChartLegendParams() {
|
|
68369
|
+
const {
|
|
68370
|
+
legend_show,
|
|
68371
|
+
legend_fontstyle,
|
|
68372
|
+
legend_fontsize,
|
|
68373
|
+
legend_fontcolor,
|
|
68374
|
+
legend_position
|
|
68375
|
+
} = this.reportUIModel;
|
|
68376
|
+
const options = {
|
|
68377
|
+
show: legend_show == "1",
|
|
68378
|
+
icon: "circle",
|
|
68379
|
+
formatter: "function(param){\n return param;\n }"
|
|
68380
|
+
};
|
|
68381
|
+
const textStyle = {};
|
|
68382
|
+
if (legend_fontstyle) {
|
|
68383
|
+
legend_fontstyle === "bold" ? textStyle.fontWeight = legend_fontstyle : textStyle.fontStyle = legend_fontstyle;
|
|
68384
|
+
}
|
|
68385
|
+
if (legend_fontsize) {
|
|
68386
|
+
textStyle.fontSize = Number(legend_fontsize);
|
|
68387
|
+
}
|
|
68388
|
+
if (legend_fontcolor) {
|
|
68389
|
+
textStyle.color = legend_fontcolor;
|
|
68390
|
+
}
|
|
68391
|
+
options.textStyle = textStyle;
|
|
68392
|
+
if (legend_position) {
|
|
68393
|
+
Object.assign(options, ChartUtil.getLegendPosition(legend_position));
|
|
68394
|
+
}
|
|
68395
|
+
return { "EC.legend": JSON.stringify(options) };
|
|
68077
68396
|
}
|
|
68078
68397
|
/**
|
|
68079
|
-
*
|
|
68080
|
-
* @
|
|
68081
|
-
* @
|
|
68398
|
+
* @description 获取控件参数
|
|
68399
|
+
* @returns {*} {IData}
|
|
68400
|
+
* @memberof EchartConverterBase
|
|
68082
68401
|
*/
|
|
68083
|
-
|
|
68084
|
-
const
|
|
68085
|
-
|
|
68086
|
-
|
|
68087
|
-
|
|
68088
|
-
|
|
68089
|
-
|
|
68402
|
+
getChartControlParams() {
|
|
68403
|
+
const ctrlParams = {};
|
|
68404
|
+
const tempdimensions = this.dimensions.map((item) => {
|
|
68405
|
+
return {
|
|
68406
|
+
mode: "field",
|
|
68407
|
+
name: item.dimensionName,
|
|
68408
|
+
codelistId: item.appCodeListId,
|
|
68409
|
+
codename: item.dimensionTag.toLowerCase()
|
|
68410
|
+
};
|
|
68090
68411
|
});
|
|
68091
|
-
|
|
68092
|
-
|
|
68093
|
-
|
|
68094
|
-
|
|
68412
|
+
Object.assign(ctrlParams, {
|
|
68413
|
+
CATALOGFIELDS: JSON.stringify(tempdimensions),
|
|
68414
|
+
NOSORT: true
|
|
68415
|
+
});
|
|
68416
|
+
return ctrlParams;
|
|
68095
68417
|
}
|
|
68096
68418
|
/**
|
|
68097
|
-
*
|
|
68098
|
-
*
|
|
68099
|
-
* @
|
|
68100
|
-
* @
|
|
68419
|
+
* @description 获取tooltip参数
|
|
68420
|
+
* @param {IData} series
|
|
68421
|
+
* @param {boolean} [isRow=false]
|
|
68422
|
+
* @returns {*}
|
|
68423
|
+
* @memberof EchartConverterBase
|
|
68101
68424
|
*/
|
|
68102
|
-
|
|
68103
|
-
|
|
68104
|
-
|
|
68105
|
-
|
|
68425
|
+
getTooltipParams(series, isRow = false) {
|
|
68426
|
+
if (!this.groupDimension) {
|
|
68427
|
+
return {
|
|
68428
|
+
"EC.name": series.serieText,
|
|
68429
|
+
"EC.tooltip": JSON.stringify({
|
|
68430
|
+
formatter: "function(param){\n const tempdata = param.data[2];\n const names = param.name.split('_');\n const catalogData = tempdata._catalogLevelData;\n \n let value = ".concat(isRow, " ? param.value[0] : param.value[1];\n \n // \u8BA1\u7B97\u7EF4\u5EA6\u9879\u5206\u5C42\n let dimcatalogs = '';\n catalogData.forEach((item) => {\n let text = item.valueText || '\u672A\u5B9A\u4E49'\n const dimitem = '<div style=\"width:100%;display:flex;justifyContent: left;alignItems:center;\"><div>' + item.name + ':</div><div style=\"flex:0;margin-left:4px;\">' +text + '</div></div>'\n dimcatalogs += dimitem;\n }) \n return '<div style=\"min-width: 150px\">'+ dimcatalogs +'<div style=\"width:100%;display:flex;justifyContent: left;alignItems:center;\"><div style=\"flex:0\">'+ param.marker + param.seriesName +':</div><div style=\"flex:1;margin-left:4px;\">'+ value +'</div></div></div>' \n }")
|
|
68431
|
+
})
|
|
68432
|
+
};
|
|
68106
68433
|
}
|
|
68107
|
-
|
|
68434
|
+
const param = {
|
|
68435
|
+
"EC.tooltip": JSON.stringify({
|
|
68436
|
+
formatter: "function(param){\n const {data} = param; \n const catalogData = data[2]._catalogLevelData;\n \n let tempName = param.seriesName;\n const field = Object.keys(data[2]).find(key => {\n return key !== '_groupName' && data[2][key] === param.seriesName;\n })\n // \u8BA1\u7B97\u7EF4\u5EA6\u9879\u5206\u5C42\n let dimcatalogs = '';\n catalogData.forEach((item) => {\n let text = item.valueText || '\u672A\u5B9A\u4E49'\n const dimitem = '<div style=\"width:100%;display:flex;justifyContent: left;alignItems:center;\"><div>' + item.name + ':</div><div style=\"flex:0;margin-left:4px;\">' +text + '</div></div>'\n dimcatalogs += dimitem;\n })\n \n let value = ".concat(isRow, " ? param.value[0] : param.value[1];\n return '<div style=\"min-width: 200px\">' + dimcatalogs + \n '<div style=\"width:100%;display:flex;justifyContent: left;alignItems:center;\">'+\n '<div>").concat(this.groupDimension.dimensionName, ":</div>'+\n '<div style=\"flex:0\">'+ tempName +'</div>'+\n '</div>' + \n '<div style=\"width:100%;display:flex;justifyContent: left;alignItems:center;\">'+ \n '<div>' + param.marker + '").concat(series.serieText, ":</div>'+\n '<div style=\"flex:0\">' + value + '</div>'+\n '</div>'+\n '</div>'\n }")
|
|
68437
|
+
})
|
|
68438
|
+
};
|
|
68439
|
+
return param;
|
|
68440
|
+
}
|
|
68441
|
+
/**
|
|
68442
|
+
* @description 计算序列模型
|
|
68443
|
+
* @param {IAppBIReportMeasure[]} measures 指标
|
|
68444
|
+
* @param {IAppBIReportDimension} dimension 维度
|
|
68445
|
+
* @param {IAppBIReportDimension[]} [groupDimension] 分组维度
|
|
68446
|
+
* @returns {*} {IModel[]}
|
|
68447
|
+
* @memberof EchartConverterBase
|
|
68448
|
+
*/
|
|
68449
|
+
calcSeriesModel(measures, dimension, groupDimension) {
|
|
68450
|
+
const seriesModels = [];
|
|
68451
|
+
measures.forEach((item, index) => {
|
|
68452
|
+
const seriesModel = clone50(this.mockSerieModel);
|
|
68453
|
+
Object.assign(seriesModel, {
|
|
68454
|
+
id: "".concat(seriesModel.seriesType, "_").concat(index),
|
|
68455
|
+
caption: item.measureName,
|
|
68456
|
+
serieText: item.measureName,
|
|
68457
|
+
catalogName: dimension.dimensionName,
|
|
68458
|
+
valueField: item.measureTag.toLowerCase(),
|
|
68459
|
+
catalogCodeListId: dimension.appCodeListId,
|
|
68460
|
+
catalogField: dimension.dimensionTag.toLowerCase()
|
|
68461
|
+
});
|
|
68462
|
+
if (groupDimension)
|
|
68463
|
+
Object.assign(seriesModel, {
|
|
68464
|
+
seriesCodeListId: groupDimension.appCodeListId,
|
|
68465
|
+
seriesField: groupDimension.dimensionTag.toLowerCase()
|
|
68466
|
+
});
|
|
68467
|
+
seriesModels.push(seriesModel);
|
|
68468
|
+
});
|
|
68469
|
+
return seriesModels;
|
|
68108
68470
|
}
|
|
68109
68471
|
/**
|
|
68110
|
-
*
|
|
68111
|
-
* @
|
|
68472
|
+
* @description 转化数据到模型
|
|
68473
|
+
* @param {IData[]} items
|
|
68474
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
68475
|
+
* @memberof EchartConverterBase
|
|
68112
68476
|
*/
|
|
68113
|
-
|
|
68114
|
-
if (this.
|
|
68115
|
-
|
|
68116
|
-
|
|
68117
|
-
|
|
68118
|
-
|
|
68119
|
-
|
|
68120
|
-
|
|
68477
|
+
translateDataToReport(items) {
|
|
68478
|
+
if (!this.measures.length || !this.dimensions.length)
|
|
68479
|
+
return;
|
|
68480
|
+
const model = clone50(this.mockModel);
|
|
68481
|
+
const seriesModels = this.calcSeriesModel(
|
|
68482
|
+
this.measures,
|
|
68483
|
+
this.dimensions[0],
|
|
68484
|
+
this.groupDimension
|
|
68485
|
+
);
|
|
68486
|
+
if (model.dechartSerieses)
|
|
68487
|
+
model.dechartSerieses.push(...seriesModels);
|
|
68488
|
+
return { model, options: {}, data: items };
|
|
68121
68489
|
}
|
|
68122
68490
|
};
|
|
68123
68491
|
|
|
68124
|
-
// src/controller/control/
|
|
68125
|
-
|
|
68126
|
-
awaitTimeout as awaitTimeout4,
|
|
68127
|
-
RuntimeError as RuntimeError64,
|
|
68128
|
-
recursiveIterate as recursiveIterate15
|
|
68129
|
-
} from "@ibiz-template/core";
|
|
68130
|
-
|
|
68131
|
-
// src/controller/control/gantt/gantt.service.ts
|
|
68132
|
-
import { ModelError as ModelError29 } from "@ibiz-template/core";
|
|
68133
|
-
var GanttService = class extends TreeService {
|
|
68492
|
+
// src/controller/control/report-panel/generator/bi-converter/base/multi-series-converter.ts
|
|
68493
|
+
var MultiSeriesConverter = class extends EchartConverterBase {
|
|
68134
68494
|
/**
|
|
68135
|
-
*
|
|
68136
|
-
*
|
|
68137
|
-
* @
|
|
68138
|
-
* @
|
|
68139
|
-
* @param {(IGanttNodeData | undefined)} parentNodeData
|
|
68140
|
-
* @param {TreeFetchOpts} opts
|
|
68141
|
-
* @return {*} {Promise<IGanttNodeData>}
|
|
68142
|
-
* @memberof GanttService
|
|
68495
|
+
* @description 转化数据到报表
|
|
68496
|
+
* @param {IData[]} items
|
|
68497
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
68498
|
+
* @memberof MultiSeriesConverter
|
|
68143
68499
|
*/
|
|
68144
|
-
|
|
68500
|
+
translateDataToReport(items) {
|
|
68145
68501
|
var _a3;
|
|
68146
|
-
const
|
|
68147
|
-
|
|
68148
|
-
|
|
68149
|
-
|
|
68150
|
-
|
|
68151
|
-
|
|
68502
|
+
const report = super.translateDataToReport(items);
|
|
68503
|
+
if (!report)
|
|
68504
|
+
return;
|
|
68505
|
+
const { model } = report;
|
|
68506
|
+
const chartColorParams = this.getChartColorParams();
|
|
68507
|
+
Object.assign(model.userParam, chartColorParams);
|
|
68508
|
+
const xAxisParams = this.getChartXAxisParams();
|
|
68509
|
+
Object.assign(model.userParam, xAxisParams);
|
|
68510
|
+
const yAxisParams = this.getChartYAxisParams();
|
|
68511
|
+
Object.assign(model.userParam, yAxisParams);
|
|
68512
|
+
const legendParams = this.getChartLegendParams();
|
|
68513
|
+
Object.assign(model.userParam, legendParams);
|
|
68514
|
+
const controlParams = this.getChartControlParams();
|
|
68515
|
+
Object.assign(model, {
|
|
68516
|
+
controlParam: {
|
|
68517
|
+
ctrlParams: controlParams
|
|
68518
|
+
}
|
|
68519
|
+
});
|
|
68520
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
68521
|
+
Object.assign(series, {
|
|
68522
|
+
userParam: {
|
|
68523
|
+
"EC.barWidth": "50%",
|
|
68524
|
+
"EC.barMaxWidth": "36",
|
|
68525
|
+
...this.getChartLabelParams(series, items),
|
|
68526
|
+
...this.getTooltipParams(series, controlParams.MODE === "ROW")
|
|
68527
|
+
}
|
|
68528
|
+
});
|
|
68529
|
+
});
|
|
68530
|
+
return report;
|
|
68531
|
+
}
|
|
68532
|
+
};
|
|
68533
|
+
|
|
68534
|
+
// src/controller/control/report-panel/generator/bi-converter/base/bar-converter-base.ts
|
|
68535
|
+
var BarConverterBase = class extends MultiSeriesConverter {
|
|
68536
|
+
/**
|
|
68537
|
+
* @description 获取控件参数
|
|
68538
|
+
* @returns {*} {IData}
|
|
68539
|
+
* @memberof BarConverterBase
|
|
68540
|
+
*/
|
|
68541
|
+
getChartControlParams() {
|
|
68542
|
+
const ctrlParams = super.getChartControlParams();
|
|
68543
|
+
Object.assign(ctrlParams, { MODE: "ROW" });
|
|
68544
|
+
return ctrlParams;
|
|
68545
|
+
}
|
|
68546
|
+
/**
|
|
68547
|
+
* @description 计算X轴参数
|
|
68548
|
+
* @returns {*} {IData}
|
|
68549
|
+
* @memberof BarConverterBase
|
|
68550
|
+
*/
|
|
68551
|
+
getChartXAxisParams() {
|
|
68552
|
+
const option = super.getChartXAxisParams();
|
|
68553
|
+
const tempOption = JSON.parse(option["EC.xAxis"]);
|
|
68554
|
+
Object.assign(tempOption, {
|
|
68555
|
+
type: "value",
|
|
68556
|
+
nameLocation: "center"
|
|
68557
|
+
});
|
|
68558
|
+
Object.assign(tempOption.nameTextStyle, {
|
|
68559
|
+
lineHeight: 60
|
|
68560
|
+
});
|
|
68561
|
+
tempOption.axisLabel.formatter = null;
|
|
68562
|
+
return { "EC.xAxis": JSON.stringify(tempOption) };
|
|
68563
|
+
}
|
|
68564
|
+
/**
|
|
68565
|
+
* @description 计算Y轴参数
|
|
68566
|
+
* @returns {*} {IData}
|
|
68567
|
+
* @memberof BarConverterBase
|
|
68568
|
+
*/
|
|
68569
|
+
getChartYAxisParams() {
|
|
68570
|
+
const { yaxis_name } = this.reportUIModel;
|
|
68571
|
+
const option = super.getChartYAxisParams();
|
|
68572
|
+
const tempOption = JSON.parse(option["EC.yAxis"]);
|
|
68573
|
+
let tempName = "";
|
|
68574
|
+
if (yaxis_name == "1") {
|
|
68575
|
+
tempName = void 0;
|
|
68576
|
+
}
|
|
68577
|
+
Object.assign(tempOption, {
|
|
68578
|
+
type: "category",
|
|
68579
|
+
name: tempName
|
|
68580
|
+
});
|
|
68581
|
+
Object.assign(tempOption.axisLabel, {
|
|
68582
|
+
...ChartUtil.xAxisLabel()
|
|
68583
|
+
});
|
|
68584
|
+
return { "EC.yAxis": JSON.stringify(tempOption) };
|
|
68585
|
+
}
|
|
68586
|
+
/**
|
|
68587
|
+
* @description 获取标签参数
|
|
68588
|
+
* @param {IModel} seriesModel
|
|
68589
|
+
* @param {IData[]} items
|
|
68590
|
+
* @returns {*} {IData}
|
|
68591
|
+
* @memberof BarConverterBase
|
|
68592
|
+
*/
|
|
68593
|
+
getChartLabelParams(seriesModel, items) {
|
|
68594
|
+
const {
|
|
68595
|
+
series_label_show,
|
|
68596
|
+
series_label_fontsize,
|
|
68597
|
+
series_label_position,
|
|
68598
|
+
series_label_fontstyle,
|
|
68599
|
+
series_label_fontcolor,
|
|
68600
|
+
series_label_data_range
|
|
68601
|
+
} = this.reportUIModel;
|
|
68602
|
+
const options = {
|
|
68603
|
+
show: series_label_show == "1",
|
|
68604
|
+
position: series_label_position
|
|
68152
68605
|
};
|
|
68153
|
-
|
|
68154
|
-
|
|
68155
|
-
"getdraft",
|
|
68156
|
-
context,
|
|
68157
|
-
params
|
|
68158
|
-
);
|
|
68159
|
-
const { data } = response;
|
|
68160
|
-
if (((_a3 = nodeRS == null ? void 0 : nodeRS.parentDER1N) == null ? void 0 : _a3.pickupDEFName) && parentNodeData) {
|
|
68161
|
-
data[nodeRS.parentDER1N.pickupDEFName] = parentNodeData._value;
|
|
68606
|
+
if (series_label_fontstyle) {
|
|
68607
|
+
series_label_fontstyle === "bold" ? options.fontWeight = series_label_fontstyle : options.fontStyle = series_label_fontstyle;
|
|
68162
68608
|
}
|
|
68163
|
-
|
|
68164
|
-
|
|
68165
|
-
|
|
68166
|
-
|
|
68167
|
-
|
|
68168
|
-
|
|
68169
|
-
|
|
68609
|
+
if (series_label_fontsize) {
|
|
68610
|
+
options.fontSize = Number(series_label_fontsize);
|
|
68611
|
+
}
|
|
68612
|
+
if (series_label_fontcolor) {
|
|
68613
|
+
options.color = series_label_fontcolor;
|
|
68614
|
+
}
|
|
68615
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
68616
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
68617
|
+
options.formatter = "function(param) { \n if(param.value[0] === ".concat(max2, " || param.value[0] === ").concat(min, "){\n return param.value[0];\n }\n return '';\n }");
|
|
68618
|
+
}
|
|
68619
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
68620
|
+
options.formatter = "function(param) {\n return param.value[0];\n }";
|
|
68621
|
+
}
|
|
68622
|
+
return { "EC.label": JSON.stringify(options) };
|
|
68170
68623
|
}
|
|
68624
|
+
};
|
|
68625
|
+
|
|
68626
|
+
// src/controller/control/report-panel/generator/bi-converter/base/zone-converter-base.ts
|
|
68627
|
+
import { clone as clone51 } from "ramda";
|
|
68628
|
+
var ZoneConverterBase = class extends MultiSeriesConverter {
|
|
68171
68629
|
/**
|
|
68172
|
-
*
|
|
68173
|
-
*
|
|
68174
|
-
* @
|
|
68175
|
-
* @date 2023-12-11 18:12:58
|
|
68176
|
-
* @param {(IGanttNodeData | undefined)} parentNodeData
|
|
68177
|
-
* @param {TreeFetchOpts} opts
|
|
68178
|
-
* @return {*} {(Promise<IGanttNodeData[] | undefined>)}
|
|
68630
|
+
* @description 获取控件参数
|
|
68631
|
+
* @returns {*} {IData}
|
|
68632
|
+
* @memberof ZoneConverterBase
|
|
68179
68633
|
*/
|
|
68180
|
-
|
|
68181
|
-
const
|
|
68182
|
-
|
|
68183
|
-
|
|
68184
|
-
|
|
68185
|
-
|
|
68186
|
-
|
|
68187
|
-
|
|
68188
|
-
|
|
68189
|
-
|
|
68190
|
-
|
|
68191
|
-
|
|
68192
|
-
|
|
68193
|
-
|
|
68194
|
-
|
|
68195
|
-
|
|
68196
|
-
|
|
68197
|
-
return;
|
|
68634
|
+
getChartControlParams() {
|
|
68635
|
+
const ctrlParams = super.getChartControlParams();
|
|
68636
|
+
Object.assign(ctrlParams, { ZONE: true });
|
|
68637
|
+
return ctrlParams;
|
|
68638
|
+
}
|
|
68639
|
+
/**
|
|
68640
|
+
* @description 计算X轴参数
|
|
68641
|
+
* @returns {*} {IData}
|
|
68642
|
+
* @memberof ZoneConverterBase
|
|
68643
|
+
*/
|
|
68644
|
+
getChartXAxisParams() {
|
|
68645
|
+
const option = super.getChartXAxisParams();
|
|
68646
|
+
const tempOption = JSON.parse(option["EC.xAxis"]);
|
|
68647
|
+
Object.assign(tempOption, {
|
|
68648
|
+
axisTick: {
|
|
68649
|
+
show: true
|
|
68650
|
+
// 坐标轴刻度线,模板会计算,不是最后一个的坐标系刻度线都会隐藏
|
|
68198
68651
|
}
|
|
68199
|
-
|
|
68200
|
-
|
|
68201
|
-
|
|
68202
|
-
|
|
68203
|
-
|
|
68204
|
-
|
|
68205
|
-
|
|
68206
|
-
|
|
68207
|
-
|
|
68208
|
-
|
|
68209
|
-
|
|
68210
|
-
|
|
68211
|
-
|
|
68212
|
-
|
|
68213
|
-
|
|
68214
|
-
|
|
68215
|
-
|
|
68652
|
+
});
|
|
68653
|
+
return { "EC.xAxis": JSON.stringify(tempOption) };
|
|
68654
|
+
}
|
|
68655
|
+
/**
|
|
68656
|
+
* @description 计算Y轴参数
|
|
68657
|
+
* @returns {*} {IData}
|
|
68658
|
+
* @memberof ZoneConverterBase
|
|
68659
|
+
*/
|
|
68660
|
+
getChartYAxisParams() {
|
|
68661
|
+
const option = super.getChartYAxisParams();
|
|
68662
|
+
const tempOption = JSON.parse(option["EC.yAxis"]);
|
|
68663
|
+
Object.assign(tempOption, {
|
|
68664
|
+
nameLocation: "center",
|
|
68665
|
+
nameGap: 50
|
|
68666
|
+
});
|
|
68667
|
+
Object.assign(tempOption.axisLabel, {
|
|
68668
|
+
width: 100,
|
|
68669
|
+
lineHeight: 1,
|
|
68670
|
+
rich: {
|
|
68671
|
+
top: {
|
|
68672
|
+
padding: [0, 0, 15, 0]
|
|
68673
|
+
},
|
|
68674
|
+
bottom: {
|
|
68675
|
+
padding: [10, 0, 0, 0]
|
|
68676
|
+
}
|
|
68677
|
+
}
|
|
68678
|
+
});
|
|
68679
|
+
return { "EC.yAxis": JSON.stringify(tempOption) };
|
|
68680
|
+
}
|
|
68681
|
+
/**
|
|
68682
|
+
* @description 计算序列模型
|
|
68683
|
+
* @param {IAppBIReportMeasure[]} measures 指标
|
|
68684
|
+
* @param {IAppBIReportDimension} dimension 维度
|
|
68685
|
+
* @param {IAppBIReportDimension} [groupDimension] 分组维度
|
|
68686
|
+
* @returns {*} {IModel[]}
|
|
68687
|
+
* @memberof ZoneConverterBase
|
|
68688
|
+
*/
|
|
68689
|
+
calcSeriesModel(measures, dimension, groupDimension) {
|
|
68690
|
+
const seriesModels = [];
|
|
68691
|
+
measures.forEach((item, index) => {
|
|
68692
|
+
const seriesModel = clone51(this.mockSerieModel);
|
|
68693
|
+
Object.assign(seriesModel, {
|
|
68694
|
+
id: "".concat(seriesModel.seriesType, "_").concat(index),
|
|
68695
|
+
caption: item.measureName,
|
|
68696
|
+
serieText: item.measureName,
|
|
68697
|
+
catalogName: dimension.dimensionName,
|
|
68698
|
+
valueField: item.measureTag.toLowerCase(),
|
|
68699
|
+
catalogCodeListId: dimension.appCodeListId,
|
|
68700
|
+
catalogField: dimension.dimensionTag.toLowerCase()
|
|
68216
68701
|
});
|
|
68217
|
-
|
|
68218
|
-
|
|
68702
|
+
Object.assign(seriesModel.chartSeriesEncode, {
|
|
68703
|
+
chartXAxisId: index,
|
|
68704
|
+
chartYAxisId: index
|
|
68705
|
+
});
|
|
68706
|
+
if (groupDimension)
|
|
68707
|
+
Object.assign(seriesModel, {
|
|
68708
|
+
seriesCodeListId: groupDimension.appCodeListId,
|
|
68709
|
+
seriesField: groupDimension.dimensionTag.toLowerCase()
|
|
68710
|
+
});
|
|
68711
|
+
seriesModels.push(seriesModel);
|
|
68712
|
+
});
|
|
68713
|
+
return seriesModels;
|
|
68219
68714
|
}
|
|
68715
|
+
};
|
|
68716
|
+
|
|
68717
|
+
// src/controller/control/report-panel/generator/bi-converter/base/grid-converter-base.ts
|
|
68718
|
+
var GridConverterBase = class extends ConverterBase {
|
|
68220
68719
|
/**
|
|
68221
|
-
*
|
|
68222
|
-
*
|
|
68223
|
-
* @
|
|
68224
|
-
* @date 2023-12-11 18:12:35
|
|
68225
|
-
* @protected
|
|
68226
|
-
* @param {IDETreeNode} nodeModel
|
|
68227
|
-
* @param {(IDETreeNodeRS | undefined)} nodeRS
|
|
68228
|
-
* @param {(ITreeNodeData | undefined)} parentNodeData
|
|
68229
|
-
* @param {TreeFetchOpts} opts
|
|
68230
|
-
* @return {*} {Promise<IGanttNodeData[]>}
|
|
68720
|
+
* @description 获取表格样式
|
|
68721
|
+
* @returns {*} {IData}
|
|
68722
|
+
* @memberof GridConverterBase
|
|
68231
68723
|
*/
|
|
68232
|
-
|
|
68233
|
-
const
|
|
68234
|
-
|
|
68235
|
-
|
|
68236
|
-
|
|
68237
|
-
|
|
68238
|
-
|
|
68239
|
-
|
|
68240
|
-
|
|
68241
|
-
|
|
68242
|
-
|
|
68243
|
-
|
|
68244
|
-
|
|
68245
|
-
|
|
68246
|
-
|
|
68724
|
+
getGridStyle() {
|
|
68725
|
+
const result = {
|
|
68726
|
+
vars: {},
|
|
68727
|
+
classList: [],
|
|
68728
|
+
model: { controlParam: {} }
|
|
68729
|
+
};
|
|
68730
|
+
const {
|
|
68731
|
+
grid_show_agg,
|
|
68732
|
+
grid_header_fontstyle,
|
|
68733
|
+
grid_header_fontsize,
|
|
68734
|
+
grid_header_fontcolor,
|
|
68735
|
+
grid_header_position,
|
|
68736
|
+
grid_body_fontstyle,
|
|
68737
|
+
grid_body_fontsize,
|
|
68738
|
+
grid_body_fontcolor,
|
|
68739
|
+
grid_agg_row_position,
|
|
68740
|
+
grid_function_setting
|
|
68741
|
+
} = this.reportUIModel;
|
|
68742
|
+
result.vars = {
|
|
68743
|
+
"--ibiz-control-grid-header-align": grid_header_position,
|
|
68744
|
+
"--ibiz-control-grid-header-font-size": "".concat(grid_header_fontsize, "px"),
|
|
68745
|
+
"--ibiz-control-grid-header-text-color": grid_header_fontcolor,
|
|
68746
|
+
"--ibiz-control-grid-content-font-size": "".concat(grid_body_fontsize, "px"),
|
|
68747
|
+
"--ibiz-control-grid-content-text-color": grid_body_fontcolor
|
|
68748
|
+
};
|
|
68749
|
+
if (grid_header_fontstyle) {
|
|
68750
|
+
const key = grid_header_fontstyle === "bold" ? "--ibiz-control-grid-header-font-weight" : "--ibiz-control-grid-header-font-style";
|
|
68751
|
+
result.vars[key] = grid_header_fontstyle;
|
|
68752
|
+
}
|
|
68753
|
+
if (grid_body_fontstyle) {
|
|
68754
|
+
const key = grid_body_fontstyle === "bold" ? "--ibiz-control-grid-content-font-weight" : "--ibiz-control-grid-content-font-style";
|
|
68755
|
+
result.vars[key] = grid_body_fontstyle;
|
|
68756
|
+
}
|
|
68757
|
+
if (grid_show_agg == "1") {
|
|
68758
|
+
Object.assign(result.model, { aggMode: "PAGE" });
|
|
68759
|
+
if (grid_agg_row_position === "top") {
|
|
68760
|
+
result.classList.push("el-table--top-agg");
|
|
68761
|
+
}
|
|
68762
|
+
}
|
|
68763
|
+
if (grid_function_setting) {
|
|
68764
|
+
const ctrlParams = {};
|
|
68765
|
+
if (grid_function_setting.indexOf("fixedGridHeader") === -1) {
|
|
68766
|
+
result.classList.push("el-table--scroll-header");
|
|
68767
|
+
}
|
|
68768
|
+
if (grid_function_setting.indexOf("fixedDimension") !== -1 && this.dimensions) {
|
|
68769
|
+
Object.assign(result.model, {
|
|
68770
|
+
frozenFirstColumn: this.dimensions.length
|
|
68771
|
+
});
|
|
68772
|
+
}
|
|
68773
|
+
if (grid_function_setting.indexOf("showPercent") !== -1) {
|
|
68774
|
+
Object.assign(ctrlParams, {
|
|
68775
|
+
percentkeys: JSON.stringify(
|
|
68776
|
+
this.measures.map((x) => x.measureTag.toLowerCase())
|
|
68777
|
+
)
|
|
68778
|
+
});
|
|
68779
|
+
}
|
|
68780
|
+
Object.assign(result.model.controlParam, { ctrlParams });
|
|
68781
|
+
}
|
|
68782
|
+
return result;
|
|
68783
|
+
}
|
|
68784
|
+
/**
|
|
68785
|
+
* @description 计算表格列样式
|
|
68786
|
+
* @param {boolean} [enableAgg=true]
|
|
68787
|
+
* @returns {*} {IData}
|
|
68788
|
+
* @memberof GridConverterBase
|
|
68789
|
+
*/
|
|
68790
|
+
calcGridColumnStyle(enableAgg = true) {
|
|
68791
|
+
const { grid_body_position, grid_show_agg } = this.reportUIModel;
|
|
68792
|
+
const result = {};
|
|
68793
|
+
if (grid_body_position)
|
|
68794
|
+
result.align = grid_body_position;
|
|
68795
|
+
if (enableAgg && grid_show_agg == "1")
|
|
68796
|
+
result.aggMode = "SUM";
|
|
68797
|
+
return result;
|
|
68798
|
+
}
|
|
68799
|
+
/**
|
|
68800
|
+
* @description 计算表格列合并
|
|
68801
|
+
* @param {IData[]} [items=[]] 表格展示数据
|
|
68802
|
+
* @returns {*} {IData}
|
|
68803
|
+
* @memberof GridConverterBase
|
|
68804
|
+
*/
|
|
68805
|
+
calcGridColumnMerge(items = []) {
|
|
68806
|
+
const { grid_function_setting } = this.reportUIModel;
|
|
68807
|
+
const result = { controlAttributes: [], rowspans: [] };
|
|
68808
|
+
if (grid_function_setting.indexOf("dimensionMerge") !== -1) {
|
|
68809
|
+
const columnKeys = this.dimensions.map(
|
|
68810
|
+
(dimension) => dimension.dimensionTag.toLowerCase()
|
|
68811
|
+
);
|
|
68812
|
+
const rowspans = [];
|
|
68813
|
+
columnKeys.forEach((columnKey, colIndex) => {
|
|
68814
|
+
rowspans[colIndex] = [];
|
|
68815
|
+
let pos = 0;
|
|
68816
|
+
if (colIndex === 0) {
|
|
68817
|
+
while (pos < items.length) {
|
|
68818
|
+
let count = 1;
|
|
68819
|
+
const currentValue = items[pos][columnKey];
|
|
68820
|
+
while (pos + count < items.length && items[pos + count][columnKey] === currentValue) {
|
|
68821
|
+
count++;
|
|
68822
|
+
}
|
|
68823
|
+
for (let i = 0; i < count; i++) {
|
|
68824
|
+
rowspans[colIndex][pos + i] = i === 0 ? count : 0;
|
|
68825
|
+
}
|
|
68826
|
+
pos += count;
|
|
68827
|
+
}
|
|
68828
|
+
} else {
|
|
68829
|
+
let prevPos = 0;
|
|
68830
|
+
while (prevPos < items.length) {
|
|
68831
|
+
const prevSpan = rowspans[colIndex - 1][prevPos];
|
|
68832
|
+
if (prevSpan > 0) {
|
|
68833
|
+
let innerPos = prevPos;
|
|
68834
|
+
while (innerPos < prevPos + prevSpan) {
|
|
68835
|
+
let count = 1;
|
|
68836
|
+
const currentValue = items[innerPos][columnKey];
|
|
68837
|
+
while (innerPos + count < prevPos + prevSpan && items[innerPos + count][columnKey] === currentValue) {
|
|
68838
|
+
count++;
|
|
68839
|
+
}
|
|
68840
|
+
for (let i = 0; i < count; i++) {
|
|
68841
|
+
rowspans[colIndex][innerPos + i] = i === 0 ? count : 0;
|
|
68842
|
+
}
|
|
68843
|
+
innerPos += count;
|
|
68844
|
+
}
|
|
68845
|
+
} else {
|
|
68846
|
+
rowspans[colIndex][prevPos] = 0;
|
|
68847
|
+
}
|
|
68848
|
+
prevPos += Math.max(1, rowspans[colIndex - 1][prevPos]);
|
|
68849
|
+
}
|
|
68850
|
+
}
|
|
68851
|
+
});
|
|
68852
|
+
const spanMethod = {
|
|
68853
|
+
attrName: "span-method",
|
|
68854
|
+
attrValue: "const { row, column, rowIndex, columnIndex } = metadata;\n const { rowspans } = ctrl.model;\n if (rowspans[columnIndex] && rowspans[columnIndex][rowIndex] !== undefined) {\n const span = rowspans[columnIndex][rowIndex];\n return {\n rowspan: span > 0 ? span : 0,\n colspan: span > 0 ? 1 : 0,\n };\n }\n return { rowspan: 1, colspan: 1 };"
|
|
68855
|
+
};
|
|
68856
|
+
result.rowspans = rowspans;
|
|
68857
|
+
result.controlAttributes.push(spanMethod);
|
|
68858
|
+
}
|
|
68859
|
+
return result;
|
|
68860
|
+
}
|
|
68861
|
+
/**
|
|
68862
|
+
* @description 初始化
|
|
68863
|
+
* - 处理列顺序
|
|
68864
|
+
* @protected
|
|
68865
|
+
* @returns {*} {Promise<void>}
|
|
68866
|
+
* @memberof GridConverterBase
|
|
68867
|
+
*/
|
|
68868
|
+
async onInit() {
|
|
68869
|
+
const { appBIReportDimensions } = this.appBIReport;
|
|
68870
|
+
const { grid_col_sort } = this.reportUIModel;
|
|
68871
|
+
this.dimensions = [];
|
|
68872
|
+
grid_col_sort.forEach((col) => {
|
|
68873
|
+
const dimension = appBIReportDimensions == null ? void 0 : appBIReportDimensions.find(
|
|
68874
|
+
(d) => {
|
|
68875
|
+
var _a3;
|
|
68876
|
+
return ((_a3 = d.dimensionTag) == null ? void 0 : _a3.toLowerCase()) === col.codename.toLowerCase();
|
|
68877
|
+
}
|
|
68878
|
+
);
|
|
68879
|
+
if (dimension)
|
|
68880
|
+
this.dimensions.push(dimension);
|
|
68881
|
+
});
|
|
68882
|
+
}
|
|
68883
|
+
};
|
|
68884
|
+
|
|
68885
|
+
// src/controller/control/report-panel/generator/bi-converter/stack-col-converter.ts
|
|
68886
|
+
var StackColConverter = class extends MultiSeriesConverter {
|
|
68887
|
+
constructor() {
|
|
68888
|
+
super(...arguments);
|
|
68889
|
+
/**
|
|
68890
|
+
* @description 仿真模型
|
|
68891
|
+
* @type {IModel}
|
|
68892
|
+
* @memberof StackColConverter
|
|
68893
|
+
*/
|
|
68894
|
+
this.mockModel = {
|
|
68895
|
+
userParam: {},
|
|
68896
|
+
dechartLegend: {
|
|
68897
|
+
id: "legend",
|
|
68898
|
+
showLegend: false,
|
|
68899
|
+
appId: this.appBIReport.appId
|
|
68900
|
+
},
|
|
68901
|
+
dechartTitle: {
|
|
68902
|
+
id: "title",
|
|
68903
|
+
showTitle: false,
|
|
68904
|
+
appId: this.appBIReport.appId
|
|
68905
|
+
},
|
|
68906
|
+
chartXAxises: [
|
|
68907
|
+
{
|
|
68908
|
+
id: "0",
|
|
68909
|
+
type: "category",
|
|
68910
|
+
position: "bottom",
|
|
68911
|
+
echartsPos: "xAxis",
|
|
68912
|
+
name: "axis_xAxis_0",
|
|
68913
|
+
echartsType: "category",
|
|
68914
|
+
appId: this.appBIReport.appId
|
|
68915
|
+
}
|
|
68916
|
+
],
|
|
68917
|
+
chartYAxises: [
|
|
68918
|
+
{
|
|
68919
|
+
id: "0",
|
|
68920
|
+
type: "numeric",
|
|
68921
|
+
position: "left",
|
|
68922
|
+
echartsPos: "yAxis",
|
|
68923
|
+
echartsType: "value",
|
|
68924
|
+
name: "axis_yAxis_0",
|
|
68925
|
+
appId: this.appBIReport.appId
|
|
68926
|
+
}
|
|
68927
|
+
],
|
|
68928
|
+
readOnly: true,
|
|
68929
|
+
autoLoad: true,
|
|
68930
|
+
dechartSerieses: [],
|
|
68931
|
+
controlType: "CHART",
|
|
68932
|
+
id: this.appBIReport.id,
|
|
68933
|
+
showBusyIndicator: true,
|
|
68934
|
+
name: this.appBIReport.id,
|
|
68935
|
+
appId: this.appBIReport.appId,
|
|
68936
|
+
codeName: this.appBIReport.id,
|
|
68937
|
+
caption: this.appBIReport.name,
|
|
68938
|
+
logicName: this.appBIReport.name,
|
|
68939
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
68940
|
+
};
|
|
68941
|
+
/**
|
|
68942
|
+
* @description 仿真序列模型
|
|
68943
|
+
* @type {IModel}
|
|
68944
|
+
* @memberof StackColConverter
|
|
68945
|
+
*/
|
|
68946
|
+
this.mockSerieModel = {
|
|
68947
|
+
chartSeriesEncode: {
|
|
68948
|
+
id: "0",
|
|
68949
|
+
type: "XY",
|
|
68950
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
68951
|
+
chartXAxisId: "0",
|
|
68952
|
+
chartYAxisId: "0",
|
|
68953
|
+
appId: this.appBIReport.appId
|
|
68954
|
+
},
|
|
68955
|
+
seriesType: "bar",
|
|
68956
|
+
echartsType: "bar",
|
|
68957
|
+
chartDataSetId: "0",
|
|
68958
|
+
seriesLayoutBy: "column",
|
|
68959
|
+
enableChartDataSet: true,
|
|
68960
|
+
chartCoordinateSystemId: "0",
|
|
68961
|
+
appId: this.appBIReport.appId
|
|
68962
|
+
};
|
|
68963
|
+
}
|
|
68964
|
+
/**
|
|
68965
|
+
* @description 转化数据到报表
|
|
68966
|
+
* @param {IData[]} items
|
|
68967
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
68968
|
+
* @memberof StackColConverter
|
|
68969
|
+
*/
|
|
68970
|
+
translateDataToReport(items) {
|
|
68971
|
+
var _a3;
|
|
68972
|
+
const report = super.translateDataToReport(items);
|
|
68973
|
+
if (report) {
|
|
68974
|
+
const { model } = report;
|
|
68975
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
68976
|
+
Object.assign(series.userParam, {
|
|
68977
|
+
"EC.stack": "stackcol"
|
|
68978
|
+
});
|
|
68979
|
+
});
|
|
68980
|
+
}
|
|
68981
|
+
return report;
|
|
68982
|
+
}
|
|
68983
|
+
};
|
|
68984
|
+
|
|
68985
|
+
// src/controller/control/report-panel/generator/bi-converter/multi-series-col-converter.ts
|
|
68986
|
+
var MultiSeriesColConverter = class extends MultiSeriesConverter {
|
|
68987
|
+
constructor() {
|
|
68988
|
+
super(...arguments);
|
|
68989
|
+
/**
|
|
68990
|
+
* @description 仿真模型
|
|
68991
|
+
* @type {IModel}
|
|
68992
|
+
* @memberof MultiSeriesColConverter
|
|
68993
|
+
*/
|
|
68994
|
+
this.mockModel = {
|
|
68995
|
+
userParam: {},
|
|
68996
|
+
dechartLegend: {
|
|
68997
|
+
id: "legend",
|
|
68998
|
+
showLegend: false,
|
|
68999
|
+
appId: this.appBIReport.appId
|
|
69000
|
+
},
|
|
69001
|
+
dechartTitle: {
|
|
69002
|
+
id: "title",
|
|
69003
|
+
showTitle: false,
|
|
69004
|
+
appId: this.appBIReport.appId
|
|
69005
|
+
},
|
|
69006
|
+
chartXAxises: [
|
|
69007
|
+
{
|
|
69008
|
+
id: "0",
|
|
69009
|
+
type: "category",
|
|
69010
|
+
echartsPos: "xAxis",
|
|
69011
|
+
position: "bottom",
|
|
69012
|
+
name: "axis_xAxis_0",
|
|
69013
|
+
echartsType: "category",
|
|
69014
|
+
appId: this.appBIReport.appId
|
|
69015
|
+
}
|
|
69016
|
+
],
|
|
69017
|
+
chartYAxises: [
|
|
69018
|
+
{
|
|
69019
|
+
id: "0",
|
|
69020
|
+
type: "numeric",
|
|
69021
|
+
position: "left",
|
|
69022
|
+
echartsPos: "yAxis",
|
|
69023
|
+
name: "axis_yAxis_0",
|
|
69024
|
+
echartsType: "value",
|
|
69025
|
+
appId: this.appBIReport.appId
|
|
69026
|
+
}
|
|
69027
|
+
],
|
|
69028
|
+
readOnly: true,
|
|
69029
|
+
autoLoad: true,
|
|
69030
|
+
dechartSerieses: [],
|
|
69031
|
+
controlType: "CHART",
|
|
69032
|
+
showBusyIndicator: true,
|
|
69033
|
+
id: this.appBIReport.id,
|
|
69034
|
+
name: this.appBIReport.id,
|
|
69035
|
+
appId: this.appBIReport.appId,
|
|
69036
|
+
codeName: this.appBIReport.id,
|
|
69037
|
+
caption: this.appBIReport.name,
|
|
69038
|
+
logicName: this.appBIReport.name,
|
|
69039
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69040
|
+
};
|
|
69041
|
+
/**
|
|
69042
|
+
* @description 仿真序列模型
|
|
69043
|
+
* @type {IModel}
|
|
69044
|
+
* @memberof MultiSeriesColConverter
|
|
69045
|
+
*/
|
|
69046
|
+
this.mockSerieModel = {
|
|
69047
|
+
chartSeriesEncode: {
|
|
69048
|
+
id: "0",
|
|
69049
|
+
type: "XY",
|
|
69050
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69051
|
+
chartXAxisId: "0",
|
|
69052
|
+
chartYAxisId: "0",
|
|
69053
|
+
appId: this.appBIReport.appId
|
|
69054
|
+
},
|
|
69055
|
+
seriesType: "bar",
|
|
69056
|
+
echartsType: "bar",
|
|
69057
|
+
chartDataSetId: "0",
|
|
69058
|
+
seriesLayoutBy: "column",
|
|
69059
|
+
enableChartDataSet: true,
|
|
69060
|
+
chartCoordinateSystemId: "0",
|
|
69061
|
+
appId: this.appBIReport.appId
|
|
69062
|
+
};
|
|
69063
|
+
}
|
|
69064
|
+
};
|
|
69065
|
+
|
|
69066
|
+
// src/controller/control/report-panel/generator/bi-converter/gauge-converter.ts
|
|
69067
|
+
import { clone as clone52 } from "ramda";
|
|
69068
|
+
var GaugeConverter = class extends EchartConverterBase {
|
|
69069
|
+
constructor() {
|
|
69070
|
+
super(...arguments);
|
|
69071
|
+
/**
|
|
69072
|
+
* @description 仿真模型
|
|
69073
|
+
* @type {IModel}
|
|
69074
|
+
* @memberof GaugeConverter
|
|
69075
|
+
*/
|
|
69076
|
+
this.mockModel = {
|
|
69077
|
+
userParam: {},
|
|
69078
|
+
dechartLegend: {
|
|
69079
|
+
id: "legend",
|
|
69080
|
+
showLegend: false,
|
|
69081
|
+
appId: this.appBIReport.appId
|
|
69082
|
+
},
|
|
69083
|
+
dechartTitle: {
|
|
69084
|
+
id: "title",
|
|
69085
|
+
showTitle: false,
|
|
69086
|
+
appId: this.appBIReport.appId
|
|
69087
|
+
},
|
|
69088
|
+
readOnly: true,
|
|
69089
|
+
autoLoad: true,
|
|
69090
|
+
dechartSerieses: [],
|
|
69091
|
+
controlType: "CHART",
|
|
69092
|
+
showBusyIndicator: true,
|
|
69093
|
+
id: this.appBIReport.id,
|
|
69094
|
+
name: this.appBIReport.id,
|
|
69095
|
+
appId: this.appBIReport.appId,
|
|
69096
|
+
codeName: this.appBIReport.id,
|
|
69097
|
+
caption: this.appBIReport.name,
|
|
69098
|
+
logicName: this.appBIReport.name,
|
|
69099
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69100
|
+
};
|
|
69101
|
+
/**
|
|
69102
|
+
* @description 仿真序列模型
|
|
69103
|
+
* @type {IModel}
|
|
69104
|
+
* @memberof GaugeConverter
|
|
69105
|
+
*/
|
|
69106
|
+
this.mockSerieModel = {
|
|
69107
|
+
seriesType: "gauge",
|
|
69108
|
+
echartsType: "gauge",
|
|
69109
|
+
chartDataSetId: "0",
|
|
69110
|
+
seriesLayoutBy: "column",
|
|
69111
|
+
enableChartDataSet: true,
|
|
69112
|
+
chartCoordinateSystemId: "0",
|
|
69113
|
+
appId: this.appBIReport.appId
|
|
69114
|
+
};
|
|
69115
|
+
}
|
|
69116
|
+
/**
|
|
69117
|
+
* @description 计算序列模型
|
|
69118
|
+
* @param {IAppBIReportMeasure[]} measures
|
|
69119
|
+
* @param {IAppBIReportDimension} dimension
|
|
69120
|
+
* @param {IAppBIReportDimension} [groupDimension]
|
|
69121
|
+
* @returns {*} {IModel[]}
|
|
69122
|
+
* @memberof GaugeConverter
|
|
69123
|
+
*/
|
|
69124
|
+
calcSeriesModel(measures, dimension, groupDimension) {
|
|
69125
|
+
const seriesModels = [];
|
|
69126
|
+
measures.forEach((item, index) => {
|
|
69127
|
+
const seriesModel = clone52(this.mockSerieModel);
|
|
69128
|
+
Object.assign(seriesModel, {
|
|
69129
|
+
id: "".concat(seriesModel.seriesType, "_").concat(index),
|
|
69130
|
+
caption: item.measureName,
|
|
69131
|
+
serieText: item.measureName,
|
|
69132
|
+
catalogName: item.measureName,
|
|
69133
|
+
valueField: item.measureTag.toLowerCase(),
|
|
69134
|
+
catalogField: item.measureTag.toLowerCase()
|
|
69135
|
+
});
|
|
69136
|
+
if (groupDimension)
|
|
69137
|
+
Object.assign(seriesModel, {
|
|
69138
|
+
seriesCodeListId: groupDimension.appCodeListId,
|
|
69139
|
+
seriesField: groupDimension.dimensionTag.toLowerCase()
|
|
69140
|
+
});
|
|
69141
|
+
seriesModels.push(seriesModel);
|
|
69142
|
+
});
|
|
69143
|
+
return seriesModels;
|
|
69144
|
+
}
|
|
69145
|
+
/**
|
|
69146
|
+
* @description 转化数据到报表
|
|
69147
|
+
* @param {IData[]} items
|
|
69148
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69149
|
+
* @memberof GaugeConverter
|
|
69150
|
+
*/
|
|
69151
|
+
translateDataToReport(items) {
|
|
69152
|
+
var _a3;
|
|
69153
|
+
if (!this.measures.length)
|
|
69154
|
+
return;
|
|
69155
|
+
const model = clone52(this.mockModel);
|
|
69156
|
+
const seriesModels = this.calcSeriesModel(
|
|
69157
|
+
this.measures,
|
|
69158
|
+
this.dimensions[0],
|
|
69159
|
+
this.groupDimension
|
|
69160
|
+
);
|
|
69161
|
+
if (model.dechartSerieses)
|
|
69162
|
+
model.dechartSerieses.push(...seriesModels);
|
|
69163
|
+
const chartColorParams = this.getChartColorParams();
|
|
69164
|
+
Object.assign(model.userParam, chartColorParams);
|
|
69165
|
+
const serieParam = this.commputeSeriesParam();
|
|
69166
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69167
|
+
Object.assign(series, {
|
|
69168
|
+
userParam: serieParam
|
|
69169
|
+
});
|
|
69170
|
+
});
|
|
69171
|
+
return { model, options: {}, data: items };
|
|
69172
|
+
}
|
|
69173
|
+
/**
|
|
69174
|
+
* @description 计算序列参数
|
|
69175
|
+
* @returns {*} {IData}
|
|
69176
|
+
* @memberof GaugeConverter
|
|
69177
|
+
*/
|
|
69178
|
+
commputeSeriesParam() {
|
|
69179
|
+
const {
|
|
69180
|
+
series_max,
|
|
69181
|
+
series_detail_fontsize,
|
|
69182
|
+
series_detail_fontstyle,
|
|
69183
|
+
series_detail_fontcolor
|
|
69184
|
+
} = this.reportUIModel;
|
|
69185
|
+
const seriesParams = {
|
|
69186
|
+
"EC.radius": "90%",
|
|
69187
|
+
"EC.startAngle": "220",
|
|
69188
|
+
"EC.endAngle": "-40",
|
|
69189
|
+
"EC.splitNumber": "4",
|
|
69190
|
+
"EC.tooltip": '{\n formatter:function(param){\n return "<div style=\'min-width:150px\'><div>"+ param.seriesId +"</div><div><span style=\'margin-right:16px\'>"+ param.marker + param.name+"</span>"+ param.value+"</div></div>"\n }\n }',
|
|
69191
|
+
"EC.axisTick": '{"splitNumber":5,"distance":5,"lineStyle":{"width":2,"color":"#ddd"}}',
|
|
69192
|
+
"EC.splitLine": '{"length":10,"distance":5,"lineStyle":{"width":2,"color":"#ddd"}}',
|
|
69193
|
+
"EC.title": '{"show":false}',
|
|
69194
|
+
"EC.pointer": '{"length":"50%"}',
|
|
69195
|
+
"EC.detail": '{"offsetCenter":[0,"60%"]}',
|
|
69196
|
+
"EC.progress": '{"show":true,"width":60}',
|
|
69197
|
+
"EC.axisLine": '{"lineStyle":{"width":60,"color":[[1,"rgb(245, 245, 245)"]]}}',
|
|
69198
|
+
"EC.axisLabel": '{"distance":76,"color":"#333","fontSize":12,"formatter": "function (num){return (num * 100) / 100 + `%` }"}'
|
|
69199
|
+
};
|
|
69200
|
+
const options = {
|
|
69201
|
+
offsetCenter: [0, "60%"],
|
|
69202
|
+
fontSize: series_detail_fontsize,
|
|
69203
|
+
color: series_detail_fontcolor
|
|
69204
|
+
};
|
|
69205
|
+
if (series_detail_fontstyle) {
|
|
69206
|
+
if (series_detail_fontstyle === "bold") {
|
|
69207
|
+
options.fontWeight = series_detail_fontstyle;
|
|
69208
|
+
} else {
|
|
69209
|
+
options.fontWeight = "normal";
|
|
69210
|
+
options.fontStyle = series_detail_fontstyle;
|
|
69211
|
+
}
|
|
69212
|
+
}
|
|
69213
|
+
seriesParams["EC.detail"] = JSON.stringify(options);
|
|
69214
|
+
if (series_max) {
|
|
69215
|
+
seriesParams["EC.max"] = JSON.stringify(series_max);
|
|
69216
|
+
seriesParams["EC.axisLabel"] = JSON.stringify({
|
|
69217
|
+
distance: 76,
|
|
69218
|
+
color: "#333",
|
|
69219
|
+
fontSize: 12,
|
|
69220
|
+
formatter: "function (num){return (num * 100) / '".concat(series_max, "' + '%' }")
|
|
69221
|
+
});
|
|
69222
|
+
}
|
|
69223
|
+
return seriesParams;
|
|
69224
|
+
}
|
|
69225
|
+
};
|
|
69226
|
+
|
|
69227
|
+
// src/controller/control/report-panel/generator/bi-converter/multi-series-bar-converter.ts
|
|
69228
|
+
var MultiSeriesBarConverter = class extends BarConverterBase {
|
|
69229
|
+
constructor() {
|
|
69230
|
+
super(...arguments);
|
|
69231
|
+
/**
|
|
69232
|
+
* @description 仿真模型
|
|
69233
|
+
* @type {IModel}
|
|
69234
|
+
* @memberof MultiSeriesBarConverter
|
|
69235
|
+
*/
|
|
69236
|
+
this.mockModel = {
|
|
69237
|
+
dechartLegend: {
|
|
69238
|
+
id: "legend",
|
|
69239
|
+
showLegend: false,
|
|
69240
|
+
appId: this.appBIReport.appId
|
|
69241
|
+
},
|
|
69242
|
+
dechartTitle: {
|
|
69243
|
+
id: "title",
|
|
69244
|
+
showTitle: false,
|
|
69245
|
+
appId: this.appBIReport.appId
|
|
69246
|
+
},
|
|
69247
|
+
chartXAxises: [
|
|
69248
|
+
{
|
|
69249
|
+
id: "0",
|
|
69250
|
+
type: "category",
|
|
69251
|
+
position: "bottom",
|
|
69252
|
+
echartsPos: "xAxis",
|
|
69253
|
+
name: "axis_xAxis_0",
|
|
69254
|
+
echartsType: "category",
|
|
69255
|
+
appId: this.appBIReport.appId
|
|
69256
|
+
}
|
|
69257
|
+
],
|
|
69258
|
+
chartYAxises: [
|
|
69259
|
+
{
|
|
69260
|
+
id: "0",
|
|
69261
|
+
type: "numeric",
|
|
69262
|
+
position: "left",
|
|
69263
|
+
echartsPos: "yAxis",
|
|
69264
|
+
echartsType: "value",
|
|
69265
|
+
name: "axis_yAxis_0",
|
|
69266
|
+
appId: this.appBIReport.appId
|
|
69267
|
+
}
|
|
69268
|
+
],
|
|
69269
|
+
readOnly: true,
|
|
69270
|
+
autoLoad: true,
|
|
69271
|
+
dechartSerieses: [],
|
|
69272
|
+
controlType: "CHART",
|
|
69273
|
+
showBusyIndicator: true,
|
|
69274
|
+
id: this.appBIReport.id,
|
|
69275
|
+
name: this.appBIReport.id,
|
|
69276
|
+
appId: this.appBIReport.appId,
|
|
69277
|
+
codeName: this.appBIReport.id,
|
|
69278
|
+
caption: this.appBIReport.name,
|
|
69279
|
+
logicName: this.appBIReport.name,
|
|
69280
|
+
appDataEntityId: this.appBIReport.appDataEntityId,
|
|
69281
|
+
userParam: {}
|
|
69282
|
+
};
|
|
69283
|
+
/**
|
|
69284
|
+
* @description 仿真序列模型
|
|
69285
|
+
* @type {IModel}
|
|
69286
|
+
* @memberof MultiSeriesBarConverter
|
|
69287
|
+
*/
|
|
69288
|
+
this.mockSerieModel = {
|
|
69289
|
+
chartSeriesEncode: {
|
|
69290
|
+
id: "0",
|
|
69291
|
+
type: "XY",
|
|
69292
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69293
|
+
chartXAxisId: "0",
|
|
69294
|
+
chartYAxisId: "0",
|
|
69295
|
+
appId: this.appBIReport.appId
|
|
69296
|
+
},
|
|
69297
|
+
seriesType: "bar",
|
|
69298
|
+
echartsType: "bar",
|
|
69299
|
+
chartDataSetId: "0",
|
|
69300
|
+
seriesLayoutBy: "column",
|
|
69301
|
+
enableChartDataSet: true,
|
|
69302
|
+
chartCoordinateSystemId: "0",
|
|
69303
|
+
appId: this.appBIReport.appId
|
|
69304
|
+
};
|
|
69305
|
+
}
|
|
69306
|
+
};
|
|
69307
|
+
|
|
69308
|
+
// src/controller/control/report-panel/generator/bi-converter/zone-col-converter.ts
|
|
69309
|
+
var ZoneColConverter = class extends ZoneConverterBase {
|
|
69310
|
+
constructor() {
|
|
69311
|
+
super(...arguments);
|
|
69312
|
+
/**
|
|
69313
|
+
* @description 仿真模型
|
|
69314
|
+
* @type {IModel}
|
|
69315
|
+
* @memberof ZoneColConverter
|
|
69316
|
+
*/
|
|
69317
|
+
this.mockModel = {
|
|
69318
|
+
userParam: {},
|
|
69319
|
+
dechartLegend: {
|
|
69320
|
+
id: "legend",
|
|
69321
|
+
showLegend: false,
|
|
69322
|
+
appId: this.appBIReport.appId
|
|
69323
|
+
},
|
|
69324
|
+
dechartTitle: {
|
|
69325
|
+
id: "title",
|
|
69326
|
+
showTitle: false,
|
|
69327
|
+
appId: this.appBIReport.appId
|
|
69328
|
+
},
|
|
69329
|
+
chartXAxises: [
|
|
69330
|
+
{
|
|
69331
|
+
id: "0",
|
|
69332
|
+
type: "category",
|
|
69333
|
+
position: "bottom",
|
|
69334
|
+
echartsPos: "xAxis",
|
|
69335
|
+
name: "axis_xAxis_0",
|
|
69336
|
+
echartsType: "category",
|
|
69337
|
+
appId: this.appBIReport.appId
|
|
69338
|
+
}
|
|
69339
|
+
],
|
|
69340
|
+
chartYAxises: [
|
|
69341
|
+
{
|
|
69342
|
+
id: "0",
|
|
69343
|
+
type: "numeric",
|
|
69344
|
+
position: "left",
|
|
69345
|
+
echartsPos: "yAxis",
|
|
69346
|
+
echartsType: "value",
|
|
69347
|
+
name: "axis_yAxis_0",
|
|
69348
|
+
appId: this.appBIReport.appId
|
|
69349
|
+
}
|
|
69350
|
+
],
|
|
69351
|
+
readOnly: true,
|
|
69352
|
+
autoLoad: true,
|
|
69353
|
+
dechartSerieses: [],
|
|
69354
|
+
controlType: "CHART",
|
|
69355
|
+
id: this.appBIReport.id,
|
|
69356
|
+
showBusyIndicator: true,
|
|
69357
|
+
name: this.appBIReport.id,
|
|
69358
|
+
appId: this.appBIReport.appId,
|
|
69359
|
+
codeName: this.appBIReport.id,
|
|
69360
|
+
caption: this.appBIReport.name,
|
|
69361
|
+
logicName: this.appBIReport.name,
|
|
69362
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69363
|
+
};
|
|
69364
|
+
/**
|
|
69365
|
+
* @description 仿真序列模型
|
|
69366
|
+
* @type {IModel}
|
|
69367
|
+
* @memberof ZoneColConverter
|
|
69368
|
+
*/
|
|
69369
|
+
this.mockSerieModel = {
|
|
69370
|
+
chartSeriesEncode: {
|
|
69371
|
+
id: "0",
|
|
69372
|
+
type: "XY",
|
|
69373
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69374
|
+
chartXAxisId: "0",
|
|
69375
|
+
chartYAxisId: "0",
|
|
69376
|
+
appId: this.appBIReport.appId
|
|
69377
|
+
},
|
|
69378
|
+
seriesType: "bar",
|
|
69379
|
+
echartsType: "bar",
|
|
69380
|
+
chartDataSetId: "0",
|
|
69381
|
+
seriesLayoutBy: "column",
|
|
69382
|
+
enableChartDataSet: true,
|
|
69383
|
+
chartCoordinateSystemId: "0",
|
|
69384
|
+
appId: this.appBIReport.appId
|
|
69385
|
+
};
|
|
69386
|
+
}
|
|
69387
|
+
};
|
|
69388
|
+
|
|
69389
|
+
// src/controller/control/report-panel/generator/bi-converter/stack-bar-converter.ts
|
|
69390
|
+
var StackBarConverter = class extends BarConverterBase {
|
|
69391
|
+
constructor() {
|
|
69392
|
+
super(...arguments);
|
|
69393
|
+
/**
|
|
69394
|
+
* @description 仿真模型
|
|
69395
|
+
* @type {IModel}
|
|
69396
|
+
* @memberof StackBarConverter
|
|
69397
|
+
*/
|
|
69398
|
+
this.mockModel = {
|
|
69399
|
+
userParam: {},
|
|
69400
|
+
dechartLegend: {
|
|
69401
|
+
id: "legend",
|
|
69402
|
+
showLegend: false,
|
|
69403
|
+
appId: this.appBIReport.appId
|
|
69404
|
+
},
|
|
69405
|
+
dechartTitle: {
|
|
69406
|
+
id: "title",
|
|
69407
|
+
showTitle: false,
|
|
69408
|
+
appId: this.appBIReport.appId
|
|
69409
|
+
},
|
|
69410
|
+
chartXAxises: [
|
|
69411
|
+
{
|
|
69412
|
+
id: "0",
|
|
69413
|
+
type: "category",
|
|
69414
|
+
position: "bottom",
|
|
69415
|
+
echartsPos: "xAxis",
|
|
69416
|
+
name: "axis_xAxis_0",
|
|
69417
|
+
echartsType: "category",
|
|
69418
|
+
appId: this.appBIReport.appId
|
|
69419
|
+
}
|
|
69420
|
+
],
|
|
69421
|
+
chartYAxises: [
|
|
69422
|
+
{
|
|
69423
|
+
id: "0",
|
|
69424
|
+
type: "numeric",
|
|
69425
|
+
position: "left",
|
|
69426
|
+
echartsPos: "yAxis",
|
|
69427
|
+
echartsType: "value",
|
|
69428
|
+
name: "axis_yAxis_0",
|
|
69429
|
+
appId: this.appBIReport.appId
|
|
69430
|
+
}
|
|
69431
|
+
],
|
|
69432
|
+
readOnly: true,
|
|
69433
|
+
autoLoad: true,
|
|
69434
|
+
dechartSerieses: [],
|
|
69435
|
+
controlType: "CHART",
|
|
69436
|
+
showBusyIndicator: true,
|
|
69437
|
+
id: this.appBIReport.id,
|
|
69438
|
+
name: this.appBIReport.id,
|
|
69439
|
+
appId: this.appBIReport.appId,
|
|
69440
|
+
codeName: this.appBIReport.id,
|
|
69441
|
+
caption: this.appBIReport.name,
|
|
69442
|
+
logicName: this.appBIReport.name,
|
|
69443
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69444
|
+
};
|
|
69445
|
+
/**
|
|
69446
|
+
* @description 仿真序列模型
|
|
69447
|
+
* @type {IModel}
|
|
69448
|
+
* @memberof StackBarConverter
|
|
69449
|
+
*/
|
|
69450
|
+
this.mockSerieModel = {
|
|
69451
|
+
chartSeriesEncode: {
|
|
69452
|
+
id: "0",
|
|
69453
|
+
type: "XY",
|
|
69454
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69455
|
+
chartXAxisId: "0",
|
|
69456
|
+
chartYAxisId: "0",
|
|
69457
|
+
appId: this.appBIReport.appId
|
|
69458
|
+
},
|
|
69459
|
+
seriesType: "bar",
|
|
69460
|
+
echartsType: "bar",
|
|
69461
|
+
chartDataSetId: "0",
|
|
69462
|
+
seriesLayoutBy: "column",
|
|
69463
|
+
enableChartDataSet: true,
|
|
69464
|
+
chartCoordinateSystemId: "0",
|
|
69465
|
+
appId: this.appBIReport.appId
|
|
69466
|
+
};
|
|
69467
|
+
}
|
|
69468
|
+
/**
|
|
69469
|
+
* @description 转化数据到报表
|
|
69470
|
+
* @param {IData[]} items
|
|
69471
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69472
|
+
* @memberof StackBarConverter
|
|
69473
|
+
*/
|
|
69474
|
+
translateDataToReport(items) {
|
|
69475
|
+
var _a3;
|
|
69476
|
+
const report = super.translateDataToReport(items);
|
|
69477
|
+
if (report) {
|
|
69478
|
+
const { model } = report;
|
|
69479
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69480
|
+
Object.assign(series.userParam, {
|
|
69481
|
+
"EC.stack": "stackcol"
|
|
69482
|
+
});
|
|
69483
|
+
});
|
|
69484
|
+
}
|
|
69485
|
+
return report;
|
|
69486
|
+
}
|
|
69487
|
+
};
|
|
69488
|
+
|
|
69489
|
+
// src/controller/control/report-panel/generator/bi-converter/multi-series-line-converter.ts
|
|
69490
|
+
var MultiSeriesLineConverter = class extends MultiSeriesConverter {
|
|
69491
|
+
constructor() {
|
|
69492
|
+
super(...arguments);
|
|
69493
|
+
/**
|
|
69494
|
+
* @description 仿真模型
|
|
69495
|
+
* @type {IModel}
|
|
69496
|
+
* @memberof MultiSeriesLineConverter
|
|
69497
|
+
*/
|
|
69498
|
+
this.mockModel = {
|
|
69499
|
+
userParam: {},
|
|
69500
|
+
dechartLegend: {
|
|
69501
|
+
id: "legend",
|
|
69502
|
+
showLegend: false,
|
|
69503
|
+
appId: this.appBIReport.appId
|
|
69504
|
+
},
|
|
69505
|
+
dechartTitle: {
|
|
69506
|
+
id: "title",
|
|
69507
|
+
showTitle: false,
|
|
69508
|
+
appId: this.appBIReport.appId
|
|
69509
|
+
},
|
|
69510
|
+
chartXAxises: [
|
|
69511
|
+
{
|
|
69512
|
+
id: "0",
|
|
69513
|
+
type: "category",
|
|
69514
|
+
position: "bottom",
|
|
69515
|
+
echartsPos: "xAxis",
|
|
69516
|
+
name: "axis_xAxis_0",
|
|
69517
|
+
echartsType: "category",
|
|
69518
|
+
appId: this.appBIReport.appId
|
|
69519
|
+
}
|
|
69520
|
+
],
|
|
69521
|
+
chartYAxises: [
|
|
69522
|
+
{
|
|
69523
|
+
id: "0",
|
|
69524
|
+
type: "numeric",
|
|
69525
|
+
position: "left",
|
|
69526
|
+
echartsPos: "yAxis",
|
|
69527
|
+
echartsType: "value",
|
|
69528
|
+
name: "axis_yAxis_0",
|
|
69529
|
+
appId: this.appBIReport.appId
|
|
69530
|
+
}
|
|
69531
|
+
],
|
|
69532
|
+
readOnly: true,
|
|
69533
|
+
autoLoad: true,
|
|
69534
|
+
dechartSerieses: [],
|
|
69535
|
+
controlType: "CHART",
|
|
69536
|
+
showBusyIndicator: true,
|
|
69537
|
+
id: this.appBIReport.id,
|
|
69538
|
+
name: this.appBIReport.id,
|
|
69539
|
+
appId: this.appBIReport.appId,
|
|
69540
|
+
codeName: this.appBIReport.id,
|
|
69541
|
+
caption: this.appBIReport.name,
|
|
69542
|
+
logicName: this.appBIReport.name,
|
|
69543
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69544
|
+
};
|
|
69545
|
+
/**
|
|
69546
|
+
* @description 仿真序列模型
|
|
69547
|
+
* @type {IModel}
|
|
69548
|
+
* @memberof MultiSeriesLineConverter
|
|
69549
|
+
*/
|
|
69550
|
+
this.mockSerieModel = {
|
|
69551
|
+
chartSeriesEncode: {
|
|
69552
|
+
id: "0",
|
|
69553
|
+
type: "XY",
|
|
69554
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69555
|
+
chartXAxisId: "0",
|
|
69556
|
+
chartYAxisId: "0",
|
|
69557
|
+
appId: this.appBIReport.appId
|
|
69558
|
+
},
|
|
69559
|
+
seriesType: "line",
|
|
69560
|
+
echartsType: "line",
|
|
69561
|
+
chartDataSetId: "0",
|
|
69562
|
+
seriesLayoutBy: "column",
|
|
69563
|
+
enableChartDataSet: true,
|
|
69564
|
+
chartCoordinateSystemId: "0",
|
|
69565
|
+
appId: this.appBIReport.appId
|
|
69566
|
+
};
|
|
69567
|
+
}
|
|
69568
|
+
/**
|
|
69569
|
+
* @description 获取标签参数
|
|
69570
|
+
* @param {IModel} seriesModel
|
|
69571
|
+
* @param {IData[]} items
|
|
69572
|
+
* @returns {*} {IData}
|
|
69573
|
+
* @memberof MultiSeriesLineConverter
|
|
69574
|
+
*/
|
|
69575
|
+
getChartLabelParams(seriesModel, items) {
|
|
69576
|
+
const { series_label_position } = this.reportUIModel;
|
|
69577
|
+
const options = super.getChartLabelParams(seriesModel, items);
|
|
69578
|
+
const tempObj = JSON.parse(options["EC.label"]);
|
|
69579
|
+
tempObj.position = series_label_position === "bottom" ? series_label_position : "top";
|
|
69580
|
+
return { "EC.label": JSON.stringify(tempObj) };
|
|
69581
|
+
}
|
|
69582
|
+
};
|
|
69583
|
+
|
|
69584
|
+
// src/controller/control/report-panel/generator/bi-converter/zone-line-converter.ts
|
|
69585
|
+
var ZoneLineConverter = class extends ZoneConverterBase {
|
|
69586
|
+
constructor() {
|
|
69587
|
+
super(...arguments);
|
|
69588
|
+
/**
|
|
69589
|
+
* @description 仿真模型
|
|
69590
|
+
* @type {IModel}
|
|
69591
|
+
* @memberof ZoneLineConverter
|
|
69592
|
+
*/
|
|
69593
|
+
this.mockModel = {
|
|
69594
|
+
userParam: {},
|
|
69595
|
+
dechartLegend: {
|
|
69596
|
+
id: "legend",
|
|
69597
|
+
showLegend: false,
|
|
69598
|
+
appId: this.appBIReport.appId
|
|
69599
|
+
},
|
|
69600
|
+
dechartTitle: {
|
|
69601
|
+
id: "title",
|
|
69602
|
+
showTitle: false,
|
|
69603
|
+
appId: this.appBIReport.appId
|
|
69604
|
+
},
|
|
69605
|
+
chartXAxises: [
|
|
69606
|
+
{
|
|
69607
|
+
id: "0",
|
|
69608
|
+
type: "category",
|
|
69609
|
+
position: "bottom",
|
|
69610
|
+
echartsPos: "xAxis",
|
|
69611
|
+
name: "axis_xAxis_0",
|
|
69612
|
+
echartsType: "category",
|
|
69613
|
+
appId: this.appBIReport.appId
|
|
69614
|
+
}
|
|
69615
|
+
],
|
|
69616
|
+
chartYAxises: [
|
|
69617
|
+
{
|
|
69618
|
+
id: "0",
|
|
69619
|
+
type: "numeric",
|
|
69620
|
+
position: "left",
|
|
69621
|
+
echartsPos: "yAxis",
|
|
69622
|
+
echartsType: "value",
|
|
69623
|
+
name: "axis_yAxis_0",
|
|
69624
|
+
appId: this.appBIReport.appId
|
|
69625
|
+
}
|
|
69626
|
+
],
|
|
69627
|
+
readOnly: true,
|
|
69628
|
+
autoLoad: true,
|
|
69629
|
+
dechartSerieses: [],
|
|
69630
|
+
controlType: "CHART",
|
|
69631
|
+
id: this.appBIReport.id,
|
|
69632
|
+
showBusyIndicator: true,
|
|
69633
|
+
name: this.appBIReport.id,
|
|
69634
|
+
appId: this.appBIReport.appId,
|
|
69635
|
+
codeName: this.appBIReport.id,
|
|
69636
|
+
caption: this.appBIReport.name,
|
|
69637
|
+
logicName: this.appBIReport.name,
|
|
69638
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69639
|
+
};
|
|
69640
|
+
/**
|
|
69641
|
+
* @description 仿真序列模型
|
|
69642
|
+
* @type {IModel}
|
|
69643
|
+
* @memberof ZoneLineConverter
|
|
69644
|
+
*/
|
|
69645
|
+
this.mockSerieModel = {
|
|
69646
|
+
chartSeriesEncode: {
|
|
69647
|
+
id: "0",
|
|
69648
|
+
type: "XY",
|
|
69649
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69650
|
+
chartXAxisId: "0",
|
|
69651
|
+
chartYAxisId: "0",
|
|
69652
|
+
appId: this.appBIReport.appId
|
|
69653
|
+
},
|
|
69654
|
+
seriesType: "line",
|
|
69655
|
+
echartsType: "line",
|
|
69656
|
+
chartDataSetId: "0",
|
|
69657
|
+
seriesLayoutBy: "column",
|
|
69658
|
+
enableChartDataSet: true,
|
|
69659
|
+
chartCoordinateSystemId: "0",
|
|
69660
|
+
appId: this.appBIReport.appId
|
|
69661
|
+
};
|
|
69662
|
+
}
|
|
69663
|
+
};
|
|
69664
|
+
|
|
69665
|
+
// src/controller/control/report-panel/generator/bi-converter/area-converter.ts
|
|
69666
|
+
var AreaConverter = class extends MultiSeriesConverter {
|
|
69667
|
+
constructor() {
|
|
69668
|
+
super(...arguments);
|
|
69669
|
+
/**
|
|
69670
|
+
* @description 仿真模型
|
|
69671
|
+
* @type {IModel}
|
|
69672
|
+
* @memberof AreaConverter
|
|
69673
|
+
*/
|
|
69674
|
+
this.mockModel = {
|
|
69675
|
+
userParam: {},
|
|
69676
|
+
dechartLegend: {
|
|
69677
|
+
id: "legend",
|
|
69678
|
+
showLegend: false,
|
|
69679
|
+
appId: this.appBIReport.appId
|
|
69680
|
+
},
|
|
69681
|
+
dechartTitle: {
|
|
69682
|
+
id: "title",
|
|
69683
|
+
showTitle: false,
|
|
69684
|
+
appId: this.appBIReport.appId
|
|
69685
|
+
},
|
|
69686
|
+
chartXAxises: [
|
|
69687
|
+
{
|
|
69688
|
+
id: "0",
|
|
69689
|
+
type: "category",
|
|
69690
|
+
position: "bottom",
|
|
69691
|
+
echartsPos: "xAxis",
|
|
69692
|
+
name: "axis_xAxis_0",
|
|
69693
|
+
echartsType: "category",
|
|
69694
|
+
appId: this.appBIReport.appId
|
|
69695
|
+
}
|
|
69696
|
+
],
|
|
69697
|
+
chartYAxises: [
|
|
69698
|
+
{
|
|
69699
|
+
id: "0",
|
|
69700
|
+
type: "numeric",
|
|
69701
|
+
position: "left",
|
|
69702
|
+
echartsPos: "yAxis",
|
|
69703
|
+
echartsType: "value",
|
|
69704
|
+
name: "axis_yAxis_0",
|
|
69705
|
+
appId: this.appBIReport.appId
|
|
69706
|
+
}
|
|
69707
|
+
],
|
|
69708
|
+
readOnly: true,
|
|
69709
|
+
autoLoad: true,
|
|
69710
|
+
dechartSerieses: [],
|
|
69711
|
+
controlType: "CHART",
|
|
69712
|
+
showBusyIndicator: true,
|
|
69713
|
+
id: this.appBIReport.id,
|
|
69714
|
+
name: this.appBIReport.id,
|
|
69715
|
+
appId: this.appBIReport.appId,
|
|
69716
|
+
codeName: this.appBIReport.id,
|
|
69717
|
+
caption: this.appBIReport.name,
|
|
69718
|
+
logicName: this.appBIReport.name,
|
|
69719
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69720
|
+
};
|
|
69721
|
+
/**
|
|
69722
|
+
* @description 仿真序列模型
|
|
69723
|
+
* @type {IModel}
|
|
69724
|
+
* @memberof AreaConverter
|
|
69725
|
+
*/
|
|
69726
|
+
this.mockSerieModel = {
|
|
69727
|
+
chartSeriesEncode: {
|
|
69728
|
+
id: "0",
|
|
69729
|
+
type: "XY",
|
|
69730
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69731
|
+
chartXAxisId: "0",
|
|
69732
|
+
chartYAxisId: "0",
|
|
69733
|
+
appId: this.appBIReport.appId
|
|
69734
|
+
},
|
|
69735
|
+
seriesType: "line",
|
|
69736
|
+
echartsType: "line",
|
|
69737
|
+
chartDataSetId: "0",
|
|
69738
|
+
seriesLayoutBy: "column",
|
|
69739
|
+
enableChartDataSet: true,
|
|
69740
|
+
chartCoordinateSystemId: "0",
|
|
69741
|
+
appId: this.appBIReport.appId
|
|
69742
|
+
};
|
|
69743
|
+
}
|
|
69744
|
+
/**
|
|
69745
|
+
* @description 转化数据到报表
|
|
69746
|
+
* @param {IData[]} items
|
|
69747
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69748
|
+
* @memberof AreaConverter
|
|
69749
|
+
*/
|
|
69750
|
+
translateDataToReport(items) {
|
|
69751
|
+
var _a3;
|
|
69752
|
+
const report = super.translateDataToReport(items);
|
|
69753
|
+
if (report) {
|
|
69754
|
+
const { model } = report;
|
|
69755
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69756
|
+
Object.assign(series.userParam, {
|
|
69757
|
+
"EC.areaStyle": JSON.stringify({})
|
|
69758
|
+
});
|
|
69759
|
+
});
|
|
69760
|
+
}
|
|
69761
|
+
return report;
|
|
69762
|
+
}
|
|
69763
|
+
};
|
|
69764
|
+
|
|
69765
|
+
// src/controller/control/report-panel/generator/bi-converter/pie-converter.ts
|
|
69766
|
+
var PieConverter = class extends MultiSeriesConverter {
|
|
69767
|
+
constructor() {
|
|
69768
|
+
super(...arguments);
|
|
69769
|
+
/**
|
|
69770
|
+
* @description 仿真模型
|
|
69771
|
+
* @type {IModel}
|
|
69772
|
+
* @memberof PieConverter
|
|
69773
|
+
*/
|
|
69774
|
+
this.mockModel = {
|
|
69775
|
+
userParam: {},
|
|
69776
|
+
dechartLegend: {
|
|
69777
|
+
id: "legend",
|
|
69778
|
+
showLegend: false,
|
|
69779
|
+
appId: this.appBIReport.appId
|
|
69780
|
+
},
|
|
69781
|
+
dechartTitle: {
|
|
69782
|
+
id: "title",
|
|
69783
|
+
showTitle: false,
|
|
69784
|
+
appId: this.appBIReport.appId
|
|
69785
|
+
},
|
|
69786
|
+
readOnly: true,
|
|
69787
|
+
autoLoad: true,
|
|
69788
|
+
dechartSerieses: [],
|
|
69789
|
+
controlType: "CHART",
|
|
69790
|
+
id: this.appBIReport.id,
|
|
69791
|
+
showBusyIndicator: true,
|
|
69792
|
+
name: this.appBIReport.id,
|
|
69793
|
+
appId: this.appBIReport.appId,
|
|
69794
|
+
codeName: this.appBIReport.id,
|
|
69795
|
+
caption: this.appBIReport.name,
|
|
69796
|
+
logicName: this.appBIReport.name,
|
|
69797
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69798
|
+
};
|
|
69799
|
+
/**
|
|
69800
|
+
* @description 仿真序列模型
|
|
69801
|
+
* @type {IModel}
|
|
69802
|
+
* @memberof PieConverter
|
|
69803
|
+
*/
|
|
69804
|
+
this.mockSerieModel = {
|
|
69805
|
+
seriesType: "pie",
|
|
69806
|
+
echartsType: "pie",
|
|
69807
|
+
chartCoordinateSystemId: "0",
|
|
69808
|
+
chartDataSetId: "0",
|
|
69809
|
+
seriesLayoutBy: "column",
|
|
69810
|
+
enableChartDataSet: true,
|
|
69811
|
+
appId: this.appBIReport.appId
|
|
69812
|
+
};
|
|
69813
|
+
}
|
|
69814
|
+
/**
|
|
69815
|
+
* @description 转化数据到报表
|
|
69816
|
+
* @param {IData[]} items
|
|
69817
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69818
|
+
* @memberof PieConverter
|
|
69819
|
+
*/
|
|
69820
|
+
translateDataToReport(items) {
|
|
69821
|
+
var _a3;
|
|
69822
|
+
const report = super.translateDataToReport(items);
|
|
69823
|
+
if (!report)
|
|
69824
|
+
return;
|
|
69825
|
+
const { model } = report;
|
|
69826
|
+
const legendParams = this.getChartLegendParams();
|
|
69827
|
+
Object.assign(model.userParam, legendParams);
|
|
69828
|
+
const chartColorParams = this.getChartColorParams();
|
|
69829
|
+
Object.assign(model.userParam, chartColorParams);
|
|
69830
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69831
|
+
Object.assign(series, {
|
|
69832
|
+
userParam: {
|
|
69833
|
+
...this.getChartLabelParams(series, items)
|
|
69834
|
+
}
|
|
69835
|
+
});
|
|
69836
|
+
});
|
|
69837
|
+
return report;
|
|
69838
|
+
}
|
|
69839
|
+
/**
|
|
69840
|
+
* @description 获取标签参数
|
|
69841
|
+
* @param {IModel} seriesModel
|
|
69842
|
+
* @param {IData[]} items
|
|
69843
|
+
* @returns {*} {IData}
|
|
69844
|
+
* @memberof PieConverter
|
|
69845
|
+
*/
|
|
69846
|
+
getChartLabelParams(seriesModel, items) {
|
|
69847
|
+
const { series_label_data_range, series_label_percentage } = this.reportUIModel;
|
|
69848
|
+
const tempOption = super.getChartLabelParams(seriesModel, items);
|
|
69849
|
+
const options = JSON.parse(tempOption["EC.label"]);
|
|
69850
|
+
const labelLayoutOption = {};
|
|
69851
|
+
delete options.position;
|
|
69852
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
69853
|
+
const labelLayout = function(_params) {
|
|
69854
|
+
if (_params.text == "") {
|
|
69855
|
+
return {
|
|
69856
|
+
height: 0,
|
|
69857
|
+
labelLinePoints: [0, 0]
|
|
69858
|
+
};
|
|
69859
|
+
}
|
|
69860
|
+
};
|
|
69861
|
+
Object.assign(labelLayoutOption, { "EC.labelLayout": labelLayout });
|
|
69862
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
69863
|
+
options.formatter = "function(param) {\n let tempName = param.name;\n const { data } = param;\n if(param.value[0] === ".concat(max2, " || param.value[0] === ").concat(min, "){\n if(").concat(series_label_percentage, " == '1'){\n return tempName + '\uFF1A\uFF08' + param.percent + '%' + '\uFF09';\n }\n return tempName + '\uFF1A' + param.value[0];\n }\n return '';\n }");
|
|
69864
|
+
}
|
|
69865
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
69866
|
+
options.formatter = "function(param) {\n let tempName = param.name;\n const { data } = param; \n if(".concat(series_label_percentage, " == '1'){\n return tempName + '\uFF1A\uFF08' + param.percent + '%' + '\uFF09';\n }\n return tempName + '\uFF1A' + param.value[0];\n }");
|
|
69867
|
+
}
|
|
69868
|
+
return {
|
|
69869
|
+
"EC.label": JSON.stringify(options),
|
|
69870
|
+
...labelLayoutOption
|
|
69871
|
+
};
|
|
69872
|
+
}
|
|
69873
|
+
};
|
|
69874
|
+
|
|
69875
|
+
// src/controller/control/report-panel/generator/bi-converter/radar-converter.ts
|
|
69876
|
+
var RadarConverter = class extends MultiSeriesConverter {
|
|
69877
|
+
constructor() {
|
|
69878
|
+
super(...arguments);
|
|
69879
|
+
/**
|
|
69880
|
+
* @description 仿真模型
|
|
69881
|
+
* @type {IModel}
|
|
69882
|
+
* @memberof RadarConverter
|
|
69883
|
+
*/
|
|
69884
|
+
this.mockModel = {
|
|
69885
|
+
userParam: {},
|
|
69886
|
+
dechartLegend: {
|
|
69887
|
+
id: "legend",
|
|
69888
|
+
showLegend: false,
|
|
69889
|
+
appId: this.appBIReport.appId
|
|
69890
|
+
},
|
|
69891
|
+
dechartTitle: {
|
|
69892
|
+
id: "title",
|
|
69893
|
+
showTitle: false,
|
|
69894
|
+
appId: this.appBIReport.appId
|
|
69895
|
+
},
|
|
69896
|
+
readOnly: true,
|
|
69897
|
+
autoLoad: true,
|
|
69898
|
+
dechartSerieses: [],
|
|
69899
|
+
controlType: "CHART",
|
|
69900
|
+
showBusyIndicator: true,
|
|
69901
|
+
id: this.appBIReport.id,
|
|
69902
|
+
name: this.appBIReport.id,
|
|
69903
|
+
appId: this.appBIReport.appId,
|
|
69904
|
+
codeName: this.appBIReport.id,
|
|
69905
|
+
caption: this.appBIReport.name,
|
|
69906
|
+
logicName: this.appBIReport.name,
|
|
69907
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69908
|
+
};
|
|
69909
|
+
/**
|
|
69910
|
+
* @description 仿真序列模型
|
|
69911
|
+
* @type {IModel}
|
|
69912
|
+
* @memberof RadarConverter
|
|
69913
|
+
*/
|
|
69914
|
+
this.mockSerieModel = {
|
|
69915
|
+
echartsType: "radar",
|
|
69916
|
+
seriesType: "radar",
|
|
69917
|
+
chartDataSetId: "0",
|
|
69918
|
+
seriesLayoutBy: "column",
|
|
69919
|
+
enableChartDataSet: true,
|
|
69920
|
+
chartCoordinateSystemId: "0",
|
|
69921
|
+
appId: this.appBIReport.appId
|
|
69922
|
+
};
|
|
69923
|
+
}
|
|
69924
|
+
/**
|
|
69925
|
+
* @description 获取标签参数
|
|
69926
|
+
* @param {IModel} seriesModel
|
|
69927
|
+
* @param {IData[]} items
|
|
69928
|
+
* @returns {*} {IData}
|
|
69929
|
+
* @memberof RadarConverter
|
|
69930
|
+
*/
|
|
69931
|
+
getChartLabelParams(seriesModel, items) {
|
|
69932
|
+
const {
|
|
69933
|
+
series_label_show,
|
|
69934
|
+
series_label_fontstyle,
|
|
69935
|
+
series_label_fontsize,
|
|
69936
|
+
series_label_fontcolor,
|
|
69937
|
+
series_label_position,
|
|
69938
|
+
series_label_data_range
|
|
69939
|
+
} = this.reportUIModel;
|
|
69940
|
+
const options = {
|
|
69941
|
+
show: series_label_show == "1",
|
|
69942
|
+
position: series_label_position
|
|
69943
|
+
};
|
|
69944
|
+
if (series_label_fontstyle) {
|
|
69945
|
+
series_label_fontstyle === "bold" ? options.fontWeight = series_label_fontstyle : options.fontStyle = series_label_fontstyle;
|
|
69946
|
+
}
|
|
69947
|
+
if (series_label_fontsize) {
|
|
69948
|
+
options.fontSize = Number(series_label_fontsize);
|
|
69949
|
+
}
|
|
69950
|
+
if (series_label_fontcolor) {
|
|
69951
|
+
options.color = series_label_fontcolor;
|
|
69952
|
+
}
|
|
69953
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
69954
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
69955
|
+
options.formatter = "function(param) { \n if(param.value === ".concat(max2, " || param.value === ").concat(min, "){\n return param.value;\n }\n return '';\n }");
|
|
69956
|
+
}
|
|
69957
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
69958
|
+
options.formatter = "function(param) {\n return param.value;\n }";
|
|
69959
|
+
}
|
|
69960
|
+
return { "EC.label": JSON.stringify(options) };
|
|
69961
|
+
}
|
|
69962
|
+
/**
|
|
69963
|
+
* @description 转化数据到报表
|
|
69964
|
+
* @param {IData[]} items
|
|
69965
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69966
|
+
* @memberof RadarConverter
|
|
69967
|
+
*/
|
|
69968
|
+
translateDataToReport(items) {
|
|
69969
|
+
var _a3;
|
|
69970
|
+
const report = super.translateDataToReport(items);
|
|
69971
|
+
if (!report)
|
|
69972
|
+
return;
|
|
69973
|
+
const { model } = report;
|
|
69974
|
+
const chartColorParams = this.getChartColorParams();
|
|
69975
|
+
Object.assign(model.userParam, chartColorParams);
|
|
69976
|
+
const legendParams = this.getChartLegendParams();
|
|
69977
|
+
Object.assign(model.userParam, legendParams);
|
|
69978
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69979
|
+
Object.assign(series, {
|
|
69980
|
+
userParam: {
|
|
69981
|
+
...this.getChartLabelParams(series, items),
|
|
69982
|
+
"EC.name": series.serieText
|
|
69983
|
+
}
|
|
69984
|
+
});
|
|
69985
|
+
});
|
|
69986
|
+
return report;
|
|
69987
|
+
}
|
|
69988
|
+
};
|
|
69989
|
+
|
|
69990
|
+
// src/controller/control/report-panel/generator/bi-converter/scatter-converter.ts
|
|
69991
|
+
var ScatterConverter = class extends MultiSeriesConverter {
|
|
69992
|
+
constructor() {
|
|
69993
|
+
super(...arguments);
|
|
69994
|
+
/**
|
|
69995
|
+
* @description 仿真模型
|
|
69996
|
+
* @type {IModel}
|
|
69997
|
+
* @memberof ScatterConverter
|
|
69998
|
+
*/
|
|
69999
|
+
this.mockModel = {
|
|
70000
|
+
userParam: {},
|
|
70001
|
+
dechartLegend: {
|
|
70002
|
+
id: "legend",
|
|
70003
|
+
showLegend: false,
|
|
70004
|
+
appId: this.appBIReport.appId
|
|
70005
|
+
},
|
|
70006
|
+
dechartTitle: {
|
|
70007
|
+
id: "title",
|
|
70008
|
+
showTitle: false,
|
|
70009
|
+
appId: this.appBIReport.appId
|
|
70010
|
+
},
|
|
70011
|
+
chartXAxises: [
|
|
70012
|
+
{
|
|
70013
|
+
id: "0",
|
|
70014
|
+
type: "category",
|
|
70015
|
+
position: "bottom",
|
|
70016
|
+
echartsPos: "xAxis",
|
|
70017
|
+
name: "axis_xAxis_0",
|
|
70018
|
+
echartsType: "category",
|
|
70019
|
+
appId: this.appBIReport.appId
|
|
70020
|
+
}
|
|
70021
|
+
],
|
|
70022
|
+
chartYAxises: [
|
|
70023
|
+
{
|
|
70024
|
+
id: "0",
|
|
70025
|
+
type: "numeric",
|
|
70026
|
+
position: "left",
|
|
70027
|
+
echartsPos: "yAxis",
|
|
70028
|
+
echartsType: "value",
|
|
70029
|
+
name: "axis_yAxis_0",
|
|
70030
|
+
appId: this.appBIReport.appId
|
|
70031
|
+
}
|
|
70032
|
+
],
|
|
70033
|
+
readOnly: true,
|
|
70034
|
+
autoLoad: true,
|
|
70035
|
+
dechartSerieses: [],
|
|
70036
|
+
controlType: "CHART",
|
|
70037
|
+
id: this.appBIReport.id,
|
|
70038
|
+
showBusyIndicator: true,
|
|
70039
|
+
name: this.appBIReport.id,
|
|
70040
|
+
appId: this.appBIReport.appId,
|
|
70041
|
+
codeName: this.appBIReport.id,
|
|
70042
|
+
caption: this.appBIReport.name,
|
|
70043
|
+
logicName: this.appBIReport.name,
|
|
70044
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70045
|
+
};
|
|
70046
|
+
/**
|
|
70047
|
+
* @description 仿真序列模型
|
|
70048
|
+
* @type {IModel}
|
|
70049
|
+
* @memberof ScatterConverter
|
|
70050
|
+
*/
|
|
70051
|
+
this.mockSerieModel = {
|
|
70052
|
+
chartSeriesEncode: {
|
|
70053
|
+
id: "0",
|
|
70054
|
+
type: "XY",
|
|
70055
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
70056
|
+
chartXAxisId: "0",
|
|
70057
|
+
chartYAxisId: "0",
|
|
70058
|
+
appId: this.appBIReport.appId
|
|
70059
|
+
},
|
|
70060
|
+
chartDataSetId: "0",
|
|
70061
|
+
seriesType: "scatter",
|
|
70062
|
+
echartsType: "scatter",
|
|
70063
|
+
seriesLayoutBy: "column",
|
|
70064
|
+
enableChartDataSet: true,
|
|
70065
|
+
chartCoordinateSystemId: "0",
|
|
70066
|
+
appId: this.appBIReport.appId
|
|
70067
|
+
};
|
|
70068
|
+
}
|
|
70069
|
+
/**
|
|
70070
|
+
* @description 获取标签参数
|
|
70071
|
+
* @param {IModel} seriesModel
|
|
70072
|
+
* @param {IData[]} items
|
|
70073
|
+
* @returns {*} {IData}
|
|
70074
|
+
* @memberof ScatterConverter
|
|
70075
|
+
*/
|
|
70076
|
+
getChartLabelParams(seriesModel, items) {
|
|
70077
|
+
const options = super.getChartLabelParams(seriesModel, items);
|
|
70078
|
+
const tempObj = JSON.parse(options["EC.label"]);
|
|
70079
|
+
tempObj.position = "top";
|
|
70080
|
+
return { "EC.label": JSON.stringify(tempObj) };
|
|
70081
|
+
}
|
|
70082
|
+
};
|
|
70083
|
+
|
|
70084
|
+
// src/controller/control/report-panel/generator/bi-converter/grid-converter.ts
|
|
70085
|
+
import { clone as clone53 } from "ramda";
|
|
70086
|
+
var GridConverter = class extends GridConverterBase {
|
|
70087
|
+
constructor() {
|
|
70088
|
+
super(...arguments);
|
|
70089
|
+
/**
|
|
70090
|
+
* @description 仿真模型
|
|
70091
|
+
* @type {IModel}
|
|
70092
|
+
* @memberof GridConverter
|
|
70093
|
+
*/
|
|
70094
|
+
this.mockModel = {
|
|
70095
|
+
controlParam: { id: this.appBIReport.id, appId: this.appBIReport.appId },
|
|
70096
|
+
fetchControlAction: {
|
|
70097
|
+
id: "fetch",
|
|
70098
|
+
appDEMethodId: "fetchdefault",
|
|
70099
|
+
appId: this.appBIReport.appId,
|
|
70100
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70101
|
+
},
|
|
70102
|
+
pagingMode: 1,
|
|
70103
|
+
autoLoad: true,
|
|
70104
|
+
pagingSize: 20,
|
|
70105
|
+
aggMode: "NONE",
|
|
70106
|
+
groupMode: "NONE",
|
|
70107
|
+
sortMode: "REMOTE",
|
|
70108
|
+
singleSelect: true,
|
|
70109
|
+
columnEnableLink: 2,
|
|
70110
|
+
controlType: "GRID",
|
|
70111
|
+
columnEnableFilter: 2,
|
|
70112
|
+
modelType: "PSDEGRID",
|
|
70113
|
+
enablePagingBar: false,
|
|
70114
|
+
enableCustomized: false,
|
|
70115
|
+
showBusyIndicator: true,
|
|
70116
|
+
id: this.appBIReport.id,
|
|
70117
|
+
name: this.appBIReport.id,
|
|
70118
|
+
modelId: this.appBIReport.id,
|
|
70119
|
+
codeName: this.appBIReport.id,
|
|
70120
|
+
appId: this.appBIReport.appId,
|
|
70121
|
+
logicName: this.appBIReport.name,
|
|
70122
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70123
|
+
};
|
|
70124
|
+
}
|
|
70125
|
+
/**
|
|
70126
|
+
* @description 计算表格列模型
|
|
70127
|
+
* @returns {*} {IModel[]}
|
|
70128
|
+
* @memberof GridConverter
|
|
70129
|
+
*/
|
|
70130
|
+
calcGridColumns() {
|
|
70131
|
+
const deGridColumns = [];
|
|
70132
|
+
if (this.dimensions.length > 0) {
|
|
70133
|
+
deGridColumns.push(
|
|
70134
|
+
...this.dimensions.map((item) => {
|
|
70135
|
+
const codeName = item.dimensionTag.toLowerCase();
|
|
70136
|
+
return {
|
|
70137
|
+
width: 150,
|
|
70138
|
+
id: codeName,
|
|
70139
|
+
widthUnit: "STAR",
|
|
70140
|
+
enableSort: false,
|
|
70141
|
+
codeName,
|
|
70142
|
+
measureTag: codeName,
|
|
70143
|
+
dataItemName: codeName,
|
|
70144
|
+
appDEFieldId: codeName,
|
|
70145
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70146
|
+
caption: item.dimensionName,
|
|
70147
|
+
appId: this.appBIReport.appId,
|
|
70148
|
+
appCodeListId: item.appCodeListId,
|
|
70149
|
+
...this.calcGridColumnStyle(false)
|
|
70150
|
+
};
|
|
70151
|
+
})
|
|
70152
|
+
);
|
|
70153
|
+
}
|
|
70154
|
+
if (this.measures.length > 0) {
|
|
70155
|
+
deGridColumns.push(
|
|
70156
|
+
...this.measures.map((item) => {
|
|
70157
|
+
const codeName = item.measureTag.toLowerCase();
|
|
70158
|
+
return {
|
|
70159
|
+
width: 150,
|
|
70160
|
+
id: codeName,
|
|
70161
|
+
widthUnit: "STAR",
|
|
70162
|
+
enableSort: false,
|
|
70163
|
+
codeName,
|
|
70164
|
+
valueType: "SIMPLE",
|
|
70165
|
+
measureTag: codeName,
|
|
70166
|
+
dataItemName: codeName,
|
|
70167
|
+
appDEFieldId: codeName,
|
|
70168
|
+
format: item.jsonFormat,
|
|
70169
|
+
caption: item.measureName,
|
|
70170
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70171
|
+
appId: this.appBIReport.appId,
|
|
70172
|
+
appCodeListId: item.appCodeListId,
|
|
70173
|
+
...this.calcGridColumnStyle()
|
|
70174
|
+
};
|
|
70175
|
+
})
|
|
70176
|
+
);
|
|
70177
|
+
}
|
|
70178
|
+
return deGridColumns;
|
|
70179
|
+
}
|
|
70180
|
+
/**
|
|
70181
|
+
* @description 计算表格数据项
|
|
70182
|
+
* @param {IModel[]} gridColumns
|
|
70183
|
+
* @returns {*} {IModel[]}
|
|
70184
|
+
* @memberof GridConverter
|
|
70185
|
+
*/
|
|
70186
|
+
calcGridDataItems(gridColumns) {
|
|
70187
|
+
const deGridDataItems = [];
|
|
70188
|
+
gridColumns.forEach((column) => {
|
|
70189
|
+
deGridDataItems.push({
|
|
70190
|
+
dataType: 25,
|
|
70191
|
+
id: column.id,
|
|
70192
|
+
valueType: "SIMPLE",
|
|
70193
|
+
format: column.format,
|
|
70194
|
+
appId: this.appBIReport.appId,
|
|
70195
|
+
measureTag: column.measureTag
|
|
70196
|
+
});
|
|
70197
|
+
if (column.columnType === "GROUPGRIDCOLUMN")
|
|
70198
|
+
deGridDataItems.push(...this.calcGridDataItems(column.degridColumns));
|
|
70199
|
+
});
|
|
70200
|
+
return deGridDataItems;
|
|
70201
|
+
}
|
|
70202
|
+
/**
|
|
70203
|
+
* @description 转化数据到报表
|
|
70204
|
+
* @param {IData[]} items
|
|
70205
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
70206
|
+
* @memberof GridConverter
|
|
70207
|
+
*/
|
|
70208
|
+
translateDataToReport(items) {
|
|
70209
|
+
if (!this.measures)
|
|
70210
|
+
return;
|
|
70211
|
+
const tempModel = clone53(this.mockModel);
|
|
70212
|
+
const degridColumns = this.calcGridColumns();
|
|
70213
|
+
const degridDataItems = this.calcGridDataItems(degridColumns);
|
|
70214
|
+
Object.assign(tempModel, { degridColumns, degridDataItems });
|
|
70215
|
+
const { vars, classList, model } = this.getGridStyle();
|
|
70216
|
+
Object.assign(tempModel, model);
|
|
70217
|
+
const spanMethod = this.calcGridColumnMerge(items);
|
|
70218
|
+
Object.assign(tempModel, spanMethod);
|
|
70219
|
+
return {
|
|
70220
|
+
data: items,
|
|
70221
|
+
model: tempModel,
|
|
70222
|
+
options: { vars, classList }
|
|
70223
|
+
};
|
|
70224
|
+
}
|
|
70225
|
+
};
|
|
70226
|
+
|
|
70227
|
+
// src/controller/control/report-panel/generator/bi-converter/cross-table-converter.ts
|
|
70228
|
+
import { clone as clone54, plus as plus5 } from "@ibiz-template/core";
|
|
70229
|
+
var CrossTableConverter = class extends GridConverterBase {
|
|
70230
|
+
constructor() {
|
|
70231
|
+
super(...arguments);
|
|
70232
|
+
/**
|
|
70233
|
+
* @description 仿真模型
|
|
70234
|
+
* @type {IModel}
|
|
70235
|
+
* @memberof CrossTableConverter
|
|
70236
|
+
*/
|
|
70237
|
+
this.mockModel = {
|
|
70238
|
+
fetchControlAction: {
|
|
70239
|
+
id: "fetch",
|
|
70240
|
+
appDEMethodId: "fetchdefault",
|
|
70241
|
+
appId: this.appBIReport.appId,
|
|
70242
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70243
|
+
},
|
|
70244
|
+
controlParam: { id: this.appBIReport.id, appId: this.appBIReport.appId },
|
|
70245
|
+
pagingMode: 1,
|
|
70246
|
+
pagingSize: 20,
|
|
70247
|
+
autoLoad: true,
|
|
70248
|
+
aggMode: "NONE",
|
|
70249
|
+
gridStyle: "USER",
|
|
70250
|
+
groupMode: "NONE",
|
|
70251
|
+
sortMode: "REMOTE",
|
|
70252
|
+
singleSelect: true,
|
|
70253
|
+
controlType: "GRID",
|
|
70254
|
+
columnEnableLink: 2,
|
|
70255
|
+
modelType: "PSDEGRID",
|
|
70256
|
+
columnEnableFilter: 2,
|
|
70257
|
+
enablePagingBar: false,
|
|
70258
|
+
id: this.appBIReport.id,
|
|
70259
|
+
showBusyIndicator: true,
|
|
70260
|
+
enableCustomized: false,
|
|
70261
|
+
name: this.appBIReport.id,
|
|
70262
|
+
modelId: this.appBIReport.id,
|
|
70263
|
+
appId: this.appBIReport.appId,
|
|
70264
|
+
codeName: this.appBIReport.id,
|
|
70265
|
+
logicName: this.appBIReport.name,
|
|
70266
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70267
|
+
};
|
|
70268
|
+
/**
|
|
70269
|
+
* @description 百分比数据
|
|
70270
|
+
* @type {string[]}
|
|
70271
|
+
* @memberof CrossTableConverter
|
|
70272
|
+
*/
|
|
70273
|
+
this.percentKeys = [];
|
|
70274
|
+
/**
|
|
70275
|
+
* @description 合计列标识
|
|
70276
|
+
* @type {string}
|
|
70277
|
+
* @memberof CrossTableConverter
|
|
70278
|
+
*/
|
|
70279
|
+
this.totalColTag = "col_sum";
|
|
70280
|
+
/**
|
|
70281
|
+
* @description 指标总数
|
|
70282
|
+
* @type {IData}
|
|
70283
|
+
* @memberof CrossTableConverter
|
|
70284
|
+
*/
|
|
70285
|
+
this.measuresTotalResult = {};
|
|
70286
|
+
}
|
|
70287
|
+
/**
|
|
70288
|
+
* @description 初始化
|
|
70289
|
+
* - 处理列顺序
|
|
70290
|
+
* @protected
|
|
70291
|
+
* @returns {*} {Promise<void>}
|
|
70292
|
+
* @memberof CrossTableConverter
|
|
70293
|
+
*/
|
|
70294
|
+
async onInit() {
|
|
70295
|
+
var _a3;
|
|
70296
|
+
const { appBIReportDimensions } = this.appBIReport;
|
|
70297
|
+
const { grid_col_sort } = this.reportUIModel;
|
|
70298
|
+
this.dimensions = [];
|
|
70299
|
+
grid_col_sort.forEach((col) => {
|
|
70300
|
+
const dimension = appBIReportDimensions == null ? void 0 : appBIReportDimensions.find(
|
|
70301
|
+
(d) => {
|
|
70302
|
+
var _a4;
|
|
70303
|
+
return ((_a4 = d.dimensionTag) == null ? void 0 : _a4.toLowerCase()) === col.codename.toLowerCase();
|
|
70304
|
+
}
|
|
70305
|
+
);
|
|
70306
|
+
if (dimension)
|
|
70307
|
+
this.dimensions.push(dimension);
|
|
70308
|
+
});
|
|
70309
|
+
this.dimensionCol = appBIReportDimensions == null ? void 0 : appBIReportDimensions.find(
|
|
70310
|
+
(d) => d.placement === "COLHEADER"
|
|
70311
|
+
);
|
|
70312
|
+
if ((_a3 = this.dimensionCol) == null ? void 0 : _a3.appCodeListId) {
|
|
70313
|
+
const app = ibiz.hub.getApp(this.appBIReport.appId);
|
|
70314
|
+
this.codelistItems = await app.codeList.get(
|
|
70315
|
+
this.dimensionCol.appCodeListId,
|
|
70316
|
+
this.context,
|
|
70317
|
+
this.params
|
|
70318
|
+
);
|
|
70319
|
+
}
|
|
70320
|
+
}
|
|
70321
|
+
/**
|
|
70322
|
+
* @description 计算维度(列)
|
|
70323
|
+
* @param {IData[]} items
|
|
70324
|
+
* @returns {*} {string[]}
|
|
70325
|
+
* @memberof CrossTableConverter
|
|
70326
|
+
*/
|
|
70327
|
+
calcDimensionCols(items) {
|
|
70328
|
+
if (!this.dimensionCol)
|
|
70329
|
+
return [];
|
|
70330
|
+
if (this.codelistItems)
|
|
70331
|
+
return this.codelistItems.map((item) => item.value);
|
|
70332
|
+
const result = /* @__PURE__ */ new Set();
|
|
70333
|
+
const dimensionTag = this.dimensionCol.dimensionTag.toLowerCase();
|
|
70334
|
+
let hasBlank = false;
|
|
70335
|
+
for (const item of items) {
|
|
70336
|
+
const value = item[dimensionTag];
|
|
70337
|
+
if (!value) {
|
|
70338
|
+
hasBlank = true;
|
|
70339
|
+
} else {
|
|
70340
|
+
result.add(value);
|
|
70341
|
+
}
|
|
70342
|
+
}
|
|
70343
|
+
const resultArray = Array.from(result);
|
|
70344
|
+
if (hasBlank)
|
|
70345
|
+
resultArray.push("");
|
|
70346
|
+
return resultArray;
|
|
70347
|
+
}
|
|
70348
|
+
/**
|
|
70349
|
+
* 通过指标计算表格列
|
|
70350
|
+
*
|
|
70351
|
+
* @author tony001
|
|
70352
|
+
* @date 2024-12-19 17:12:52
|
|
70353
|
+
* @param {IData} data
|
|
70354
|
+
* @param {string} [type]
|
|
70355
|
+
* @return {*} {IModel[]}
|
|
70356
|
+
*/
|
|
70357
|
+
clacMeasureColumns(parentName) {
|
|
70358
|
+
return this.measures.map((item) => {
|
|
70359
|
+
let codeName = item.measureTag.toLowerCase();
|
|
70360
|
+
if (parentName)
|
|
70361
|
+
codeName = "".concat(parentName, "@").concat(codeName);
|
|
70362
|
+
const totalCodename = "".concat(this.totalColTag, "@").concat(codeName);
|
|
70363
|
+
this.percentKeys.push(codeName);
|
|
70364
|
+
return {
|
|
70365
|
+
codeName,
|
|
70366
|
+
width: 150,
|
|
70367
|
+
id: codeName,
|
|
70368
|
+
totalCodename,
|
|
70369
|
+
widthUnit: "STAR",
|
|
70370
|
+
valueType: "SIMPLE",
|
|
70371
|
+
measureTag: codeName,
|
|
70372
|
+
dataItemName: codeName,
|
|
70373
|
+
appDEFieldId: codeName,
|
|
70374
|
+
format: item.jsonFormat,
|
|
70375
|
+
caption: item.measureName,
|
|
70376
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70377
|
+
appId: this.appBIReport.appId,
|
|
70378
|
+
appCodeListId: item.appCodeListId,
|
|
70379
|
+
...this.calcGridColumnStyle()
|
|
70380
|
+
};
|
|
70381
|
+
});
|
|
70382
|
+
}
|
|
70383
|
+
/**
|
|
70384
|
+
* @description 计算合计表格列
|
|
70385
|
+
* @param {string} position
|
|
70386
|
+
* @param {IModel[]} degridColumns
|
|
70387
|
+
* @memberof CrossTableConverter
|
|
70388
|
+
*/
|
|
70389
|
+
calcAggGridCol(position, degridColumns) {
|
|
70390
|
+
const { grid_show_agg, grid_agg_col_position } = this.reportUIModel;
|
|
70391
|
+
if (this.dimensionCol && grid_show_agg == "1" && grid_agg_col_position === position) {
|
|
70392
|
+
const children = this.clacMeasureColumns(this.totalColTag);
|
|
70393
|
+
const column = {
|
|
70394
|
+
caption: "\u5408\u8BA1",
|
|
70395
|
+
id: this.totalColTag,
|
|
70396
|
+
degridColumns: children,
|
|
70397
|
+
codeName: this.totalColTag,
|
|
70398
|
+
measureTag: this.totalColTag,
|
|
70399
|
+
appId: this.appBIReport.appId,
|
|
70400
|
+
columnType: "GROUPGRIDCOLUMN",
|
|
70401
|
+
dataItemName: this.totalColTag
|
|
70402
|
+
};
|
|
70403
|
+
degridColumns.push(column);
|
|
70404
|
+
}
|
|
70405
|
+
}
|
|
70406
|
+
/**
|
|
70407
|
+
* @description 计算合计列数据
|
|
70408
|
+
* @param {IData[]} items
|
|
70409
|
+
* @memberof CrossTableConverter
|
|
70410
|
+
*/
|
|
70411
|
+
calcAggTotalData(items) {
|
|
70412
|
+
this.measures.forEach((measure) => {
|
|
70413
|
+
const codeName = "".concat(this.totalColTag, "@").concat(measure.measureTag.toLowerCase());
|
|
70414
|
+
this.measuresTotalResult[codeName] = 0;
|
|
70415
|
+
});
|
|
70416
|
+
items.forEach((item) => {
|
|
70417
|
+
this.measures.forEach((measure) => {
|
|
70418
|
+
const codeName = "".concat(this.totalColTag, "@").concat(measure.measureTag.toLowerCase());
|
|
70419
|
+
const total = this.percentKeys.reduce((a, b) => {
|
|
70420
|
+
const bvalue = Number(item[b]) || 0;
|
|
70421
|
+
return plus5(a, bvalue);
|
|
70422
|
+
}, 0);
|
|
70423
|
+
this.measuresTotalResult[codeName] += total;
|
|
70424
|
+
item[codeName] = total;
|
|
70425
|
+
});
|
|
70426
|
+
});
|
|
70427
|
+
}
|
|
70428
|
+
/**
|
|
70429
|
+
* @description 计算交叉表
|
|
70430
|
+
* @param {string[]} dimensionCols 维度列
|
|
70431
|
+
* @returns {*} {IModel[]}
|
|
70432
|
+
* @memberof CrossTableConverter
|
|
70433
|
+
*/
|
|
70434
|
+
calcCrossTableColumns(dimensionCols) {
|
|
70435
|
+
const deGridColumns = [];
|
|
70436
|
+
if (this.dimensions) {
|
|
70437
|
+
deGridColumns.push(
|
|
70438
|
+
...this.dimensions.map((item) => {
|
|
70439
|
+
const codeName = item.dimensionTag.toLowerCase();
|
|
70440
|
+
return {
|
|
70441
|
+
codeName,
|
|
70442
|
+
width: 150,
|
|
70443
|
+
id: codeName,
|
|
70444
|
+
widthUnit: "STAR",
|
|
70445
|
+
measureTag: codeName,
|
|
70446
|
+
appDEFieldId: codeName,
|
|
70447
|
+
dataItemName: codeName,
|
|
70448
|
+
caption: item.dimensionName,
|
|
70449
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70450
|
+
appId: this.appBIReport.appId,
|
|
70451
|
+
appCodeListId: item.appCodeListId,
|
|
70452
|
+
...this.calcGridColumnStyle(false)
|
|
70453
|
+
};
|
|
70454
|
+
})
|
|
70455
|
+
);
|
|
70456
|
+
}
|
|
70457
|
+
this.calcAggGridCol("left", deGridColumns);
|
|
70458
|
+
if (this.dimensionCol) {
|
|
70459
|
+
const codeNme = this.dimensionCol.dimensionTag.toLowerCase();
|
|
70460
|
+
const groupColumns = dimensionCols.map((key, index) => {
|
|
70461
|
+
var _a3, _b2;
|
|
70462
|
+
const children = this.clacMeasureColumns(key);
|
|
70463
|
+
return {
|
|
70464
|
+
degridColumns: children,
|
|
70465
|
+
id: "".concat(codeNme, "-").concat(index),
|
|
70466
|
+
appId: this.appBIReport.appId,
|
|
70467
|
+
columnType: "GROUPGRIDCOLUMN",
|
|
70468
|
+
codeName: "".concat(codeNme, "-").concat(index),
|
|
70469
|
+
measureTag: "".concat(codeNme, "-").concat(index),
|
|
70470
|
+
dataItemName: "".concat(codeNme, "-").concat(index),
|
|
70471
|
+
appDEFieldId: "".concat(codeNme, "-").concat(index),
|
|
70472
|
+
appCodeListId: this.dimensionCol.appCodeListId,
|
|
70473
|
+
caption: ((_b2 = (_a3 = this.codelistItems) == null ? void 0 : _a3.find((item) => item.value == key)) == null ? void 0 : _b2.text) || key
|
|
70474
|
+
};
|
|
70475
|
+
});
|
|
70476
|
+
deGridColumns.push(...groupColumns);
|
|
70477
|
+
} else {
|
|
70478
|
+
const children = this.clacMeasureColumns();
|
|
70479
|
+
deGridColumns.push(...children);
|
|
70480
|
+
}
|
|
70481
|
+
this.calcAggGridCol("right", deGridColumns);
|
|
70482
|
+
return deGridColumns;
|
|
70483
|
+
}
|
|
70484
|
+
/**
|
|
70485
|
+
* @description 获取数据项
|
|
70486
|
+
* @param {IData[]} items
|
|
70487
|
+
* @param {IData} item
|
|
70488
|
+
* @returns {*} {(IData | undefined)}
|
|
70489
|
+
* @memberof CrossTableConverter
|
|
70490
|
+
*/
|
|
70491
|
+
getItem(items, item) {
|
|
70492
|
+
return items.find((x) => {
|
|
70493
|
+
return this.dimensions.findIndex(
|
|
70494
|
+
(c) => x[c.dimensionTag.toLowerCase()] !== item[c.dimensionTag.toLowerCase()]
|
|
70495
|
+
) === -1;
|
|
70496
|
+
});
|
|
70497
|
+
}
|
|
70498
|
+
/**
|
|
70499
|
+
* @description 计算交叉表数据
|
|
70500
|
+
* @param {IData[]} items
|
|
70501
|
+
* @returns {*} {IData[]}
|
|
70502
|
+
* @memberof CrossTableConverter
|
|
70503
|
+
*/
|
|
70504
|
+
calcCrossTableData(items) {
|
|
70505
|
+
if (this.dimensionCol) {
|
|
70506
|
+
const result = [];
|
|
70507
|
+
const codeName = this.dimensionCol.dimensionTag.toLowerCase();
|
|
70508
|
+
items.forEach((item) => {
|
|
70509
|
+
this.measures.forEach((_item) => {
|
|
70510
|
+
const type = _item.measureTag.toLowerCase() || "";
|
|
70511
|
+
const value = item[codeName];
|
|
70512
|
+
let key = type || "";
|
|
70513
|
+
if (value)
|
|
70514
|
+
key = "".concat(value, "@").concat(type);
|
|
70515
|
+
const oldData = this.getItem(result, item);
|
|
70516
|
+
if (oldData) {
|
|
70517
|
+
oldData[key] = item[type];
|
|
70518
|
+
} else {
|
|
70519
|
+
const newItem = { [key]: item[type] };
|
|
70520
|
+
this.dimensions.forEach((x) => {
|
|
70521
|
+
newItem[x.dimensionTag.toLowerCase()] = item[x.dimensionTag.toLowerCase()];
|
|
70522
|
+
});
|
|
70523
|
+
result.push(newItem);
|
|
70524
|
+
}
|
|
70525
|
+
});
|
|
70526
|
+
});
|
|
70527
|
+
return result;
|
|
70528
|
+
}
|
|
70529
|
+
return items;
|
|
70530
|
+
}
|
|
70531
|
+
/**
|
|
70532
|
+
* @description 计算交叉表数据项
|
|
70533
|
+
* @param {IData[]} columns
|
|
70534
|
+
* @returns {*} {IModel[]}
|
|
70535
|
+
* @memberof CrossTableConverter
|
|
70536
|
+
*/
|
|
70537
|
+
calcCrossTableDataItems(columns) {
|
|
70538
|
+
const degridDataItems = [];
|
|
70539
|
+
const { grid_function_setting } = this.reportUIModel;
|
|
70540
|
+
columns.forEach((column) => {
|
|
70541
|
+
const otherParams = {};
|
|
70542
|
+
if (column.totalCodename && this.measuresTotalResult[column.totalCodename]) {
|
|
70543
|
+
if (grid_function_setting && grid_function_setting.indexOf("showPercent") !== -1) {
|
|
70544
|
+
otherParams.customCode = true;
|
|
70545
|
+
otherParams.scriptCode = "\n if (Object.prototype.hasOwnProperty.call(data, '".concat(column.measureTag, "')) {\n const value = data['").concat(column.measureTag, "'] / ").concat(this.measuresTotalResult[column.totalCodename], ";\n let formatValue = data['").concat(column.measureTag, "'];\n return formatValue + '(' + ibiz.util.text.format(value, '0.##%') + ')'\n }");
|
|
70546
|
+
} else {
|
|
70547
|
+
otherParams.customCode = true;
|
|
70548
|
+
otherParams.scriptCode = "\n if (Object.prototype.hasOwnProperty.call(data, '".concat(column.measureTag, "')) {\n let formatValue = data['").concat(column.measureTag, "'];\n return formatValue\n }");
|
|
70549
|
+
}
|
|
70550
|
+
}
|
|
70551
|
+
degridDataItems.push({
|
|
70552
|
+
dataType: 25,
|
|
70553
|
+
id: column.id,
|
|
70554
|
+
valueType: "SIMPLE",
|
|
70555
|
+
format: column.format,
|
|
70556
|
+
measureTag: column.measureTag,
|
|
70557
|
+
appId: this.appBIReport.appId,
|
|
70558
|
+
...otherParams
|
|
70559
|
+
});
|
|
70560
|
+
if (column.columnType === "GROUPGRIDCOLUMN")
|
|
70561
|
+
degridDataItems.push(
|
|
70562
|
+
...this.calcCrossTableDataItems(column.degridColumns)
|
|
70563
|
+
);
|
|
70564
|
+
});
|
|
70565
|
+
return degridDataItems;
|
|
70566
|
+
}
|
|
70567
|
+
/**
|
|
70568
|
+
* @description 转化数据到报表
|
|
70569
|
+
* @param {IData[]} items
|
|
70570
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
70571
|
+
* @memberof CrossTableConverter
|
|
70572
|
+
*/
|
|
70573
|
+
translateDataToReport(items) {
|
|
70574
|
+
if (!this.measures)
|
|
70575
|
+
return;
|
|
70576
|
+
const tempModel = clone54(this.mockModel);
|
|
70577
|
+
const dimensionCols = this.calcDimensionCols(items);
|
|
70578
|
+
const degridColumns = this.calcCrossTableColumns(dimensionCols);
|
|
70579
|
+
const mockDatas = this.calcCrossTableData(items);
|
|
70580
|
+
this.calcAggTotalData(mockDatas);
|
|
70581
|
+
const degridDataItems = this.calcCrossTableDataItems(degridColumns);
|
|
70582
|
+
Object.assign(tempModel, { degridColumns, degridDataItems });
|
|
70583
|
+
const { vars, classList, model } = this.getGridStyle();
|
|
70584
|
+
Object.assign(tempModel, model);
|
|
70585
|
+
const spanMethod = this.calcGridColumnMerge(mockDatas);
|
|
70586
|
+
Object.assign(tempModel, spanMethod);
|
|
70587
|
+
return { model: tempModel, options: { vars, classList }, data: mockDatas };
|
|
70588
|
+
}
|
|
70589
|
+
};
|
|
70590
|
+
|
|
70591
|
+
// src/controller/control/report-panel/generator/bi-converter/converter-factory.ts
|
|
70592
|
+
var ConverterFactory = class {
|
|
70593
|
+
/**
|
|
70594
|
+
* @description 创建转换器
|
|
70595
|
+
* @static
|
|
70596
|
+
* @param {('NUMBER'
|
|
70597
|
+
* | 'GAUGE'
|
|
70598
|
+
* | 'MULTI_SERIES_COL'
|
|
70599
|
+
* | 'STACK_COL'
|
|
70600
|
+
* | 'ZONE_COL'
|
|
70601
|
+
* | 'MULTI_SERIES_BAR'
|
|
70602
|
+
* | 'STACK_BAR'
|
|
70603
|
+
* | 'MULTI_SERIES_LINE'
|
|
70604
|
+
* | 'ZONE_LINE'
|
|
70605
|
+
* | 'AREA'
|
|
70606
|
+
* | 'GRID'
|
|
70607
|
+
* | 'CROSSTABLE'
|
|
70608
|
+
* | 'PIE'
|
|
70609
|
+
* | 'RADAR'
|
|
70610
|
+
* | 'SCATTER')} chartType
|
|
70611
|
+
* @returns {*} {(BaseConverter | undefined)}
|
|
70612
|
+
* @memberof ConverterFactory
|
|
70613
|
+
*/
|
|
70614
|
+
static createConverter(chartType, model, context, params) {
|
|
70615
|
+
switch (chartType) {
|
|
70616
|
+
case "NUMBER":
|
|
70617
|
+
return new NumberConverter(model, context, params);
|
|
70618
|
+
case "GAUGE":
|
|
70619
|
+
return new GaugeConverter(model, context, params);
|
|
70620
|
+
case "MULTI_SERIES_COL":
|
|
70621
|
+
return new MultiSeriesColConverter(model, context, params);
|
|
70622
|
+
case "STACK_COL":
|
|
70623
|
+
return new StackColConverter(model, context, params);
|
|
70624
|
+
case "ZONE_COL":
|
|
70625
|
+
return new ZoneColConverter(model, context, params);
|
|
70626
|
+
case "MULTI_SERIES_BAR":
|
|
70627
|
+
return new MultiSeriesBarConverter(model, context, params);
|
|
70628
|
+
case "STACK_BAR":
|
|
70629
|
+
return new StackBarConverter(model, context, params);
|
|
70630
|
+
case "MULTI_SERIES_LINE":
|
|
70631
|
+
return new MultiSeriesLineConverter(model, context, params);
|
|
70632
|
+
case "ZONE_LINE":
|
|
70633
|
+
return new ZoneLineConverter(model, context, params);
|
|
70634
|
+
case "AREA":
|
|
70635
|
+
return new AreaConverter(model, context, params);
|
|
70636
|
+
case "PIE":
|
|
70637
|
+
return new PieConverter(model, context, params);
|
|
70638
|
+
case "RADAR":
|
|
70639
|
+
return new RadarConverter(model, context, params);
|
|
70640
|
+
case "SCATTER":
|
|
70641
|
+
return new ScatterConverter(model, context, params);
|
|
70642
|
+
case "GRID":
|
|
70643
|
+
return new GridConverter(model, context, params);
|
|
70644
|
+
case "CROSSTABLE":
|
|
70645
|
+
return new CrossTableConverter(model, context, params);
|
|
70646
|
+
default:
|
|
70647
|
+
return void 0;
|
|
70648
|
+
}
|
|
70649
|
+
}
|
|
70650
|
+
};
|
|
70651
|
+
|
|
70652
|
+
// src/controller/control/report-panel/generator/bi-generator.ts
|
|
70653
|
+
var BIReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
70654
|
+
/**
|
|
70655
|
+
* @description 初始化配置
|
|
70656
|
+
* @returns {*} {Promise<void>}
|
|
70657
|
+
* @memberof BIReportPanelGenerator
|
|
70658
|
+
*/
|
|
70659
|
+
async initConfig() {
|
|
70660
|
+
const { appDEReport } = this.model;
|
|
70661
|
+
const { appBIReport } = appDEReport;
|
|
70662
|
+
const appBISchemeId = appDEReport.appBISchemeId.split(".").pop();
|
|
70663
|
+
appBIReport.appBISchemeId = appBISchemeId;
|
|
70664
|
+
this.config = appBIReport;
|
|
70665
|
+
await this.initConverter();
|
|
70666
|
+
}
|
|
70667
|
+
/**
|
|
70668
|
+
* @description 初始化转换器
|
|
70669
|
+
* @private
|
|
70670
|
+
* @memberof BIReportPanelGenerator
|
|
70671
|
+
*/
|
|
70672
|
+
async initConverter() {
|
|
70673
|
+
var _a3;
|
|
70674
|
+
const { appDEReport } = this.model;
|
|
70675
|
+
if (!appDEReport || !appDEReport.appBIReport)
|
|
70676
|
+
return;
|
|
70677
|
+
const { reportUIModel } = appDEReport.appBIReport;
|
|
70678
|
+
if (reportUIModel) {
|
|
70679
|
+
const tempReportUIModel = JSON.parse(reportUIModel);
|
|
70680
|
+
if (tempReportUIModel.chart_type) {
|
|
70681
|
+
this.reportType = tempReportUIModel.chart_type;
|
|
70682
|
+
this.converter = ConverterFactory.createConverter(
|
|
70683
|
+
tempReportUIModel.chart_type,
|
|
70684
|
+
appDEReport.appBIReport,
|
|
70685
|
+
this.reportPanel.context,
|
|
70686
|
+
this.reportPanel.params
|
|
70687
|
+
);
|
|
70688
|
+
await ((_a3 = this.converter) == null ? void 0 : _a3.init());
|
|
70689
|
+
}
|
|
70690
|
+
}
|
|
70691
|
+
}
|
|
70692
|
+
/**
|
|
70693
|
+
* @description 生成
|
|
70694
|
+
* @param {IData[]} items
|
|
70695
|
+
* @returns {*} {({
|
|
70696
|
+
* model: IModel;
|
|
70697
|
+
* options: IData;
|
|
70698
|
+
* data: IData[];
|
|
70699
|
+
* }
|
|
70700
|
+
* | undefined)}
|
|
70701
|
+
* @memberof BIReportPanelGenerator
|
|
70702
|
+
*/
|
|
70703
|
+
generate(items) {
|
|
70704
|
+
var _a3;
|
|
70705
|
+
return (_a3 = this.converter) == null ? void 0 : _a3.translateDataToReport(items);
|
|
70706
|
+
}
|
|
70707
|
+
};
|
|
70708
|
+
|
|
70709
|
+
// src/controller/control/report-panel/generator/generator-factory.ts
|
|
70710
|
+
var ReportPanelGeneratorFactory = class {
|
|
70711
|
+
/**
|
|
70712
|
+
* 获取报表面板生成器实例
|
|
70713
|
+
*
|
|
70714
|
+
* @author tony001
|
|
70715
|
+
* @date 2024-06-20 15:06:18
|
|
70716
|
+
* @static
|
|
70717
|
+
* @param {IDEReportPanel} model
|
|
70718
|
+
* @param {IReportPanelController} reportPanel
|
|
70719
|
+
* @return {*} {ReportPanelBaseGenerator}
|
|
70720
|
+
*/
|
|
70721
|
+
static getInstance(model, reportPanel) {
|
|
70722
|
+
if (!model || !model.appDEReport || !model.appDEReport.reportType) {
|
|
70723
|
+
throw new Error(
|
|
70724
|
+
ibiz.i18n.t("runtime.controller.control.reportPanel.reportType")
|
|
70725
|
+
);
|
|
70726
|
+
}
|
|
70727
|
+
switch (model.appDEReport.reportType) {
|
|
70728
|
+
case "USER":
|
|
70729
|
+
return new UserReportPanelGenerator(model, reportPanel);
|
|
70730
|
+
case "USER2":
|
|
70731
|
+
return new User2ReportPanelGenerator(model, reportPanel);
|
|
70732
|
+
case "DESYSBIREPORTS":
|
|
70733
|
+
case "SYSBICUBE":
|
|
70734
|
+
case "DESYSBICUBES":
|
|
70735
|
+
case "ALLSYSBICUBES":
|
|
70736
|
+
case "SYSBIREPORT":
|
|
70737
|
+
case "SYSBICUBEREPORTS":
|
|
70738
|
+
case "ALLSYSBIREPORTS":
|
|
70739
|
+
return new BIReportPanelGenerator(model, reportPanel);
|
|
70740
|
+
default:
|
|
70741
|
+
throw new Error(
|
|
70742
|
+
ibiz.i18n.t("runtime.controller.control.reportPanel.noImplemented", {
|
|
70743
|
+
reportType: model.appDEReport.reportType
|
|
70744
|
+
})
|
|
70745
|
+
);
|
|
70746
|
+
}
|
|
70747
|
+
}
|
|
70748
|
+
};
|
|
70749
|
+
|
|
70750
|
+
// src/controller/control/report-panel/report-panel.controller.ts
|
|
70751
|
+
var ReportPanelController = class extends ControlController {
|
|
70752
|
+
/**
|
|
70753
|
+
* 事件对象
|
|
70754
|
+
*
|
|
70755
|
+
* @readonly
|
|
70756
|
+
* @protected
|
|
70757
|
+
* @type {ControllerEvent<IReportPanelEvent>}
|
|
70758
|
+
* @memberof ReportPanelController
|
|
70759
|
+
*/
|
|
70760
|
+
get _evt() {
|
|
70761
|
+
return this.evt;
|
|
70762
|
+
}
|
|
70763
|
+
/**
|
|
70764
|
+
* @description 是否为BI报表设计
|
|
70765
|
+
* @readonly
|
|
70766
|
+
* @type {boolean}
|
|
70767
|
+
* @memberof ReportPanelController
|
|
70768
|
+
*/
|
|
70769
|
+
get isBIReportDesign() {
|
|
70770
|
+
const { appDEReport } = this.model;
|
|
70771
|
+
const biReportType = [
|
|
70772
|
+
"DESYSBIREPORTS",
|
|
70773
|
+
"SYSBICUBE",
|
|
70774
|
+
"DESYSBICUBES",
|
|
70775
|
+
"ALLSYSBICUBES",
|
|
70776
|
+
"SYSBIREPORT",
|
|
70777
|
+
"SYSBICUBEREPORTS",
|
|
70778
|
+
"ALLSYSBIREPORTS"
|
|
70779
|
+
];
|
|
70780
|
+
if ((appDEReport == null ? void 0 : appDEReport.reportType) && biReportType.includes(appDEReport == null ? void 0 : appDEReport.reportType)) {
|
|
70781
|
+
return !this.generator.reportType;
|
|
70782
|
+
}
|
|
70783
|
+
return false;
|
|
70784
|
+
}
|
|
70785
|
+
/**
|
|
70786
|
+
* @description 获取数据
|
|
70787
|
+
* @returns {*} {IData[]}
|
|
70788
|
+
* @memberof ReportPanelController
|
|
70789
|
+
*/
|
|
70790
|
+
getData() {
|
|
70791
|
+
var _a3;
|
|
70792
|
+
if (this.isBIReportDesign)
|
|
70793
|
+
return ((_a3 = this.generator.protoRef) == null ? void 0 : _a3.state.items) || [];
|
|
70794
|
+
return this.state.data;
|
|
70795
|
+
}
|
|
70796
|
+
/**
|
|
70797
|
+
* @description 初始化状态
|
|
70798
|
+
* @protected
|
|
70799
|
+
* @memberof ReportPanelController
|
|
70800
|
+
*/
|
|
70801
|
+
initState() {
|
|
70802
|
+
super.initState();
|
|
70803
|
+
this.state.data = [];
|
|
70804
|
+
this.state.searchParams = {};
|
|
70805
|
+
this.state.biReport = void 0;
|
|
70806
|
+
}
|
|
70807
|
+
/**
|
|
70808
|
+
* @description 生命周期-创建完成
|
|
70809
|
+
* @protected
|
|
70810
|
+
* @returns {*} {Promise<void>}
|
|
70811
|
+
* @memberof ReportPanelController
|
|
70812
|
+
*/
|
|
70813
|
+
async onCreated() {
|
|
70814
|
+
var _a3;
|
|
70815
|
+
await super.onCreated();
|
|
70816
|
+
this.generator = ReportPanelGeneratorFactory.getInstance(this.model, this);
|
|
70817
|
+
await ((_a3 = this.generator) == null ? void 0 : _a3.initConfig());
|
|
70818
|
+
this.dataEntity = await ibiz.hub.getAppDataEntity(
|
|
70819
|
+
this.model.appDataEntityId,
|
|
70820
|
+
this.model.appId
|
|
70821
|
+
);
|
|
70822
|
+
this.service = new ReportPanelService(this.model);
|
|
70823
|
+
await this.service.init(this.context);
|
|
70824
|
+
}
|
|
70825
|
+
/**
|
|
70826
|
+
* @description 生命周期-加载完成
|
|
70827
|
+
* @protected
|
|
70828
|
+
* @returns {*} {Promise<void>}
|
|
70829
|
+
* @memberof ReportPanelController
|
|
70830
|
+
*/
|
|
70831
|
+
async onMounted() {
|
|
70832
|
+
await super.onMounted();
|
|
70833
|
+
if (this.state.loadDefault) {
|
|
70834
|
+
this.load({ isInitialLoad: true });
|
|
70835
|
+
}
|
|
70836
|
+
}
|
|
70837
|
+
/**
|
|
70838
|
+
* @description 获取报表参数
|
|
70839
|
+
* @protected
|
|
70840
|
+
* @returns {*} {IParams}
|
|
70841
|
+
* @memberof ReportPanelController
|
|
70842
|
+
*/
|
|
70843
|
+
getReportParams() {
|
|
70844
|
+
var _a3, _b2;
|
|
70845
|
+
const appBIReport = (_a3 = this.model.appDEReport) == null ? void 0 : _a3.appBIReport;
|
|
70846
|
+
if (!appBIReport)
|
|
70847
|
+
return {};
|
|
70848
|
+
const {
|
|
70849
|
+
appBICubeId,
|
|
70850
|
+
reportUIModel,
|
|
70851
|
+
appBIReportMeasures,
|
|
70852
|
+
appBIReportDimensions
|
|
70853
|
+
} = appBIReport;
|
|
70854
|
+
const uiModel = reportUIModel ? JSON.parse(reportUIModel) : {};
|
|
70855
|
+
const period = (_b2 = uiModel.period) == null ? void 0 : _b2[0];
|
|
70856
|
+
const colSort = uiModel.grid_col_sort;
|
|
70857
|
+
const result = {
|
|
70858
|
+
bicubetag: appBICubeId,
|
|
70859
|
+
bimeasures: (appBIReportMeasures == null ? void 0 : appBIReportMeasures.map((measure) => {
|
|
70860
|
+
var _a4;
|
|
70861
|
+
const item = { name: (_a4 = measure.measureTag) == null ? void 0 : _a4.toLowerCase() };
|
|
70862
|
+
if (measure.measureParams)
|
|
70863
|
+
item.param = measure.measureParams;
|
|
70864
|
+
if (measure.aggMode)
|
|
70865
|
+
item.aggmode = measure.aggMode;
|
|
70866
|
+
return item;
|
|
70867
|
+
})) || [],
|
|
70868
|
+
bidimensions: (appBIReportDimensions == null ? void 0 : appBIReportDimensions.map((dimension) => {
|
|
70869
|
+
var _a4;
|
|
70870
|
+
const item = { name: (_a4 = dimension.dimensionTag) == null ? void 0 : _a4.toLowerCase() };
|
|
70871
|
+
if (dimension.dimensionParams)
|
|
70872
|
+
item.param = dimension.dimensionParams;
|
|
70873
|
+
return item;
|
|
70874
|
+
})) || [],
|
|
70875
|
+
bisort: colSort == null ? void 0 : colSort.map((col) => "".concat(col.codename.toLowerCase(), ",").concat(col.sort)).join(";"),
|
|
70876
|
+
biperiod: period == null ? void 0 : period.params
|
|
70877
|
+
};
|
|
70878
|
+
return result;
|
|
70879
|
+
}
|
|
70880
|
+
/**
|
|
70881
|
+
* @description 获取请求过滤参数
|
|
70882
|
+
* @param {IParams} [extraParams]
|
|
70883
|
+
* @returns {*} {Promise<IParams>}
|
|
70884
|
+
* @memberof ReportPanelController
|
|
70885
|
+
*/
|
|
70886
|
+
async getFetchParams(extraParams) {
|
|
70887
|
+
const resultParams = {
|
|
70888
|
+
...this.params,
|
|
70889
|
+
...this.getReportParams()
|
|
70890
|
+
};
|
|
70891
|
+
await this._evt.emit("onBeforeLoad", void 0);
|
|
70892
|
+
Object.assign(resultParams, {
|
|
70893
|
+
...this.state.searchParams
|
|
70894
|
+
});
|
|
70895
|
+
if (extraParams) {
|
|
70896
|
+
Object.assign(resultParams, extraParams);
|
|
70897
|
+
}
|
|
70898
|
+
return resultParams;
|
|
70899
|
+
}
|
|
70900
|
+
/**
|
|
70901
|
+
* @description 加载数据
|
|
70902
|
+
* @param {MDCtrlLoadParams} [args={}]
|
|
70903
|
+
* @returns {*} {Promise<IData>}
|
|
70904
|
+
* @memberof ReportPanelController
|
|
70905
|
+
*/
|
|
70906
|
+
async load(args = {}) {
|
|
70907
|
+
var _a3, _b2;
|
|
70908
|
+
if (this.isBIReportDesign)
|
|
70909
|
+
return this.state.data;
|
|
70910
|
+
try {
|
|
70911
|
+
await this.startLoading();
|
|
70912
|
+
const { codeName, appDEReport, appDataEntityId } = this.model;
|
|
70913
|
+
const reportTag = ((_a3 = appDEReport == null ? void 0 : appDEReport.appBIReport) == null ? void 0 : _a3.id) || codeName;
|
|
70914
|
+
const enyityId = ((_b2 = appDEReport == null ? void 0 : appDEReport.appBIReport) == null ? void 0 : _b2.appDataEntityId) || appDataEntityId;
|
|
70915
|
+
const { context } = this.handlerAbilityParams(args);
|
|
70916
|
+
const params = await this.getFetchParams(args == null ? void 0 : args.viewParam);
|
|
70917
|
+
const res = await this.service.fetch(
|
|
70918
|
+
reportTag,
|
|
70919
|
+
enyityId,
|
|
70920
|
+
context,
|
|
70921
|
+
params
|
|
70922
|
+
);
|
|
70923
|
+
this.state.data = res.data;
|
|
70924
|
+
await this.afterLoad(args, res.data);
|
|
70925
|
+
this.state.isLoaded = true;
|
|
70926
|
+
await this._evt.emit("onLoadSuccess", void 0);
|
|
70927
|
+
} catch (error) {
|
|
70928
|
+
await this._evt.emit("onLoadError", void 0);
|
|
70929
|
+
this.actionNotification("FETCHERROR", {
|
|
70930
|
+
error
|
|
70931
|
+
});
|
|
70932
|
+
throw error;
|
|
70933
|
+
} finally {
|
|
70934
|
+
await this.endLoading();
|
|
70935
|
+
}
|
|
70936
|
+
this.actionNotification("FETCHSUCCESS");
|
|
70937
|
+
return this.state.data;
|
|
70938
|
+
}
|
|
70939
|
+
/**
|
|
70940
|
+
* @description 部件加载后处理
|
|
70941
|
+
* @param {MDCtrlLoadParams} args
|
|
70942
|
+
* @param {IData} data
|
|
70943
|
+
* @returns {*} {Promise<IData>}
|
|
70944
|
+
* @memberof ReportPanelController
|
|
70945
|
+
*/
|
|
70946
|
+
async afterLoad(args, data) {
|
|
70947
|
+
this.state.biReport = this.generator.generate(data);
|
|
70948
|
+
return data;
|
|
70949
|
+
}
|
|
70950
|
+
/**
|
|
70951
|
+
* @description 刷新
|
|
70952
|
+
* @returns {*} {Promise<void>}
|
|
70953
|
+
* @memberof ReportPanelController
|
|
70954
|
+
*/
|
|
70955
|
+
async refresh() {
|
|
70956
|
+
if (this.isBIReportDesign) {
|
|
70957
|
+
this.generator.load();
|
|
70958
|
+
} else {
|
|
70959
|
+
this.doNextActive(() => this.load({ isInitialLoad: false }), {
|
|
70960
|
+
key: "refresh"
|
|
70961
|
+
});
|
|
70962
|
+
}
|
|
70963
|
+
}
|
|
70964
|
+
};
|
|
70965
|
+
|
|
70966
|
+
// src/controller/control/gantt/gantt.controller.ts
|
|
70967
|
+
import {
|
|
70968
|
+
awaitTimeout as awaitTimeout4,
|
|
70969
|
+
RuntimeError as RuntimeError64,
|
|
70970
|
+
recursiveIterate as recursiveIterate15
|
|
70971
|
+
} from "@ibiz-template/core";
|
|
70972
|
+
|
|
70973
|
+
// src/controller/control/gantt/gantt.service.ts
|
|
70974
|
+
import { ModelError as ModelError29 } from "@ibiz-template/core";
|
|
70975
|
+
var GanttService = class extends TreeService {
|
|
70976
|
+
/**
|
|
70977
|
+
* 获取节点草稿
|
|
70978
|
+
*
|
|
70979
|
+
* @param {IDETreeDataSetNode} nodeModel
|
|
70980
|
+
* @param {(IDETreeNodeRS | undefined)} nodeRS
|
|
70981
|
+
* @param {(IGanttNodeData | undefined)} parentNodeData
|
|
70982
|
+
* @param {TreeFetchOpts} opts
|
|
70983
|
+
* @return {*} {Promise<IGanttNodeData>}
|
|
70984
|
+
* @memberof GanttService
|
|
70985
|
+
*/
|
|
70986
|
+
async getNodeDraft(nodeModel, nodeRS, parentNodeData, opts) {
|
|
70987
|
+
var _a3;
|
|
70988
|
+
const { appDataEntityId } = nodeModel;
|
|
70989
|
+
const { context, params, navContext, navParams } = nodeRS ? this.getNodeRSFilterParams(nodeRS, parentNodeData, opts) : {
|
|
70990
|
+
context: opts.context,
|
|
70991
|
+
params: opts.params,
|
|
70992
|
+
navContext: {},
|
|
70993
|
+
navParams: {}
|
|
70994
|
+
};
|
|
70995
|
+
const response = await this.app.deService.exec(
|
|
70996
|
+
appDataEntityId,
|
|
70997
|
+
"getdraft",
|
|
70998
|
+
context,
|
|
70999
|
+
params
|
|
71000
|
+
);
|
|
71001
|
+
const { data } = response;
|
|
71002
|
+
if (((_a3 = nodeRS == null ? void 0 : nodeRS.parentDER1N) == null ? void 0 : _a3.pickupDEFName) && parentNodeData) {
|
|
71003
|
+
data[nodeRS.parentDER1N.pickupDEFName] = parentNodeData._value;
|
|
71004
|
+
}
|
|
71005
|
+
return new GanttDataSetNodeData(this.model, nodeModel, parentNodeData, {
|
|
71006
|
+
data: response.data,
|
|
71007
|
+
leaf: true,
|
|
71008
|
+
navContext,
|
|
71009
|
+
navParams,
|
|
71010
|
+
defaultExpand: false
|
|
71011
|
+
});
|
|
71012
|
+
}
|
|
71013
|
+
/**
|
|
71014
|
+
* 获取子节点数据
|
|
71015
|
+
*
|
|
71016
|
+
* @author tony001
|
|
71017
|
+
* @date 2023-12-11 18:12:58
|
|
71018
|
+
* @param {(IGanttNodeData | undefined)} parentNodeData
|
|
71019
|
+
* @param {TreeFetchOpts} opts
|
|
71020
|
+
* @return {*} {(Promise<IGanttNodeData[] | undefined>)}
|
|
71021
|
+
*/
|
|
71022
|
+
async fetchChildNodes(parentNodeData, opts) {
|
|
71023
|
+
const { hasQuery } = opts;
|
|
71024
|
+
let childrenNodes = [];
|
|
71025
|
+
if (!parentNodeData) {
|
|
71026
|
+
const rootNode = getRootNode(this.model);
|
|
71027
|
+
childrenNodes = await this.fetchNodeDatasByType(
|
|
71028
|
+
rootNode,
|
|
71029
|
+
void 0,
|
|
71030
|
+
void 0,
|
|
71031
|
+
opts
|
|
71032
|
+
);
|
|
71033
|
+
} else {
|
|
71034
|
+
const childNodeRSs = getChildNodeRSs(this.model, {
|
|
71035
|
+
parentId: parentNodeData._nodeId,
|
|
71036
|
+
hasQuery
|
|
71037
|
+
});
|
|
71038
|
+
if (childNodeRSs.length === 0) {
|
|
71039
|
+
return;
|
|
71040
|
+
}
|
|
71041
|
+
const results = await handleAllSettled(
|
|
71042
|
+
childNodeRSs.map(async (childNodeRS) => {
|
|
71043
|
+
const childNode = getTreeNode(
|
|
71044
|
+
this.model,
|
|
71045
|
+
childNodeRS.childDETreeNodeId
|
|
71046
|
+
);
|
|
71047
|
+
return this.fetchNodeDatasByType(
|
|
71048
|
+
childNode,
|
|
71049
|
+
childNodeRS,
|
|
71050
|
+
parentNodeData,
|
|
71051
|
+
opts
|
|
71052
|
+
);
|
|
71053
|
+
}),
|
|
71054
|
+
false
|
|
71055
|
+
);
|
|
71056
|
+
results.forEach((result) => {
|
|
71057
|
+
childrenNodes.push(...result);
|
|
71058
|
+
});
|
|
71059
|
+
}
|
|
71060
|
+
return childrenNodes;
|
|
71061
|
+
}
|
|
71062
|
+
/**
|
|
71063
|
+
* 通过节点类型加载节点数据
|
|
71064
|
+
*
|
|
71065
|
+
* @author tony001
|
|
71066
|
+
* @date 2023-12-11 18:12:35
|
|
71067
|
+
* @protected
|
|
71068
|
+
* @param {IDETreeNode} nodeModel
|
|
71069
|
+
* @param {(IDETreeNodeRS | undefined)} nodeRS
|
|
71070
|
+
* @param {(ITreeNodeData | undefined)} parentNodeData
|
|
71071
|
+
* @param {TreeFetchOpts} opts
|
|
71072
|
+
* @return {*} {Promise<IGanttNodeData[]>}
|
|
71073
|
+
*/
|
|
71074
|
+
async fetchNodeDatasByType(nodeModel, nodeRS, parentNodeData, opts) {
|
|
71075
|
+
const leaf = getChildNodeRSs(this.model, {
|
|
71076
|
+
parentId: nodeModel.id,
|
|
71077
|
+
hasQuery: opts.hasQuery
|
|
71078
|
+
}).length === 0;
|
|
71079
|
+
const tempOpts = { ...opts, leaf };
|
|
71080
|
+
let result = [];
|
|
71081
|
+
switch (nodeModel.treeNodeType) {
|
|
71082
|
+
case "STATIC":
|
|
71083
|
+
{
|
|
71084
|
+
const nodeData = await this.getStaticGanttNodeData(
|
|
71085
|
+
nodeModel,
|
|
71086
|
+
nodeRS,
|
|
71087
|
+
parentNodeData,
|
|
71088
|
+
tempOpts
|
|
68247
71089
|
);
|
|
68248
71090
|
result = [nodeData];
|
|
68249
71091
|
}
|
|
@@ -69336,6 +72178,12 @@ var ThemeUtil = class {
|
|
|
69336
72178
|
* @memberof ThemeUtil
|
|
69337
72179
|
*/
|
|
69338
72180
|
this.evt = new QXEventEx();
|
|
72181
|
+
/**
|
|
72182
|
+
* @description 插件主题
|
|
72183
|
+
* @type {IAppUITheme[]}
|
|
72184
|
+
* @memberof ThemeUtil
|
|
72185
|
+
*/
|
|
72186
|
+
this.pluginTheme = [];
|
|
69339
72187
|
}
|
|
69340
72188
|
/**
|
|
69341
72189
|
* @description 加载主题插件
|
|
@@ -69345,7 +72193,7 @@ var ThemeUtil = class {
|
|
|
69345
72193
|
* @memberof ThemeUtil
|
|
69346
72194
|
*/
|
|
69347
72195
|
async loadTheme(theme, type = "COLOR") {
|
|
69348
|
-
const data =
|
|
72196
|
+
const data = clone55(theme.themeParams || {});
|
|
69349
72197
|
const path2 = data["theme-package-path"] || theme.themeUrl;
|
|
69350
72198
|
delete data.appId;
|
|
69351
72199
|
delete data["theme-package-path"];
|
|
@@ -69357,6 +72205,7 @@ var ThemeUtil = class {
|
|
|
69357
72205
|
if (type === "COLOR") {
|
|
69358
72206
|
this.setThemeParams(theme, data);
|
|
69359
72207
|
this.setTheme(theme.themeTag);
|
|
72208
|
+
this.pluginTheme.push(theme);
|
|
69360
72209
|
} else {
|
|
69361
72210
|
this.html.classList.add(theme.themeTag);
|
|
69362
72211
|
}
|
|
@@ -70000,8 +72849,8 @@ var baseStyle = {
|
|
|
70000
72849
|
position: "fixed",
|
|
70001
72850
|
zIndex: "10000"
|
|
70002
72851
|
};
|
|
70003
|
-
function cloneElement(
|
|
70004
|
-
const element = getAnimationElement(
|
|
72852
|
+
function cloneElement(clone61, teleport = document.body, isRemoveChild = true) {
|
|
72853
|
+
const element = getAnimationElement(clone61);
|
|
70005
72854
|
if (element == null) {
|
|
70006
72855
|
throw new Error(ibiz.i18n.t("runtime.utils.anime.noClone"));
|
|
70007
72856
|
}
|
|
@@ -70420,11 +73269,11 @@ function arrayContains(arr, val) {
|
|
|
70420
73269
|
});
|
|
70421
73270
|
}
|
|
70422
73271
|
function cloneObject(o) {
|
|
70423
|
-
var
|
|
73272
|
+
var clone61 = {};
|
|
70424
73273
|
for (var p in o) {
|
|
70425
|
-
|
|
73274
|
+
clone61[p] = o[p];
|
|
70426
73275
|
}
|
|
70427
|
-
return
|
|
73276
|
+
return clone61;
|
|
70428
73277
|
}
|
|
70429
73278
|
function replaceObjectProps(o1, o2) {
|
|
70430
73279
|
var o = cloneObject(o1);
|
|
@@ -72336,7 +75185,7 @@ var ShortCutUtil = class {
|
|
|
72336
75185
|
};
|
|
72337
75186
|
|
|
72338
75187
|
// src/utils/bi-report-util/bi-report-util.ts
|
|
72339
|
-
import { clone as
|
|
75188
|
+
import { clone as clone56 } from "ramda";
|
|
72340
75189
|
import { RuntimeError as RuntimeError66 } from "@ibiz-template/core";
|
|
72341
75190
|
var BIReportUtil = class {
|
|
72342
75191
|
/**
|
|
@@ -72352,7 +75201,7 @@ var BIReportUtil = class {
|
|
|
72352
75201
|
async openDesignPage(context, params, data) {
|
|
72353
75202
|
if (!data.mode)
|
|
72354
75203
|
data.mode = "DATA";
|
|
72355
|
-
const tempContext =
|
|
75204
|
+
const tempContext = clone56(context);
|
|
72356
75205
|
let config = {};
|
|
72357
75206
|
if (data.mode === "DATA") {
|
|
72358
75207
|
const app = ibiz.hub.getApp(ibiz.env.appId);
|
|
@@ -73019,7 +75868,7 @@ var RecordNavUtil = class {
|
|
|
73019
75868
|
|
|
73020
75869
|
// src/utils/jsonschema-util/jsonschema-util.ts
|
|
73021
75870
|
import qs5 from "qs";
|
|
73022
|
-
import { clone as
|
|
75871
|
+
import { clone as clone57 } from "ramda";
|
|
73023
75872
|
var JsonSchemaUtil = class {
|
|
73024
75873
|
constructor() {
|
|
73025
75874
|
/**
|
|
@@ -73272,7 +76121,7 @@ var JsonSchemaUtil = class {
|
|
|
73272
76121
|
getMockEditor(context, item, valueOP) {
|
|
73273
76122
|
if (valueOP && this.excludeOPs.includes(valueOP))
|
|
73274
76123
|
return;
|
|
73275
|
-
const baseMockEditor =
|
|
76124
|
+
const baseMockEditor = clone57(this.DataTypeToEditor[item.type]);
|
|
73276
76125
|
if (!baseMockEditor)
|
|
73277
76126
|
return;
|
|
73278
76127
|
baseMockEditor.appId = context.srfappid;
|
|
@@ -77921,7 +80770,6 @@ var ViewShellHooks = class {
|
|
|
77921
80770
|
};
|
|
77922
80771
|
|
|
77923
80772
|
// src/utils/water-mark-util/water-mark-util.ts
|
|
77924
|
-
import { StringUtil as StringUtil6 } from "@ibiz-template/core";
|
|
77925
80773
|
import { isArray as isArray11 } from "lodash-es";
|
|
77926
80774
|
|
|
77927
80775
|
// src/utils/water-mark-util/water-mark-manager/water-mark-manager.ts
|
|
@@ -78262,8 +81110,16 @@ var WaterMarkUtil = class {
|
|
|
78262
81110
|
const _opts = { ...option };
|
|
78263
81111
|
if (_opts.text) {
|
|
78264
81112
|
_opts.text = isArray11(_opts.text) ? _opts.text.map(
|
|
78265
|
-
(_textItem) =>
|
|
78266
|
-
|
|
81113
|
+
(_textItem) => ScriptFactory.execSingleLine("`".concat(_textItem, "`"), {
|
|
81114
|
+
context,
|
|
81115
|
+
params,
|
|
81116
|
+
data
|
|
81117
|
+
})
|
|
81118
|
+
) : ScriptFactory.execSingleLine("`".concat(_opts.text, "`"), {
|
|
81119
|
+
context,
|
|
81120
|
+
params,
|
|
81121
|
+
data
|
|
81122
|
+
});
|
|
78267
81123
|
}
|
|
78268
81124
|
const waterMarkManager = new WaterMarkManager(
|
|
78269
81125
|
_opts,
|
|
@@ -78353,7 +81209,7 @@ var WeChatUtil = class {
|
|
|
78353
81209
|
|
|
78354
81210
|
// src/command/app/open-app-view/open-app-view.ts
|
|
78355
81211
|
import { ModelError as ModelError30, RuntimeError as RuntimeError69 } from "@ibiz-template/core";
|
|
78356
|
-
import { clone as
|
|
81212
|
+
import { clone as clone58 } from "ramda";
|
|
78357
81213
|
var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
78358
81214
|
constructor() {
|
|
78359
81215
|
ibiz.commands.register(_OpenAppViewCommand.TAG, this.exec.bind(this));
|
|
@@ -78370,7 +81226,7 @@ var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
|
78370
81226
|
* @return {*} {(Promise<IModalData | void>)}
|
|
78371
81227
|
*/
|
|
78372
81228
|
async exec(appViewId, _context, params = {}, opts = {}) {
|
|
78373
|
-
const context =
|
|
81229
|
+
const context = clone58(_context);
|
|
78374
81230
|
if (context.srfsimple) {
|
|
78375
81231
|
delete context.srfsimple;
|
|
78376
81232
|
}
|
|
@@ -79170,7 +82026,7 @@ import { QXEvent as QXEvent14 } from "qx-util";
|
|
|
79170
82026
|
|
|
79171
82027
|
// src/controller/notification/async-action.controller.ts
|
|
79172
82028
|
import { QXEvent as QXEvent12 } from "qx-util";
|
|
79173
|
-
import { clone as
|
|
82029
|
+
import { clone as clone59 } from "ramda";
|
|
79174
82030
|
import { isNil as isNil38, isNumber as isNumber5 } from "lodash-es";
|
|
79175
82031
|
import dayjs10 from "dayjs";
|
|
79176
82032
|
var AsyncActionController = class {
|
|
@@ -79281,7 +82137,7 @@ var AsyncActionController = class {
|
|
|
79281
82137
|
} else {
|
|
79282
82138
|
this.noticeResult(action);
|
|
79283
82139
|
}
|
|
79284
|
-
this.evt.emit("add",
|
|
82140
|
+
this.evt.emit("add", clone59(action));
|
|
79285
82141
|
this.evt.emit("dataChange");
|
|
79286
82142
|
}
|
|
79287
82143
|
/**
|
|
@@ -79303,7 +82159,7 @@ var AsyncActionController = class {
|
|
|
79303
82159
|
}
|
|
79304
82160
|
this.noticeResult(action);
|
|
79305
82161
|
}
|
|
79306
|
-
this.evt.emit("change",
|
|
82162
|
+
this.evt.emit("change", clone59(action));
|
|
79307
82163
|
this.evt.emit("dataChange");
|
|
79308
82164
|
}
|
|
79309
82165
|
noticeResult(action) {
|
|
@@ -79748,6 +82604,14 @@ var AppHub = class {
|
|
|
79748
82604
|
* @type {Map<string, Map<string, IModel>>}
|
|
79749
82605
|
*/
|
|
79750
82606
|
this.plugins = /* @__PURE__ */ new Map();
|
|
82607
|
+
/**
|
|
82608
|
+
* 子应用代码表清单,key为应用标识,值为key为代码表标识,value为代码表模型对象MAP
|
|
82609
|
+
*
|
|
82610
|
+
* @author tony001
|
|
82611
|
+
* @protected
|
|
82612
|
+
* @type {Map<string, Map<string, IAppCodeList>>}
|
|
82613
|
+
*/
|
|
82614
|
+
this.codeLists = /* @__PURE__ */ new Map();
|
|
79751
82615
|
/**
|
|
79752
82616
|
* hub配置信息服务
|
|
79753
82617
|
* @author lxm
|
|
@@ -79980,6 +82844,20 @@ var AppHub = class {
|
|
|
79980
82844
|
}
|
|
79981
82845
|
return [];
|
|
79982
82846
|
}
|
|
82847
|
+
/**
|
|
82848
|
+
* 注册子应用代码表
|
|
82849
|
+
*
|
|
82850
|
+
* @author tony001
|
|
82851
|
+
* @param {string} appId
|
|
82852
|
+
* @param {IAppCodeList} model
|
|
82853
|
+
*/
|
|
82854
|
+
registerSubAppCodeList(appId2, model) {
|
|
82855
|
+
if (!this.codeLists.has(appId2)) {
|
|
82856
|
+
this.codeLists.set(appId2, /* @__PURE__ */ new Map());
|
|
82857
|
+
}
|
|
82858
|
+
const map = this.codeLists.get(appId2);
|
|
82859
|
+
map.set(model.codeListTag, model);
|
|
82860
|
+
}
|
|
79983
82861
|
/**
|
|
79984
82862
|
* 设置应用视图所属应用
|
|
79985
82863
|
*
|
|
@@ -80237,6 +83115,18 @@ var AppHub = class {
|
|
|
80237
83115
|
}
|
|
80238
83116
|
throw new RuntimeError72(ibiz.i18n.t("runtime.service.noFound", { id }));
|
|
80239
83117
|
}
|
|
83118
|
+
/**
|
|
83119
|
+
* 根据代码表标识获取子应用代码表
|
|
83120
|
+
*
|
|
83121
|
+
* @author tony001
|
|
83122
|
+
* @param {string} id
|
|
83123
|
+
* @param {string} [appId=ibiz.env.appId]
|
|
83124
|
+
* @return {*} {Promise<IAppCodeList>}
|
|
83125
|
+
*/
|
|
83126
|
+
getSubAppCodeList(id, appId2 = ibiz.env.appId) {
|
|
83127
|
+
const targetCodeListMap = this.codeLists.get(appId2);
|
|
83128
|
+
return targetCodeListMap == null ? void 0 : targetCodeListMap.get(id);
|
|
83129
|
+
}
|
|
80240
83130
|
/**
|
|
80241
83131
|
* 新建 hub 应用
|
|
80242
83132
|
*
|
|
@@ -80384,6 +83274,16 @@ var AppHub = class {
|
|
|
80384
83274
|
app.destroy();
|
|
80385
83275
|
});
|
|
80386
83276
|
}
|
|
83277
|
+
/**
|
|
83278
|
+
* 合并子应用代码表
|
|
83279
|
+
* @param codeList
|
|
83280
|
+
*/
|
|
83281
|
+
mergeSubAppCodeList(codeList) {
|
|
83282
|
+
if (!this.modelLoaderProvider) {
|
|
83283
|
+
throw new RuntimeError72(ibiz.i18n.t("runtime.utils.firstregister"));
|
|
83284
|
+
}
|
|
83285
|
+
this.modelLoaderProvider.mergeSubAppCodeList(codeList);
|
|
83286
|
+
}
|
|
80387
83287
|
};
|
|
80388
83288
|
|
|
80389
83289
|
// src/engine/engine-factory.ts
|
|
@@ -81032,7 +83932,7 @@ var ViewEngineBase = class {
|
|
|
81032
83932
|
|
|
81033
83933
|
// src/engine/md-view.engine.ts
|
|
81034
83934
|
import { RuntimeModelError as RuntimeModelError74 } from "@ibiz-template/core";
|
|
81035
|
-
import { clone as
|
|
83935
|
+
import { clone as clone60 } from "ramda";
|
|
81036
83936
|
var MDViewEngine = class extends ViewEngineBase {
|
|
81037
83937
|
/**
|
|
81038
83938
|
* 多数据部件名称
|
|
@@ -81320,7 +84220,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
81320
84220
|
ibiz.i18n.t("runtime.engine.logicNewdata")
|
|
81321
84221
|
);
|
|
81322
84222
|
}
|
|
81323
|
-
const params =
|
|
84223
|
+
const params = clone60(this.view.params);
|
|
81324
84224
|
if (copyMode) {
|
|
81325
84225
|
params.srfcopymode = copyMode;
|
|
81326
84226
|
}
|
|
@@ -84823,11 +87723,14 @@ export {
|
|
|
84823
87723
|
AppMenuController,
|
|
84824
87724
|
AppMenuIconViewController,
|
|
84825
87725
|
Application,
|
|
87726
|
+
AreaConverter,
|
|
84826
87727
|
AreaSeriesGenerator,
|
|
84827
87728
|
AsyncActionService,
|
|
84828
87729
|
AuthorityService,
|
|
87730
|
+
BIReportPanelGenerator,
|
|
84829
87731
|
BIReportUtil,
|
|
84830
87732
|
BackendUIActionProvider,
|
|
87733
|
+
BarConverterBase,
|
|
84831
87734
|
BarSeriesGenerator,
|
|
84832
87735
|
BaseController,
|
|
84833
87736
|
BaseSeriesGenerator,
|
|
@@ -84863,8 +87766,10 @@ export {
|
|
|
84863
87766
|
ControlType,
|
|
84864
87767
|
ControlVO,
|
|
84865
87768
|
ControllerEvent,
|
|
87769
|
+
ConverterBase,
|
|
84866
87770
|
Counter,
|
|
84867
87771
|
CounterService,
|
|
87772
|
+
CrossTableConverter,
|
|
84868
87773
|
CustomAppMenuController,
|
|
84869
87774
|
CustomDashboardController,
|
|
84870
87775
|
DEActionMethod,
|
|
@@ -84935,9 +87840,12 @@ export {
|
|
|
84935
87840
|
GanttNodeLinkData,
|
|
84936
87841
|
GanttService,
|
|
84937
87842
|
GanttStaticNodeData,
|
|
87843
|
+
GaugeConverter,
|
|
84938
87844
|
GaugeSeriesGenerator,
|
|
84939
87845
|
GridColumnController,
|
|
84940
87846
|
GridController,
|
|
87847
|
+
GridConverter,
|
|
87848
|
+
GridConverterBase,
|
|
84941
87849
|
GridFieldColumnController,
|
|
84942
87850
|
GridFieldEditColumnController,
|
|
84943
87851
|
GridGroupColumnController,
|
|
@@ -84984,6 +87892,11 @@ export {
|
|
|
84984
87892
|
MobViewController,
|
|
84985
87893
|
Modal,
|
|
84986
87894
|
MqttService,
|
|
87895
|
+
MultiSeriesBarConverter,
|
|
87896
|
+
MultiSeriesColConverter,
|
|
87897
|
+
MultiSeriesConverter,
|
|
87898
|
+
MultiSeriesLineConverter,
|
|
87899
|
+
NumberConverter,
|
|
84987
87900
|
OpenAppViewCommand,
|
|
84988
87901
|
PANELITEM_PROVIDER_PREFIX,
|
|
84989
87902
|
PLATFORM_PROVIDER_PREFIX,
|
|
@@ -84998,6 +87911,7 @@ export {
|
|
|
84998
87911
|
PanelItemState,
|
|
84999
87912
|
PanelNotifyState,
|
|
85000
87913
|
PickupViewPanelController,
|
|
87914
|
+
PieConverter,
|
|
85001
87915
|
PieSeriesGenerator,
|
|
85002
87916
|
PlatformProviderBase,
|
|
85003
87917
|
PlatformType,
|
|
@@ -85007,16 +87921,19 @@ export {
|
|
|
85007
87921
|
PredefinedControlRender,
|
|
85008
87922
|
PresetIdentifier,
|
|
85009
87923
|
QXEventEx,
|
|
87924
|
+
RadarConverter,
|
|
85010
87925
|
RadarSeriesGenerator,
|
|
85011
87926
|
RawItemPortletController,
|
|
85012
87927
|
RawValueUtil,
|
|
85013
87928
|
RecordNavUtil,
|
|
85014
87929
|
RegisterCenter,
|
|
85015
87930
|
RemotePluginItem,
|
|
87931
|
+
ReportPanelBaseGenerator,
|
|
85016
87932
|
ReportPanelController,
|
|
85017
87933
|
ReportPanelService,
|
|
85018
87934
|
ReportPortletController,
|
|
85019
87935
|
RouteConst,
|
|
87936
|
+
ScatterConverter,
|
|
85020
87937
|
ScatterSeriesGenerator,
|
|
85021
87938
|
ScriptFactory,
|
|
85022
87939
|
ScriptFunction,
|
|
@@ -85030,6 +87947,8 @@ export {
|
|
|
85030
87947
|
SearchFormService,
|
|
85031
87948
|
ShortCutUtil,
|
|
85032
87949
|
Srfuf,
|
|
87950
|
+
StackBarConverter,
|
|
87951
|
+
StackColConverter,
|
|
85033
87952
|
StudioControlEvents,
|
|
85034
87953
|
StudioPanelEvents,
|
|
85035
87954
|
StudioViewEvents,
|
|
@@ -85067,6 +87986,8 @@ export {
|
|
|
85067
87986
|
UIDomainManager,
|
|
85068
87987
|
UILOGINNODE_PROVIDER_PREFIX,
|
|
85069
87988
|
UIMapField,
|
|
87989
|
+
User2ReportPanelGenerator,
|
|
87990
|
+
UserReportPanelGenerator,
|
|
85070
87991
|
UtilService,
|
|
85071
87992
|
V7AuthService,
|
|
85072
87993
|
VIEW_MSG_PREFIX,
|
|
@@ -85092,6 +88013,9 @@ export {
|
|
|
85092
88013
|
WizardPanelController,
|
|
85093
88014
|
WizardPanelService,
|
|
85094
88015
|
WorkFlowService,
|
|
88016
|
+
ZoneColConverter,
|
|
88017
|
+
ZoneConverterBase,
|
|
88018
|
+
ZoneLineConverter,
|
|
85095
88019
|
asyncImportData,
|
|
85096
88020
|
asyncImportData2,
|
|
85097
88021
|
calcContentAlignStyle,
|