@ibiz-template/runtime 0.7.41-alpha.30 → 0.7.41-alpha.31
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 +2979 -155
- package/dist/index.system.min.js +1 -1
- 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 +31 -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 +163 -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 +125 -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 +332 -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 +174 -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/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/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 +2 -2
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";
|
|
@@ -56492,6 +56492,7 @@ var EditFormController = class extends FormController {
|
|
|
56492
56492
|
}
|
|
56493
56493
|
res.data.srfkey = void 0;
|
|
56494
56494
|
res.data.tempsrfkey = createUUID16();
|
|
56495
|
+
res.data.srfuf = 0 /* CREATE */;
|
|
56495
56496
|
this.state.modified = false;
|
|
56496
56497
|
this.state.data = res.data;
|
|
56497
56498
|
this.changeTracker.reset(this.data.clone());
|
|
@@ -67744,18 +67745,20 @@ var MapController = class extends MDControlController {
|
|
|
67744
67745
|
// src/controller/control/report-panel/report-panel.service.ts
|
|
67745
67746
|
var ReportPanelService = class extends ControlService {
|
|
67746
67747
|
/**
|
|
67747
|
-
*
|
|
67748
|
-
*
|
|
67748
|
+
* @description 查询报表数据
|
|
67749
|
+
* @param {string} reportTag 报表标识
|
|
67750
|
+
* @param {string} appDataEntityId 报表实体标识
|
|
67749
67751
|
* @param {IContext} context 上下文
|
|
67750
67752
|
* @param {IParams} [params={}] 视图参数
|
|
67751
|
-
* @returns {*} {Promise<IHttpResponse
|
|
67753
|
+
* @returns {*} {Promise<IHttpResponse<ControlVO[]>>}
|
|
67754
|
+
* @memberof ReportPanelService
|
|
67752
67755
|
*/
|
|
67753
|
-
async fetch(context, params = {}) {
|
|
67754
|
-
|
|
67755
|
-
|
|
67756
|
+
async fetch(reportTag, appDataEntityId, context, params = {}) {
|
|
67757
|
+
const dataEntity = await ibiz.hub.getAppDataEntity(
|
|
67758
|
+
appDataEntityId,
|
|
67756
67759
|
this.model.appId
|
|
67757
67760
|
);
|
|
67758
|
-
const url = "".concat(
|
|
67761
|
+
const url = "".concat(dataEntity.deapicodeName2, "/report?srfreporttag=").concat(reportTag);
|
|
67759
67762
|
let res = await ibiz.net.request(url, {
|
|
67760
67763
|
method: "post",
|
|
67761
67764
|
data: params
|
|
@@ -67810,6 +67813,15 @@ var ReportPanelBaseGenerator = class {
|
|
|
67810
67813
|
load(data = {}) {
|
|
67811
67814
|
return Promise.resolve(data);
|
|
67812
67815
|
}
|
|
67816
|
+
/**
|
|
67817
|
+
* @description 生成
|
|
67818
|
+
* @param {IData[]} _items
|
|
67819
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
67820
|
+
* @memberof ReportPanelBaseGenerator
|
|
67821
|
+
*/
|
|
67822
|
+
generate(_items) {
|
|
67823
|
+
return void 0;
|
|
67824
|
+
}
|
|
67813
67825
|
};
|
|
67814
67826
|
|
|
67815
67827
|
// src/controller/control/report-panel/generator/user-generator.ts
|
|
@@ -67877,14 +67889,2723 @@ var UserReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
|
67877
67889
|
var User2ReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
67878
67890
|
};
|
|
67879
67891
|
|
|
67880
|
-
// src/controller/control/report-panel/generator/bi-
|
|
67881
|
-
var
|
|
67892
|
+
// src/controller/control/report-panel/generator/bi-converter/base/converter-base.ts
|
|
67893
|
+
var ConverterBase = class {
|
|
67882
67894
|
/**
|
|
67883
|
-
*
|
|
67895
|
+
* Creates an instance of ConverterBase.
|
|
67896
|
+
* @param {IAppBIReport} appBIReport 智能报表模型
|
|
67897
|
+
* @param {IContext} context 上下文
|
|
67898
|
+
* @param {IParams} params 视图参数
|
|
67899
|
+
* @memberof ConverterBase
|
|
67900
|
+
*/
|
|
67901
|
+
constructor(appBIReport, context, params) {
|
|
67902
|
+
this.appBIReport = appBIReport;
|
|
67903
|
+
this.context = context;
|
|
67904
|
+
this.params = params;
|
|
67905
|
+
/**
|
|
67906
|
+
* @description 仿真模型
|
|
67907
|
+
* @type {IModel}
|
|
67908
|
+
* @memberof ConverterBase
|
|
67909
|
+
*/
|
|
67910
|
+
this.mockModel = {};
|
|
67911
|
+
/**
|
|
67912
|
+
* @description 报表前端模型(原始模型)
|
|
67913
|
+
* @type {IData}
|
|
67914
|
+
* @memberof ConverterBase
|
|
67915
|
+
*/
|
|
67916
|
+
this.reportUIModel = {};
|
|
67917
|
+
/**
|
|
67918
|
+
* @description 指标模型集合
|
|
67919
|
+
* @type {IAppBIReportMeasure[]}
|
|
67920
|
+
* @memberof ConverterBase
|
|
67921
|
+
*/
|
|
67922
|
+
this.measures = [];
|
|
67923
|
+
/**
|
|
67924
|
+
* @description 维度模型集合
|
|
67925
|
+
* @type {IAppBIReportDimension[]}
|
|
67926
|
+
* @memberof ConverterBase
|
|
67927
|
+
*/
|
|
67928
|
+
this.dimensions = [];
|
|
67929
|
+
}
|
|
67930
|
+
/**
|
|
67931
|
+
* @description 初始化
|
|
67932
|
+
* @memberof ConverterBase
|
|
67933
|
+
*/
|
|
67934
|
+
async init() {
|
|
67935
|
+
try {
|
|
67936
|
+
const { reportUIModel, appBIReportMeasures, appBIReportDimensions } = this.appBIReport;
|
|
67937
|
+
this.reportUIModel = reportUIModel ? JSON.parse(reportUIModel) : void 0;
|
|
67938
|
+
this.measures = appBIReportMeasures || [];
|
|
67939
|
+
this.dimensions = (appBIReportDimensions == null ? void 0 : appBIReportDimensions.filter(
|
|
67940
|
+
(dimension) => dimension.dimensionTag !== this.reportUIModel.group_tags
|
|
67941
|
+
)) || [];
|
|
67942
|
+
this.groupDimension = appBIReportDimensions == null ? void 0 : appBIReportDimensions.find(
|
|
67943
|
+
(dimension) => dimension.dimensionTag === this.reportUIModel.group_tags
|
|
67944
|
+
);
|
|
67945
|
+
await this.onInit();
|
|
67946
|
+
} catch (error) {
|
|
67947
|
+
ibiz.log.error(error);
|
|
67948
|
+
}
|
|
67949
|
+
}
|
|
67950
|
+
/**
|
|
67951
|
+
* @description 初始化-子类重写
|
|
67952
|
+
* @protected
|
|
67953
|
+
* @returns {*} {Promise<void>}
|
|
67954
|
+
* @memberof ConverterBase
|
|
67955
|
+
*/
|
|
67956
|
+
async onInit() {
|
|
67957
|
+
}
|
|
67958
|
+
/**
|
|
67959
|
+
* @description 转化数据到报表
|
|
67960
|
+
* @param {IData[]} _items
|
|
67961
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
67962
|
+
* @memberof ConverterBase
|
|
67963
|
+
*/
|
|
67964
|
+
translateDataToReport(_items) {
|
|
67965
|
+
return void 0;
|
|
67966
|
+
}
|
|
67967
|
+
};
|
|
67968
|
+
|
|
67969
|
+
// src/controller/control/report-panel/generator/bi-converter/number-converter.ts
|
|
67970
|
+
var NumberConverter = class extends ConverterBase {
|
|
67971
|
+
/**
|
|
67972
|
+
* @description 转化数据到报表
|
|
67973
|
+
* @param {IData[]} items
|
|
67974
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
67975
|
+
* @memberof NumberConverter
|
|
67976
|
+
*/
|
|
67977
|
+
translateDataToReport(items) {
|
|
67978
|
+
const {
|
|
67979
|
+
period,
|
|
67980
|
+
chart_type,
|
|
67981
|
+
number_fontsize,
|
|
67982
|
+
number_yoy_show,
|
|
67983
|
+
number_qoq_show,
|
|
67984
|
+
number_fontcolor,
|
|
67985
|
+
number_yoy_value,
|
|
67986
|
+
number_qoq_value,
|
|
67987
|
+
number_fontstyle
|
|
67988
|
+
} = this.reportUIModel;
|
|
67989
|
+
const model = {
|
|
67990
|
+
period,
|
|
67991
|
+
chart_type,
|
|
67992
|
+
number_fontsize,
|
|
67993
|
+
number_yoy_show,
|
|
67994
|
+
number_qoq_show,
|
|
67995
|
+
number_fontcolor,
|
|
67996
|
+
number_yoy_value,
|
|
67997
|
+
number_qoq_value,
|
|
67998
|
+
number_fontstyle,
|
|
67999
|
+
measure: this.measures[0]
|
|
68000
|
+
};
|
|
68001
|
+
return { model, options: {}, data: items };
|
|
68002
|
+
}
|
|
68003
|
+
};
|
|
68004
|
+
|
|
68005
|
+
// src/controller/control/report-panel/generator/bi-converter/utils/chart-util.ts
|
|
68006
|
+
var ChartUtil = class {
|
|
68007
|
+
/**
|
|
68008
|
+
* @description x轴标签标题
|
|
68009
|
+
* @static
|
|
68010
|
+
* @returns {*}
|
|
68011
|
+
* @memberof ChartUtil
|
|
68012
|
+
*/
|
|
68013
|
+
static xAxisLabel() {
|
|
68014
|
+
const options = {};
|
|
68015
|
+
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 }";
|
|
68016
|
+
return options;
|
|
68017
|
+
}
|
|
68018
|
+
/**
|
|
68019
|
+
* @description 使用间隔的时候加上省略限制
|
|
68020
|
+
* @static
|
|
68021
|
+
* @param {number} [labelInterval=1]
|
|
68022
|
+
* @returns {*}
|
|
68023
|
+
* @memberof ChartUtil
|
|
68024
|
+
*/
|
|
68025
|
+
static computeLabelEllipsis(labelInterval = 1) {
|
|
68026
|
+
return {
|
|
68027
|
+
width: 60 * (labelInterval > 0 ? labelInterval : 1),
|
|
68028
|
+
overflow: "truncate",
|
|
68029
|
+
ellipsis: "..."
|
|
68030
|
+
};
|
|
68031
|
+
}
|
|
68032
|
+
/**
|
|
68033
|
+
* @description 获取图例位置
|
|
68034
|
+
* @static
|
|
68035
|
+
* @param {string} position
|
|
68036
|
+
* @returns {*} {IData}
|
|
68037
|
+
* @memberof ChartUtil
|
|
68038
|
+
*/
|
|
68039
|
+
static getLegendPosition(position) {
|
|
68040
|
+
const legendGap = 20;
|
|
68041
|
+
const options = {
|
|
68042
|
+
type: "scroll"
|
|
68043
|
+
};
|
|
68044
|
+
if (position === "left" || position === "right") {
|
|
68045
|
+
options.orient = "vertical";
|
|
68046
|
+
options[position] = legendGap;
|
|
68047
|
+
options.top = "middle";
|
|
68048
|
+
}
|
|
68049
|
+
if (position === "top" || position === "bottom") {
|
|
68050
|
+
options.left = "center";
|
|
68051
|
+
options.top = position;
|
|
68052
|
+
}
|
|
68053
|
+
if (position === "left-top") {
|
|
68054
|
+
options.left = legendGap;
|
|
68055
|
+
options.top = "top";
|
|
68056
|
+
}
|
|
68057
|
+
if (position === "right-top") {
|
|
68058
|
+
options.right = legendGap;
|
|
68059
|
+
options.top = "top";
|
|
68060
|
+
}
|
|
68061
|
+
if (position === "left-bottom") {
|
|
68062
|
+
options.left = legendGap;
|
|
68063
|
+
options.top = "bottom";
|
|
68064
|
+
}
|
|
68065
|
+
if (position === "right-bottom") {
|
|
68066
|
+
options.right = legendGap;
|
|
68067
|
+
options.top = "bottom";
|
|
68068
|
+
}
|
|
68069
|
+
return options;
|
|
68070
|
+
}
|
|
68071
|
+
};
|
|
68072
|
+
|
|
68073
|
+
// src/controller/control/report-panel/generator/bi-converter/base/echart-converter-base.ts
|
|
68074
|
+
import { clone as clone50 } from "ramda";
|
|
68075
|
+
var EchartConverterBase = class extends ConverterBase {
|
|
68076
|
+
constructor() {
|
|
68077
|
+
super(...arguments);
|
|
68078
|
+
/**
|
|
68079
|
+
* @description 仿真序列模型
|
|
68080
|
+
* @type {IModel}
|
|
68081
|
+
* @memberof EchartConverterBase
|
|
68082
|
+
*/
|
|
68083
|
+
this.mockSerieModel = {};
|
|
68084
|
+
}
|
|
68085
|
+
/**
|
|
68086
|
+
* @description 获取图表颜色参数
|
|
68087
|
+
* @returns {*} {IData}
|
|
68088
|
+
* @memberof EchartConverterBase
|
|
68089
|
+
*/
|
|
68090
|
+
getChartColorParams() {
|
|
68091
|
+
const params = {};
|
|
68092
|
+
const { chart_color } = this.reportUIModel;
|
|
68093
|
+
if (chart_color)
|
|
68094
|
+
params["EC.color"] = JSON.stringify(chart_color);
|
|
68095
|
+
return params;
|
|
68096
|
+
}
|
|
68097
|
+
/**
|
|
68098
|
+
* @description 获取图表X轴参数
|
|
68099
|
+
* @returns {*} {IData}
|
|
68100
|
+
* @memberof EchartConverterBase
|
|
68101
|
+
*/
|
|
68102
|
+
getChartXAxisParams() {
|
|
68103
|
+
const {
|
|
68104
|
+
xaxis_name,
|
|
68105
|
+
xaxis_nametextstyle_fontstyle,
|
|
68106
|
+
xaxis_nametextstyle_fontsize,
|
|
68107
|
+
xaxis_nametextstyle_fontcolor,
|
|
68108
|
+
xaxis_axislabel_show,
|
|
68109
|
+
xaxis_axislabel_fontstyle,
|
|
68110
|
+
xaxis_axislabel_fontsize,
|
|
68111
|
+
xaxis_axislabel_fontcolor,
|
|
68112
|
+
xaxis_axisline_show,
|
|
68113
|
+
xaxis_axisline_linestyle_type,
|
|
68114
|
+
xaxis_axisline_linestyle_width,
|
|
68115
|
+
xaxis_axisline_linestyle_color,
|
|
68116
|
+
xaxis_splitline_show,
|
|
68117
|
+
xaxis_splitline_linestyle_type,
|
|
68118
|
+
xaxis_splitline_linestyle_width,
|
|
68119
|
+
xaxis_splitline_linestyle_color,
|
|
68120
|
+
xaxis_axislabel_interval
|
|
68121
|
+
} = this.reportUIModel;
|
|
68122
|
+
let tempName = "";
|
|
68123
|
+
if (xaxis_name == "1") {
|
|
68124
|
+
tempName = void 0;
|
|
68125
|
+
}
|
|
68126
|
+
const options = {
|
|
68127
|
+
show: true,
|
|
68128
|
+
showTitle: xaxis_name == "1",
|
|
68129
|
+
// 分层时,模板需要根据这个字段计算对应的标题
|
|
68130
|
+
type: "category",
|
|
68131
|
+
name: tempName,
|
|
68132
|
+
// 显示轴标题
|
|
68133
|
+
minorSplitLine: {
|
|
68134
|
+
show: false
|
|
68135
|
+
}
|
|
68136
|
+
};
|
|
68137
|
+
const nameTextStyle = {};
|
|
68138
|
+
if (xaxis_nametextstyle_fontstyle) {
|
|
68139
|
+
xaxis_nametextstyle_fontstyle === "bold" ? nameTextStyle.fontWeight = xaxis_nametextstyle_fontstyle : nameTextStyle.fontStyle = xaxis_nametextstyle_fontstyle;
|
|
68140
|
+
}
|
|
68141
|
+
if (xaxis_nametextstyle_fontsize) {
|
|
68142
|
+
nameTextStyle.fontSize = xaxis_nametextstyle_fontsize;
|
|
68143
|
+
}
|
|
68144
|
+
if (xaxis_nametextstyle_fontcolor) {
|
|
68145
|
+
nameTextStyle.color = xaxis_nametextstyle_fontcolor;
|
|
68146
|
+
}
|
|
68147
|
+
options.nameTextStyle = nameTextStyle;
|
|
68148
|
+
const axisLabel = {
|
|
68149
|
+
show: xaxis_axislabel_show == "1",
|
|
68150
|
+
interval: xaxis_axislabel_interval || "auto",
|
|
68151
|
+
...ChartUtil.xAxisLabel(),
|
|
68152
|
+
...ChartUtil.computeLabelEllipsis(xaxis_axislabel_interval)
|
|
68153
|
+
};
|
|
68154
|
+
if (xaxis_axislabel_fontstyle) {
|
|
68155
|
+
xaxis_axislabel_fontstyle === "bold" ? axisLabel.fontWeight = xaxis_axislabel_fontstyle : axisLabel.fontStyle = xaxis_axislabel_fontstyle;
|
|
68156
|
+
}
|
|
68157
|
+
if (xaxis_axislabel_fontsize) {
|
|
68158
|
+
axisLabel.fontSize = xaxis_axislabel_fontsize;
|
|
68159
|
+
}
|
|
68160
|
+
if (xaxis_axislabel_fontcolor) {
|
|
68161
|
+
axisLabel.color = xaxis_axislabel_fontcolor;
|
|
68162
|
+
}
|
|
68163
|
+
options.axisLabel = axisLabel;
|
|
68164
|
+
const axisLine = {
|
|
68165
|
+
show: xaxis_axisline_show == "1",
|
|
68166
|
+
lineStyle: {
|
|
68167
|
+
type: xaxis_axisline_linestyle_type === "doubleDashed" ? [15] : xaxis_axisline_linestyle_type,
|
|
68168
|
+
width: xaxis_axisline_linestyle_width,
|
|
68169
|
+
color: xaxis_axisline_linestyle_color
|
|
68170
|
+
// 轴线颜色
|
|
68171
|
+
}
|
|
68172
|
+
};
|
|
68173
|
+
options.axisLine = axisLine;
|
|
68174
|
+
const splitLine = {
|
|
68175
|
+
show: xaxis_splitline_show == "1",
|
|
68176
|
+
lineStyle: {
|
|
68177
|
+
type: xaxis_splitline_linestyle_type === "doubleDashed" ? [15] : xaxis_splitline_linestyle_type,
|
|
68178
|
+
width: xaxis_splitline_linestyle_width,
|
|
68179
|
+
color: xaxis_splitline_linestyle_color
|
|
68180
|
+
// 轴线颜色
|
|
68181
|
+
}
|
|
68182
|
+
};
|
|
68183
|
+
options.splitLine = splitLine;
|
|
68184
|
+
return { "EC.xAxis": JSON.stringify(options) };
|
|
68185
|
+
}
|
|
68186
|
+
/**
|
|
68187
|
+
* @description 获取图表Y轴参数
|
|
68188
|
+
* @returns {*} {IData}
|
|
68189
|
+
* @memberof EchartConverterBase
|
|
68190
|
+
*/
|
|
68191
|
+
getChartYAxisParams() {
|
|
68192
|
+
const {
|
|
68193
|
+
yaxis_name,
|
|
68194
|
+
yaxis_nametextstyle_fontstyle,
|
|
68195
|
+
yaxis_nametextstyle_fontsize,
|
|
68196
|
+
yaxis_nametextstyle_fontcolor,
|
|
68197
|
+
yaxis_axislabel_show,
|
|
68198
|
+
yaxis_axislabel_fontstyle,
|
|
68199
|
+
yaxis_axislabel_fontsize,
|
|
68200
|
+
yaxis_axislabel_fontcolor,
|
|
68201
|
+
yaxis_axisline_show,
|
|
68202
|
+
yaxis_axisline_linestyle_type,
|
|
68203
|
+
yaxis_axisline_linestyle_width,
|
|
68204
|
+
yaxis_axisline_linestyle_color,
|
|
68205
|
+
yaxis_splitline_show,
|
|
68206
|
+
yaxis_splitline_linestyle_type,
|
|
68207
|
+
yaxis_splitline_linestyle_width,
|
|
68208
|
+
yaxis_splitline_linestyle_color
|
|
68209
|
+
} = this.reportUIModel;
|
|
68210
|
+
const options = {
|
|
68211
|
+
show: true,
|
|
68212
|
+
type: "value",
|
|
68213
|
+
showTitle: yaxis_name == "1",
|
|
68214
|
+
minorSplitLine: {
|
|
68215
|
+
show: false
|
|
68216
|
+
}
|
|
68217
|
+
};
|
|
68218
|
+
const nameTextStyle = {};
|
|
68219
|
+
yaxis_nametextstyle_fontstyle === "bold" ? nameTextStyle.fontWeight = yaxis_nametextstyle_fontstyle : nameTextStyle.fontStyle = yaxis_nametextstyle_fontstyle;
|
|
68220
|
+
if (yaxis_nametextstyle_fontsize) {
|
|
68221
|
+
nameTextStyle.fontSize = yaxis_nametextstyle_fontsize;
|
|
68222
|
+
}
|
|
68223
|
+
if (yaxis_nametextstyle_fontcolor) {
|
|
68224
|
+
nameTextStyle.color = yaxis_nametextstyle_fontcolor;
|
|
68225
|
+
}
|
|
68226
|
+
options.nameTextStyle = nameTextStyle;
|
|
68227
|
+
const axisLabel = {
|
|
68228
|
+
show: yaxis_axislabel_show == "1"
|
|
68229
|
+
};
|
|
68230
|
+
if (yaxis_axislabel_fontstyle) {
|
|
68231
|
+
yaxis_axislabel_fontstyle === "bold" ? axisLabel.fontWeight = yaxis_axislabel_fontstyle : axisLabel.fontStyle = yaxis_axislabel_fontstyle;
|
|
68232
|
+
}
|
|
68233
|
+
if (yaxis_axislabel_fontsize) {
|
|
68234
|
+
axisLabel.fontSize = yaxis_axislabel_fontsize;
|
|
68235
|
+
}
|
|
68236
|
+
if (yaxis_axislabel_fontcolor) {
|
|
68237
|
+
axisLabel.color = yaxis_axislabel_fontcolor;
|
|
68238
|
+
}
|
|
68239
|
+
options.axisLabel = axisLabel;
|
|
68240
|
+
const axisLine = {
|
|
68241
|
+
show: yaxis_axisline_show == "1",
|
|
68242
|
+
lineStyle: {
|
|
68243
|
+
type: yaxis_axisline_linestyle_type === "doubleDashed" ? [15] : yaxis_axisline_linestyle_type,
|
|
68244
|
+
width: yaxis_axisline_linestyle_width,
|
|
68245
|
+
color: yaxis_axisline_linestyle_color
|
|
68246
|
+
}
|
|
68247
|
+
};
|
|
68248
|
+
options.axisLine = axisLine;
|
|
68249
|
+
const splitLine = {
|
|
68250
|
+
show: yaxis_splitline_show == "1",
|
|
68251
|
+
lineStyle: {
|
|
68252
|
+
type: yaxis_splitline_linestyle_type === "doubleDashed" ? [15] : yaxis_splitline_linestyle_type,
|
|
68253
|
+
width: yaxis_splitline_linestyle_width,
|
|
68254
|
+
color: yaxis_splitline_linestyle_color
|
|
68255
|
+
// 轴线颜色
|
|
68256
|
+
}
|
|
68257
|
+
};
|
|
68258
|
+
options.splitLine = splitLine;
|
|
68259
|
+
return { "EC.yAxis": JSON.stringify(options) };
|
|
68260
|
+
}
|
|
68261
|
+
/**
|
|
68262
|
+
* @description 计算最大值最小值
|
|
68263
|
+
* @param {IModel} seriesModel
|
|
68264
|
+
* @param {IData[]} items
|
|
68265
|
+
* @returns {*} {{ max: number; min: number }}
|
|
68266
|
+
* @memberof EchartConverterBase
|
|
68267
|
+
*/
|
|
68268
|
+
calcMaxMin(seriesModel, items) {
|
|
68269
|
+
const { valueField, catalogField, seriesField } = seriesModel;
|
|
68270
|
+
const catalogFields = this.dimensions.map(
|
|
68271
|
+
(d) => d.dimensionTag.toLowerCase()
|
|
68272
|
+
);
|
|
68273
|
+
const count = items.reduce((acc, item) => {
|
|
68274
|
+
let catalogName = "";
|
|
68275
|
+
if (catalogFields.length) {
|
|
68276
|
+
catalogFields.forEach((key) => {
|
|
68277
|
+
catalogName += item[key];
|
|
68278
|
+
});
|
|
68279
|
+
} else {
|
|
68280
|
+
catalogName = item[catalogField];
|
|
68281
|
+
}
|
|
68282
|
+
const name2 = seriesField ? "".concat(item[seriesField], "_").concat(catalogName) : "".concat(catalogName);
|
|
68283
|
+
const value = item[valueField];
|
|
68284
|
+
if (!acc[name2]) {
|
|
68285
|
+
acc[name2] = {
|
|
68286
|
+
sum: 0,
|
|
68287
|
+
max: -Infinity,
|
|
68288
|
+
// 初始化为极小值
|
|
68289
|
+
min: Infinity
|
|
68290
|
+
// 初始化为极大值
|
|
68291
|
+
};
|
|
68292
|
+
}
|
|
68293
|
+
acc[name2].sum += value;
|
|
68294
|
+
acc[name2].max = Math.max(acc[name2].max, value);
|
|
68295
|
+
acc[name2].min = Math.min(acc[name2].min, value);
|
|
68296
|
+
return acc;
|
|
68297
|
+
}, {});
|
|
68298
|
+
const allSums = Object.values(count).map((item) => item.sum);
|
|
68299
|
+
const max2 = Math.max(...allSums);
|
|
68300
|
+
const min = Math.min(...allSums);
|
|
68301
|
+
return { max: max2, min };
|
|
68302
|
+
}
|
|
68303
|
+
/**
|
|
68304
|
+
* @description 获取标签参数
|
|
68305
|
+
* @param {IModel} seriesModel
|
|
68306
|
+
* @param {IData[]} items
|
|
68307
|
+
* @returns {*} {IData}
|
|
68308
|
+
* @memberof EchartConverterBase
|
|
68309
|
+
*/
|
|
68310
|
+
getChartLabelParams(seriesModel, items) {
|
|
68311
|
+
const {
|
|
68312
|
+
series_label_show,
|
|
68313
|
+
series_label_position,
|
|
68314
|
+
series_label_fontsize,
|
|
68315
|
+
series_label_fontstyle,
|
|
68316
|
+
series_label_fontcolor,
|
|
68317
|
+
series_label_data_range
|
|
68318
|
+
} = this.reportUIModel;
|
|
68319
|
+
const options = {
|
|
68320
|
+
show: series_label_show == "1",
|
|
68321
|
+
position: series_label_position
|
|
68322
|
+
};
|
|
68323
|
+
if (series_label_fontstyle) {
|
|
68324
|
+
series_label_fontstyle === "bold" ? options.fontWeight = series_label_fontstyle : options.fontStyle = series_label_fontstyle;
|
|
68325
|
+
}
|
|
68326
|
+
if (series_label_fontsize) {
|
|
68327
|
+
options.fontSize = Number(series_label_fontsize);
|
|
68328
|
+
}
|
|
68329
|
+
if (series_label_fontcolor) {
|
|
68330
|
+
options.color = series_label_fontcolor;
|
|
68331
|
+
}
|
|
68332
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
68333
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
68334
|
+
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 }");
|
|
68335
|
+
}
|
|
68336
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
68337
|
+
options.formatter = "function(param) {\n return param.value[1];\n }";
|
|
68338
|
+
}
|
|
68339
|
+
return { "EC.label": JSON.stringify(options) };
|
|
68340
|
+
}
|
|
68341
|
+
/**
|
|
68342
|
+
* @description 获取图例参数
|
|
68343
|
+
* @returns {*} {IData}
|
|
68344
|
+
* @memberof EchartConverterBase
|
|
68345
|
+
*/
|
|
68346
|
+
getChartLegendParams() {
|
|
68347
|
+
const {
|
|
68348
|
+
legend_show,
|
|
68349
|
+
legend_fontstyle,
|
|
68350
|
+
legend_fontsize,
|
|
68351
|
+
legend_fontcolor,
|
|
68352
|
+
legend_position
|
|
68353
|
+
} = this.reportUIModel;
|
|
68354
|
+
const options = {
|
|
68355
|
+
show: legend_show == "1",
|
|
68356
|
+
icon: "circle",
|
|
68357
|
+
formatter: "function(param){\n return param;\n }"
|
|
68358
|
+
};
|
|
68359
|
+
const textStyle = {};
|
|
68360
|
+
if (legend_fontstyle) {
|
|
68361
|
+
legend_fontstyle === "bold" ? textStyle.fontWeight = legend_fontstyle : textStyle.fontStyle = legend_fontstyle;
|
|
68362
|
+
}
|
|
68363
|
+
if (legend_fontsize) {
|
|
68364
|
+
textStyle.fontSize = Number(legend_fontsize);
|
|
68365
|
+
}
|
|
68366
|
+
if (legend_fontcolor) {
|
|
68367
|
+
textStyle.color = legend_fontcolor;
|
|
68368
|
+
}
|
|
68369
|
+
options.textStyle = textStyle;
|
|
68370
|
+
if (legend_position) {
|
|
68371
|
+
Object.assign(options, ChartUtil.getLegendPosition(legend_position));
|
|
68372
|
+
}
|
|
68373
|
+
return { "EC.legend": JSON.stringify(options) };
|
|
68374
|
+
}
|
|
68375
|
+
/**
|
|
68376
|
+
* @description 获取控件参数
|
|
68377
|
+
* @returns {*} {IData}
|
|
68378
|
+
* @memberof EchartConverterBase
|
|
68379
|
+
*/
|
|
68380
|
+
getChartControlParams() {
|
|
68381
|
+
const ctrlParams = {};
|
|
68382
|
+
const tempdimensions = this.dimensions.map((item) => {
|
|
68383
|
+
return {
|
|
68384
|
+
mode: "field",
|
|
68385
|
+
name: item.dimensionName,
|
|
68386
|
+
codelistId: item.appCodeListId,
|
|
68387
|
+
codename: item.dimensionTag.toLowerCase()
|
|
68388
|
+
};
|
|
68389
|
+
});
|
|
68390
|
+
Object.assign(ctrlParams, {
|
|
68391
|
+
CATALOGFIELDS: JSON.stringify(tempdimensions),
|
|
68392
|
+
NOSORT: true
|
|
68393
|
+
});
|
|
68394
|
+
return ctrlParams;
|
|
68395
|
+
}
|
|
68396
|
+
/**
|
|
68397
|
+
* @description 获取tooltip参数
|
|
68398
|
+
* @param {IData} series
|
|
68399
|
+
* @param {boolean} [isRow=false]
|
|
68400
|
+
* @returns {*}
|
|
68401
|
+
* @memberof EchartConverterBase
|
|
68402
|
+
*/
|
|
68403
|
+
getTooltipParams(series, isRow = false) {
|
|
68404
|
+
if (!this.groupDimension) {
|
|
68405
|
+
return {
|
|
68406
|
+
"EC.name": series.serieText,
|
|
68407
|
+
"EC.tooltip": JSON.stringify({
|
|
68408
|
+
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 }")
|
|
68409
|
+
})
|
|
68410
|
+
};
|
|
68411
|
+
}
|
|
68412
|
+
const param = {
|
|
68413
|
+
"EC.tooltip": JSON.stringify({
|
|
68414
|
+
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 }")
|
|
68415
|
+
})
|
|
68416
|
+
};
|
|
68417
|
+
return param;
|
|
68418
|
+
}
|
|
68419
|
+
/**
|
|
68420
|
+
* @description 计算序列模型
|
|
68421
|
+
* @param {IAppBIReportMeasure[]} measures 指标
|
|
68422
|
+
* @param {IAppBIReportDimension} dimension 维度
|
|
68423
|
+
* @param {IAppBIReportDimension[]} [groupDimension] 分组维度
|
|
68424
|
+
* @returns {*} {IModel[]}
|
|
68425
|
+
* @memberof EchartConverterBase
|
|
68426
|
+
*/
|
|
68427
|
+
calcSeriesModel(measures, dimension, groupDimension) {
|
|
68428
|
+
const seriesModels = [];
|
|
68429
|
+
measures.forEach((item, index) => {
|
|
68430
|
+
const seriesModel = clone50(this.mockSerieModel);
|
|
68431
|
+
Object.assign(seriesModel, {
|
|
68432
|
+
id: "".concat(seriesModel.seriesType, "_").concat(index),
|
|
68433
|
+
caption: item.measureName,
|
|
68434
|
+
serieText: item.measureName,
|
|
68435
|
+
catalogName: dimension.dimensionName,
|
|
68436
|
+
valueField: item.measureTag.toLowerCase(),
|
|
68437
|
+
catalogCodeListId: dimension.appCodeListId,
|
|
68438
|
+
catalogField: dimension.dimensionTag.toLowerCase()
|
|
68439
|
+
});
|
|
68440
|
+
if (groupDimension)
|
|
68441
|
+
Object.assign(seriesModel, {
|
|
68442
|
+
seriesCodeListId: groupDimension.appCodeListId,
|
|
68443
|
+
seriesField: groupDimension.dimensionTag.toLowerCase()
|
|
68444
|
+
});
|
|
68445
|
+
seriesModels.push(seriesModel);
|
|
68446
|
+
});
|
|
68447
|
+
return seriesModels;
|
|
68448
|
+
}
|
|
68449
|
+
/**
|
|
68450
|
+
* @description 转化数据到模型
|
|
68451
|
+
* @param {IData[]} items
|
|
68452
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
68453
|
+
* @memberof EchartConverterBase
|
|
68454
|
+
*/
|
|
68455
|
+
translateDataToReport(items) {
|
|
68456
|
+
if (!this.measures.length || !this.dimensions.length)
|
|
68457
|
+
return;
|
|
68458
|
+
const model = clone50(this.mockModel);
|
|
68459
|
+
const seriesModels = this.calcSeriesModel(
|
|
68460
|
+
this.measures,
|
|
68461
|
+
this.dimensions[0],
|
|
68462
|
+
this.groupDimension
|
|
68463
|
+
);
|
|
68464
|
+
if (model.dechartSerieses)
|
|
68465
|
+
model.dechartSerieses.push(...seriesModels);
|
|
68466
|
+
return { model, options: {}, data: items };
|
|
68467
|
+
}
|
|
68468
|
+
};
|
|
68469
|
+
|
|
68470
|
+
// src/controller/control/report-panel/generator/bi-converter/base/multi-series-converter.ts
|
|
68471
|
+
var MultiSeriesConverter = class extends EchartConverterBase {
|
|
68472
|
+
/**
|
|
68473
|
+
* @description 转化数据到报表
|
|
68474
|
+
* @param {IData[]} items
|
|
68475
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
68476
|
+
* @memberof MultiSeriesConverter
|
|
68477
|
+
*/
|
|
68478
|
+
translateDataToReport(items) {
|
|
68479
|
+
var _a3;
|
|
68480
|
+
const report = super.translateDataToReport(items);
|
|
68481
|
+
if (!report)
|
|
68482
|
+
return;
|
|
68483
|
+
const { model } = report;
|
|
68484
|
+
const chartColorParams = this.getChartColorParams();
|
|
68485
|
+
Object.assign(model.userParam, chartColorParams);
|
|
68486
|
+
const xAxisParams = this.getChartXAxisParams();
|
|
68487
|
+
Object.assign(model.userParam, xAxisParams);
|
|
68488
|
+
const yAxisParams = this.getChartYAxisParams();
|
|
68489
|
+
Object.assign(model.userParam, yAxisParams);
|
|
68490
|
+
const legendParams = this.getChartLegendParams();
|
|
68491
|
+
Object.assign(model.userParam, legendParams);
|
|
68492
|
+
const controlParams = this.getChartControlParams();
|
|
68493
|
+
Object.assign(model, {
|
|
68494
|
+
controlParam: {
|
|
68495
|
+
ctrlParams: controlParams
|
|
68496
|
+
}
|
|
68497
|
+
});
|
|
68498
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
68499
|
+
Object.assign(series, {
|
|
68500
|
+
userParam: {
|
|
68501
|
+
"EC.barWidth": "50%",
|
|
68502
|
+
"EC.barMaxWidth": "36",
|
|
68503
|
+
...this.getChartLabelParams(series, items),
|
|
68504
|
+
...this.getTooltipParams(series, controlParams.MODE === "ROW")
|
|
68505
|
+
}
|
|
68506
|
+
});
|
|
68507
|
+
});
|
|
68508
|
+
return report;
|
|
68509
|
+
}
|
|
68510
|
+
};
|
|
68511
|
+
|
|
68512
|
+
// src/controller/control/report-panel/generator/bi-converter/base/bar-converter-base.ts
|
|
68513
|
+
var BarConverterBase = class extends MultiSeriesConverter {
|
|
68514
|
+
/**
|
|
68515
|
+
* @description 获取控件参数
|
|
68516
|
+
* @returns {*} {IData}
|
|
68517
|
+
* @memberof BarConverterBase
|
|
68518
|
+
*/
|
|
68519
|
+
getChartControlParams() {
|
|
68520
|
+
const ctrlParams = super.getChartControlParams();
|
|
68521
|
+
Object.assign(ctrlParams, { MODE: "ROW" });
|
|
68522
|
+
return ctrlParams;
|
|
68523
|
+
}
|
|
68524
|
+
/**
|
|
68525
|
+
* @description 计算X轴参数
|
|
68526
|
+
* @returns {*} {IData}
|
|
68527
|
+
* @memberof BarConverterBase
|
|
68528
|
+
*/
|
|
68529
|
+
getChartXAxisParams() {
|
|
68530
|
+
const option = super.getChartXAxisParams();
|
|
68531
|
+
const tempOption = JSON.parse(option["EC.xAxis"]);
|
|
68532
|
+
Object.assign(tempOption, {
|
|
68533
|
+
type: "value",
|
|
68534
|
+
nameLocation: "center"
|
|
68535
|
+
});
|
|
68536
|
+
Object.assign(tempOption.nameTextStyle, {
|
|
68537
|
+
lineHeight: 60
|
|
68538
|
+
});
|
|
68539
|
+
tempOption.axisLabel.formatter = null;
|
|
68540
|
+
return { "EC.xAxis": JSON.stringify(tempOption) };
|
|
68541
|
+
}
|
|
68542
|
+
/**
|
|
68543
|
+
* @description 计算Y轴参数
|
|
68544
|
+
* @returns {*} {IData}
|
|
68545
|
+
* @memberof BarConverterBase
|
|
68546
|
+
*/
|
|
68547
|
+
getChartYAxisParams() {
|
|
68548
|
+
const { yaxis_name } = this.reportUIModel;
|
|
68549
|
+
const option = super.getChartYAxisParams();
|
|
68550
|
+
const tempOption = JSON.parse(option["EC.yAxis"]);
|
|
68551
|
+
let tempName = "";
|
|
68552
|
+
if (yaxis_name == "1") {
|
|
68553
|
+
tempName = void 0;
|
|
68554
|
+
}
|
|
68555
|
+
Object.assign(tempOption, {
|
|
68556
|
+
type: "category",
|
|
68557
|
+
name: tempName
|
|
68558
|
+
});
|
|
68559
|
+
Object.assign(tempOption.axisLabel, {
|
|
68560
|
+
...ChartUtil.xAxisLabel()
|
|
68561
|
+
});
|
|
68562
|
+
return { "EC.yAxis": JSON.stringify(tempOption) };
|
|
68563
|
+
}
|
|
68564
|
+
/**
|
|
68565
|
+
* @description 获取标签参数
|
|
68566
|
+
* @param {IModel} seriesModel
|
|
68567
|
+
* @param {IData[]} items
|
|
68568
|
+
* @returns {*} {IData}
|
|
68569
|
+
* @memberof BarConverterBase
|
|
68570
|
+
*/
|
|
68571
|
+
getChartLabelParams(seriesModel, items) {
|
|
68572
|
+
const {
|
|
68573
|
+
series_label_show,
|
|
68574
|
+
series_label_fontsize,
|
|
68575
|
+
series_label_position,
|
|
68576
|
+
series_label_fontstyle,
|
|
68577
|
+
series_label_fontcolor,
|
|
68578
|
+
series_label_data_range
|
|
68579
|
+
} = this.reportUIModel;
|
|
68580
|
+
const options = {
|
|
68581
|
+
show: series_label_show == "1",
|
|
68582
|
+
position: series_label_position
|
|
68583
|
+
};
|
|
68584
|
+
if (series_label_fontstyle) {
|
|
68585
|
+
series_label_fontstyle === "bold" ? options.fontWeight = series_label_fontstyle : options.fontStyle = series_label_fontstyle;
|
|
68586
|
+
}
|
|
68587
|
+
if (series_label_fontsize) {
|
|
68588
|
+
options.fontSize = Number(series_label_fontsize);
|
|
68589
|
+
}
|
|
68590
|
+
if (series_label_fontcolor) {
|
|
68591
|
+
options.color = series_label_fontcolor;
|
|
68592
|
+
}
|
|
68593
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
68594
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
68595
|
+
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 }");
|
|
68596
|
+
}
|
|
68597
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
68598
|
+
options.formatter = "function(param) {\n return param.value[0];\n }";
|
|
68599
|
+
}
|
|
68600
|
+
return { "EC.label": JSON.stringify(options) };
|
|
68601
|
+
}
|
|
68602
|
+
};
|
|
68603
|
+
|
|
68604
|
+
// src/controller/control/report-panel/generator/bi-converter/base/zone-converter-base.ts
|
|
68605
|
+
import { clone as clone51 } from "ramda";
|
|
68606
|
+
var ZoneConverterBase = class extends MultiSeriesConverter {
|
|
68607
|
+
/**
|
|
68608
|
+
* @description 获取控件参数
|
|
68609
|
+
* @returns {*} {IData}
|
|
68610
|
+
* @memberof ZoneConverterBase
|
|
68611
|
+
*/
|
|
68612
|
+
getChartControlParams() {
|
|
68613
|
+
const ctrlParams = super.getChartControlParams();
|
|
68614
|
+
Object.assign(ctrlParams, { ZONE: true });
|
|
68615
|
+
return ctrlParams;
|
|
68616
|
+
}
|
|
68617
|
+
/**
|
|
68618
|
+
* @description 计算X轴参数
|
|
68619
|
+
* @returns {*} {IData}
|
|
68620
|
+
* @memberof ZoneConverterBase
|
|
68621
|
+
*/
|
|
68622
|
+
getChartXAxisParams() {
|
|
68623
|
+
const option = super.getChartXAxisParams();
|
|
68624
|
+
const tempOption = JSON.parse(option["EC.xAxis"]);
|
|
68625
|
+
Object.assign(tempOption, {
|
|
68626
|
+
axisTick: {
|
|
68627
|
+
show: true
|
|
68628
|
+
// 坐标轴刻度线,模板会计算,不是最后一个的坐标系刻度线都会隐藏
|
|
68629
|
+
}
|
|
68630
|
+
});
|
|
68631
|
+
return { "EC.xAxis": JSON.stringify(tempOption) };
|
|
68632
|
+
}
|
|
68633
|
+
/**
|
|
68634
|
+
* @description 计算Y轴参数
|
|
68635
|
+
* @returns {*} {IData}
|
|
68636
|
+
* @memberof ZoneConverterBase
|
|
68637
|
+
*/
|
|
68638
|
+
getChartYAxisParams() {
|
|
68639
|
+
const option = super.getChartYAxisParams();
|
|
68640
|
+
const tempOption = JSON.parse(option["EC.yAxis"]);
|
|
68641
|
+
Object.assign(tempOption, {
|
|
68642
|
+
nameLocation: "center",
|
|
68643
|
+
nameGap: 50
|
|
68644
|
+
});
|
|
68645
|
+
Object.assign(tempOption.axisLabel, {
|
|
68646
|
+
width: 100,
|
|
68647
|
+
lineHeight: 1,
|
|
68648
|
+
rich: {
|
|
68649
|
+
top: {
|
|
68650
|
+
padding: [0, 0, 15, 0]
|
|
68651
|
+
},
|
|
68652
|
+
bottom: {
|
|
68653
|
+
padding: [10, 0, 0, 0]
|
|
68654
|
+
}
|
|
68655
|
+
}
|
|
68656
|
+
});
|
|
68657
|
+
return { "EC.yAxis": JSON.stringify(tempOption) };
|
|
68658
|
+
}
|
|
68659
|
+
/**
|
|
68660
|
+
* @description 计算序列模型
|
|
68661
|
+
* @param {IAppBIReportMeasure[]} measures 指标
|
|
68662
|
+
* @param {IAppBIReportDimension} dimension 维度
|
|
68663
|
+
* @param {IAppBIReportDimension} [groupDimension] 分组维度
|
|
68664
|
+
* @returns {*} {IModel[]}
|
|
68665
|
+
* @memberof ZoneConverterBase
|
|
68666
|
+
*/
|
|
68667
|
+
calcSeriesModel(measures, dimension, groupDimension) {
|
|
68668
|
+
const seriesModels = [];
|
|
68669
|
+
measures.forEach((item, index) => {
|
|
68670
|
+
const seriesModel = clone51(this.mockSerieModel);
|
|
68671
|
+
Object.assign(seriesModel, {
|
|
68672
|
+
id: "".concat(seriesModel.seriesType, "_").concat(index),
|
|
68673
|
+
caption: item.measureName,
|
|
68674
|
+
serieText: item.measureName,
|
|
68675
|
+
catalogName: dimension.dimensionName,
|
|
68676
|
+
valueField: item.measureTag.toLowerCase(),
|
|
68677
|
+
catalogCodeListId: dimension.appCodeListId,
|
|
68678
|
+
catalogField: dimension.dimensionTag.toLowerCase()
|
|
68679
|
+
});
|
|
68680
|
+
Object.assign(seriesModel.chartSeriesEncode, {
|
|
68681
|
+
chartXAxisId: index,
|
|
68682
|
+
chartYAxisId: index
|
|
68683
|
+
});
|
|
68684
|
+
if (groupDimension)
|
|
68685
|
+
Object.assign(seriesModel, {
|
|
68686
|
+
seriesCodeListId: groupDimension.appCodeListId,
|
|
68687
|
+
seriesField: groupDimension.dimensionTag.toLowerCase()
|
|
68688
|
+
});
|
|
68689
|
+
seriesModels.push(seriesModel);
|
|
68690
|
+
});
|
|
68691
|
+
return seriesModels;
|
|
68692
|
+
}
|
|
68693
|
+
};
|
|
68694
|
+
|
|
68695
|
+
// src/controller/control/report-panel/generator/bi-converter/base/grid-converter-base.ts
|
|
68696
|
+
var GridConverterBase = class extends ConverterBase {
|
|
68697
|
+
/**
|
|
68698
|
+
* @description 获取表格样式
|
|
68699
|
+
* @returns {*} {IData}
|
|
68700
|
+
* @memberof GridConverterBase
|
|
68701
|
+
*/
|
|
68702
|
+
getGridStyle() {
|
|
68703
|
+
const result = {
|
|
68704
|
+
vars: {},
|
|
68705
|
+
classList: [],
|
|
68706
|
+
model: { controlParam: {} }
|
|
68707
|
+
};
|
|
68708
|
+
const {
|
|
68709
|
+
grid_show_agg,
|
|
68710
|
+
grid_header_fontstyle,
|
|
68711
|
+
grid_header_fontsize,
|
|
68712
|
+
grid_header_fontcolor,
|
|
68713
|
+
grid_header_position,
|
|
68714
|
+
grid_body_fontstyle,
|
|
68715
|
+
grid_body_fontsize,
|
|
68716
|
+
grid_body_fontcolor,
|
|
68717
|
+
grid_agg_row_position,
|
|
68718
|
+
grid_function_setting
|
|
68719
|
+
} = this.reportUIModel;
|
|
68720
|
+
result.vars = {
|
|
68721
|
+
"--ibiz-control-grid-header-align": grid_header_position,
|
|
68722
|
+
"--ibiz-control-grid-header-font-size": "".concat(grid_header_fontsize, "px"),
|
|
68723
|
+
"--ibiz-control-grid-header-text-color": grid_header_fontcolor,
|
|
68724
|
+
"--ibiz-control-grid-content-font-size": "".concat(grid_body_fontsize, "px"),
|
|
68725
|
+
"--ibiz-control-grid-content-text-color": grid_body_fontcolor
|
|
68726
|
+
};
|
|
68727
|
+
if (grid_header_fontstyle) {
|
|
68728
|
+
const key = grid_header_fontstyle === "bold" ? "--ibiz-control-grid-header-font-weight" : "--ibiz-control-grid-header-font-style";
|
|
68729
|
+
result.vars[key] = grid_header_fontstyle;
|
|
68730
|
+
}
|
|
68731
|
+
if (grid_body_fontstyle) {
|
|
68732
|
+
const key = grid_body_fontstyle === "bold" ? "--ibiz-control-grid-content-font-weight" : "--ibiz-control-grid-content-font-style";
|
|
68733
|
+
result.vars[key] = grid_body_fontstyle;
|
|
68734
|
+
}
|
|
68735
|
+
if (grid_show_agg == "1") {
|
|
68736
|
+
Object.assign(result.model, { aggMode: "PAGE" });
|
|
68737
|
+
if (grid_agg_row_position === "top") {
|
|
68738
|
+
result.classList.push("el-table--top-agg");
|
|
68739
|
+
}
|
|
68740
|
+
}
|
|
68741
|
+
if (grid_function_setting) {
|
|
68742
|
+
const ctrlParams = {};
|
|
68743
|
+
if (grid_function_setting.indexOf("fixedGridHeader") === -1) {
|
|
68744
|
+
result.classList.push("el-table--scroll-header");
|
|
68745
|
+
}
|
|
68746
|
+
if (grid_function_setting.indexOf("fixedDimension") !== -1 && this.dimensions) {
|
|
68747
|
+
Object.assign(result.model, {
|
|
68748
|
+
frozenFirstColumn: this.dimensions.length
|
|
68749
|
+
});
|
|
68750
|
+
}
|
|
68751
|
+
if (grid_function_setting.indexOf("showPercent") !== -1) {
|
|
68752
|
+
Object.assign(ctrlParams, {
|
|
68753
|
+
percentkeys: JSON.stringify(
|
|
68754
|
+
this.measures.map((x) => x.measureTag.toLowerCase())
|
|
68755
|
+
)
|
|
68756
|
+
});
|
|
68757
|
+
}
|
|
68758
|
+
Object.assign(result.model.controlParam, { ctrlParams });
|
|
68759
|
+
}
|
|
68760
|
+
return result;
|
|
68761
|
+
}
|
|
68762
|
+
/**
|
|
68763
|
+
* @description 计算表格列样式
|
|
68764
|
+
* @param {boolean} [enableAgg=true]
|
|
68765
|
+
* @returns {*} {IData}
|
|
68766
|
+
* @memberof GridConverterBase
|
|
68767
|
+
*/
|
|
68768
|
+
calcGridColumnStyle(enableAgg = true) {
|
|
68769
|
+
const { grid_body_position, grid_show_agg } = this.reportUIModel;
|
|
68770
|
+
const result = {};
|
|
68771
|
+
if (grid_body_position)
|
|
68772
|
+
result.align = grid_body_position;
|
|
68773
|
+
if (enableAgg && grid_show_agg == "1")
|
|
68774
|
+
result.aggMode = "SUM";
|
|
68775
|
+
return result;
|
|
68776
|
+
}
|
|
68777
|
+
/**
|
|
68778
|
+
* @description 计算表格列合并
|
|
68779
|
+
* @param {IData[]} [items=[]] 表格展示数据
|
|
68780
|
+
* @returns {*} {IData}
|
|
68781
|
+
* @memberof GridConverterBase
|
|
68782
|
+
*/
|
|
68783
|
+
calcGridColumnMerge(items = []) {
|
|
68784
|
+
const { grid_function_setting } = this.reportUIModel;
|
|
68785
|
+
const result = { controlAttributes: [], rowspans: [] };
|
|
68786
|
+
if (grid_function_setting.indexOf("dimensionMerge") !== -1) {
|
|
68787
|
+
const columnKeys = this.dimensions.map(
|
|
68788
|
+
(dimension) => dimension.dimensionTag.toLowerCase()
|
|
68789
|
+
);
|
|
68790
|
+
const rowspans = [];
|
|
68791
|
+
columnKeys.forEach((columnKey, colIndex) => {
|
|
68792
|
+
rowspans[colIndex] = [];
|
|
68793
|
+
let pos = 0;
|
|
68794
|
+
if (colIndex === 0) {
|
|
68795
|
+
while (pos < items.length) {
|
|
68796
|
+
let count = 1;
|
|
68797
|
+
const currentValue = items[pos][columnKey];
|
|
68798
|
+
while (pos + count < items.length && items[pos + count][columnKey] === currentValue) {
|
|
68799
|
+
count++;
|
|
68800
|
+
}
|
|
68801
|
+
for (let i = 0; i < count; i++) {
|
|
68802
|
+
rowspans[colIndex][pos + i] = i === 0 ? count : 0;
|
|
68803
|
+
}
|
|
68804
|
+
pos += count;
|
|
68805
|
+
}
|
|
68806
|
+
} else {
|
|
68807
|
+
let prevPos = 0;
|
|
68808
|
+
while (prevPos < items.length) {
|
|
68809
|
+
const prevSpan = rowspans[colIndex - 1][prevPos];
|
|
68810
|
+
if (prevSpan > 0) {
|
|
68811
|
+
let innerPos = prevPos;
|
|
68812
|
+
while (innerPos < prevPos + prevSpan) {
|
|
68813
|
+
let count = 1;
|
|
68814
|
+
const currentValue = items[innerPos][columnKey];
|
|
68815
|
+
while (innerPos + count < prevPos + prevSpan && items[innerPos + count][columnKey] === currentValue) {
|
|
68816
|
+
count++;
|
|
68817
|
+
}
|
|
68818
|
+
for (let i = 0; i < count; i++) {
|
|
68819
|
+
rowspans[colIndex][innerPos + i] = i === 0 ? count : 0;
|
|
68820
|
+
}
|
|
68821
|
+
innerPos += count;
|
|
68822
|
+
}
|
|
68823
|
+
} else {
|
|
68824
|
+
rowspans[colIndex][prevPos] = 0;
|
|
68825
|
+
}
|
|
68826
|
+
prevPos += Math.max(1, rowspans[colIndex - 1][prevPos]);
|
|
68827
|
+
}
|
|
68828
|
+
}
|
|
68829
|
+
});
|
|
68830
|
+
const spanMethod = {
|
|
68831
|
+
attrName: "span-method",
|
|
68832
|
+
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 };"
|
|
68833
|
+
};
|
|
68834
|
+
result.rowspans = rowspans;
|
|
68835
|
+
result.controlAttributes.push(spanMethod);
|
|
68836
|
+
}
|
|
68837
|
+
return result;
|
|
68838
|
+
}
|
|
68839
|
+
};
|
|
68840
|
+
|
|
68841
|
+
// src/controller/control/report-panel/generator/bi-converter/stack-col-converter.ts
|
|
68842
|
+
var StackColConverter = class extends MultiSeriesConverter {
|
|
68843
|
+
constructor() {
|
|
68844
|
+
super(...arguments);
|
|
68845
|
+
/**
|
|
68846
|
+
* @description 仿真模型
|
|
68847
|
+
* @type {IModel}
|
|
68848
|
+
* @memberof StackColConverter
|
|
68849
|
+
*/
|
|
68850
|
+
this.mockModel = {
|
|
68851
|
+
userParam: {},
|
|
68852
|
+
dechartLegend: {
|
|
68853
|
+
id: "legend",
|
|
68854
|
+
showLegend: false,
|
|
68855
|
+
appId: this.appBIReport.appId
|
|
68856
|
+
},
|
|
68857
|
+
dechartTitle: {
|
|
68858
|
+
id: "title",
|
|
68859
|
+
showTitle: false,
|
|
68860
|
+
appId: this.appBIReport.appId
|
|
68861
|
+
},
|
|
68862
|
+
chartXAxises: [
|
|
68863
|
+
{
|
|
68864
|
+
id: "0",
|
|
68865
|
+
type: "category",
|
|
68866
|
+
position: "bottom",
|
|
68867
|
+
echartsPos: "xAxis",
|
|
68868
|
+
name: "axis_xAxis_0",
|
|
68869
|
+
echartsType: "category",
|
|
68870
|
+
appId: this.appBIReport.appId
|
|
68871
|
+
}
|
|
68872
|
+
],
|
|
68873
|
+
chartYAxises: [
|
|
68874
|
+
{
|
|
68875
|
+
id: "0",
|
|
68876
|
+
type: "numeric",
|
|
68877
|
+
position: "left",
|
|
68878
|
+
echartsPos: "yAxis",
|
|
68879
|
+
echartsType: "value",
|
|
68880
|
+
name: "axis_yAxis_0",
|
|
68881
|
+
appId: this.appBIReport.appId
|
|
68882
|
+
}
|
|
68883
|
+
],
|
|
68884
|
+
readOnly: true,
|
|
68885
|
+
autoLoad: true,
|
|
68886
|
+
dechartSerieses: [],
|
|
68887
|
+
controlType: "CHART",
|
|
68888
|
+
id: this.appBIReport.id,
|
|
68889
|
+
showBusyIndicator: true,
|
|
68890
|
+
name: this.appBIReport.id,
|
|
68891
|
+
appId: this.appBIReport.appId,
|
|
68892
|
+
codeName: this.appBIReport.id,
|
|
68893
|
+
caption: this.appBIReport.name,
|
|
68894
|
+
logicName: this.appBIReport.name,
|
|
68895
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
68896
|
+
};
|
|
68897
|
+
/**
|
|
68898
|
+
* @description 仿真序列模型
|
|
68899
|
+
* @type {IModel}
|
|
68900
|
+
* @memberof StackColConverter
|
|
68901
|
+
*/
|
|
68902
|
+
this.mockSerieModel = {
|
|
68903
|
+
chartSeriesEncode: {
|
|
68904
|
+
id: "0",
|
|
68905
|
+
type: "XY",
|
|
68906
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
68907
|
+
chartXAxisId: "0",
|
|
68908
|
+
chartYAxisId: "0",
|
|
68909
|
+
appId: this.appBIReport.appId
|
|
68910
|
+
},
|
|
68911
|
+
seriesType: "bar",
|
|
68912
|
+
echartsType: "bar",
|
|
68913
|
+
chartDataSetId: "0",
|
|
68914
|
+
seriesLayoutBy: "column",
|
|
68915
|
+
enableChartDataSet: true,
|
|
68916
|
+
chartCoordinateSystemId: "0",
|
|
68917
|
+
appId: this.appBIReport.appId
|
|
68918
|
+
};
|
|
68919
|
+
}
|
|
68920
|
+
/**
|
|
68921
|
+
* @description 转化数据到报表
|
|
68922
|
+
* @param {IData[]} items
|
|
68923
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
68924
|
+
* @memberof StackColConverter
|
|
68925
|
+
*/
|
|
68926
|
+
translateDataToReport(items) {
|
|
68927
|
+
var _a3;
|
|
68928
|
+
const report = super.translateDataToReport(items);
|
|
68929
|
+
if (report) {
|
|
68930
|
+
const { model } = report;
|
|
68931
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
68932
|
+
Object.assign(series.userParam, {
|
|
68933
|
+
"EC.stack": "stackcol"
|
|
68934
|
+
});
|
|
68935
|
+
});
|
|
68936
|
+
}
|
|
68937
|
+
return report;
|
|
68938
|
+
}
|
|
68939
|
+
};
|
|
68940
|
+
|
|
68941
|
+
// src/controller/control/report-panel/generator/bi-converter/multi-series-col-converter.ts
|
|
68942
|
+
var MultiSeriesColConverter = class extends MultiSeriesConverter {
|
|
68943
|
+
constructor() {
|
|
68944
|
+
super(...arguments);
|
|
68945
|
+
/**
|
|
68946
|
+
* @description 仿真模型
|
|
68947
|
+
* @type {IModel}
|
|
68948
|
+
* @memberof MultiSeriesColConverter
|
|
68949
|
+
*/
|
|
68950
|
+
this.mockModel = {
|
|
68951
|
+
userParam: {},
|
|
68952
|
+
dechartLegend: {
|
|
68953
|
+
id: "legend",
|
|
68954
|
+
showLegend: false,
|
|
68955
|
+
appId: this.appBIReport.appId
|
|
68956
|
+
},
|
|
68957
|
+
dechartTitle: {
|
|
68958
|
+
id: "title",
|
|
68959
|
+
showTitle: false,
|
|
68960
|
+
appId: this.appBIReport.appId
|
|
68961
|
+
},
|
|
68962
|
+
chartXAxises: [
|
|
68963
|
+
{
|
|
68964
|
+
id: "0",
|
|
68965
|
+
type: "category",
|
|
68966
|
+
echartsPos: "xAxis",
|
|
68967
|
+
position: "bottom",
|
|
68968
|
+
name: "axis_xAxis_0",
|
|
68969
|
+
echartsType: "category",
|
|
68970
|
+
appId: this.appBIReport.appId
|
|
68971
|
+
}
|
|
68972
|
+
],
|
|
68973
|
+
chartYAxises: [
|
|
68974
|
+
{
|
|
68975
|
+
id: "0",
|
|
68976
|
+
type: "numeric",
|
|
68977
|
+
position: "left",
|
|
68978
|
+
echartsPos: "yAxis",
|
|
68979
|
+
name: "axis_yAxis_0",
|
|
68980
|
+
echartsType: "value",
|
|
68981
|
+
appId: this.appBIReport.appId
|
|
68982
|
+
}
|
|
68983
|
+
],
|
|
68984
|
+
readOnly: true,
|
|
68985
|
+
autoLoad: true,
|
|
68986
|
+
dechartSerieses: [],
|
|
68987
|
+
controlType: "CHART",
|
|
68988
|
+
showBusyIndicator: true,
|
|
68989
|
+
id: this.appBIReport.id,
|
|
68990
|
+
name: this.appBIReport.id,
|
|
68991
|
+
appId: this.appBIReport.appId,
|
|
68992
|
+
codeName: this.appBIReport.id,
|
|
68993
|
+
caption: this.appBIReport.name,
|
|
68994
|
+
logicName: this.appBIReport.name,
|
|
68995
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
68996
|
+
};
|
|
68997
|
+
/**
|
|
68998
|
+
* @description 仿真序列模型
|
|
68999
|
+
* @type {IModel}
|
|
69000
|
+
* @memberof MultiSeriesColConverter
|
|
69001
|
+
*/
|
|
69002
|
+
this.mockSerieModel = {
|
|
69003
|
+
chartSeriesEncode: {
|
|
69004
|
+
id: "0",
|
|
69005
|
+
type: "XY",
|
|
69006
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69007
|
+
chartXAxisId: "0",
|
|
69008
|
+
chartYAxisId: "0",
|
|
69009
|
+
appId: this.appBIReport.appId
|
|
69010
|
+
},
|
|
69011
|
+
seriesType: "bar",
|
|
69012
|
+
echartsType: "bar",
|
|
69013
|
+
chartDataSetId: "0",
|
|
69014
|
+
seriesLayoutBy: "column",
|
|
69015
|
+
enableChartDataSet: true,
|
|
69016
|
+
chartCoordinateSystemId: "0",
|
|
69017
|
+
appId: this.appBIReport.appId
|
|
69018
|
+
};
|
|
69019
|
+
}
|
|
69020
|
+
};
|
|
69021
|
+
|
|
69022
|
+
// src/controller/control/report-panel/generator/bi-converter/gauge-converter.ts
|
|
69023
|
+
import { clone as clone52 } from "ramda";
|
|
69024
|
+
var GaugeConverter = class extends EchartConverterBase {
|
|
69025
|
+
constructor() {
|
|
69026
|
+
super(...arguments);
|
|
69027
|
+
/**
|
|
69028
|
+
* @description 仿真模型
|
|
69029
|
+
* @type {IModel}
|
|
69030
|
+
* @memberof GaugeConverter
|
|
69031
|
+
*/
|
|
69032
|
+
this.mockModel = {
|
|
69033
|
+
userParam: {},
|
|
69034
|
+
dechartLegend: {
|
|
69035
|
+
id: "legend",
|
|
69036
|
+
showLegend: false,
|
|
69037
|
+
appId: this.appBIReport.appId
|
|
69038
|
+
},
|
|
69039
|
+
dechartTitle: {
|
|
69040
|
+
id: "title",
|
|
69041
|
+
showTitle: false,
|
|
69042
|
+
appId: this.appBIReport.appId
|
|
69043
|
+
},
|
|
69044
|
+
readOnly: true,
|
|
69045
|
+
autoLoad: true,
|
|
69046
|
+
dechartSerieses: [],
|
|
69047
|
+
controlType: "CHART",
|
|
69048
|
+
showBusyIndicator: true,
|
|
69049
|
+
id: this.appBIReport.id,
|
|
69050
|
+
name: this.appBIReport.id,
|
|
69051
|
+
appId: this.appBIReport.appId,
|
|
69052
|
+
codeName: this.appBIReport.id,
|
|
69053
|
+
caption: this.appBIReport.name,
|
|
69054
|
+
logicName: this.appBIReport.name,
|
|
69055
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69056
|
+
};
|
|
69057
|
+
/**
|
|
69058
|
+
* @description 仿真序列模型
|
|
69059
|
+
* @type {IModel}
|
|
69060
|
+
* @memberof GaugeConverter
|
|
69061
|
+
*/
|
|
69062
|
+
this.mockSerieModel = {
|
|
69063
|
+
seriesType: "gauge",
|
|
69064
|
+
echartsType: "gauge",
|
|
69065
|
+
chartDataSetId: "0",
|
|
69066
|
+
seriesLayoutBy: "column",
|
|
69067
|
+
enableChartDataSet: true,
|
|
69068
|
+
chartCoordinateSystemId: "0",
|
|
69069
|
+
appId: this.appBIReport.appId
|
|
69070
|
+
};
|
|
69071
|
+
}
|
|
69072
|
+
/**
|
|
69073
|
+
* @description 计算序列模型
|
|
69074
|
+
* @param {IAppBIReportMeasure[]} measures
|
|
69075
|
+
* @param {IAppBIReportDimension} dimension
|
|
69076
|
+
* @param {IAppBIReportDimension} [groupDimension]
|
|
69077
|
+
* @returns {*} {IModel[]}
|
|
69078
|
+
* @memberof GaugeConverter
|
|
69079
|
+
*/
|
|
69080
|
+
calcSeriesModel(measures, dimension, groupDimension) {
|
|
69081
|
+
const seriesModels = [];
|
|
69082
|
+
measures.forEach((item, index) => {
|
|
69083
|
+
const seriesModel = clone52(this.mockSerieModel);
|
|
69084
|
+
const seriesInput = {
|
|
69085
|
+
caption: item.measureName,
|
|
69086
|
+
serieText: item.measureName,
|
|
69087
|
+
catalogName: item.measureName,
|
|
69088
|
+
value: item.measureTag.toLowerCase(),
|
|
69089
|
+
catalogField: item.measureTag.toLowerCase()
|
|
69090
|
+
};
|
|
69091
|
+
Object.assign(seriesModel, {
|
|
69092
|
+
id: "".concat(seriesModel.seriesType, "_").concat(index),
|
|
69093
|
+
caption: item.measureName,
|
|
69094
|
+
serieText: item.measureName,
|
|
69095
|
+
catalogName: item.measureName,
|
|
69096
|
+
valueField: item.measureTag.toLowerCase(),
|
|
69097
|
+
catalogField: item.measureTag.toLowerCase()
|
|
69098
|
+
});
|
|
69099
|
+
if (groupDimension)
|
|
69100
|
+
Object.assign(seriesModel, {
|
|
69101
|
+
seriesCodeListId: groupDimension.appCodeListId,
|
|
69102
|
+
seriesField: groupDimension.dimensionTag.toLowerCase()
|
|
69103
|
+
});
|
|
69104
|
+
seriesModels.push(seriesModel);
|
|
69105
|
+
});
|
|
69106
|
+
return seriesModels;
|
|
69107
|
+
}
|
|
69108
|
+
/**
|
|
69109
|
+
* @description 转化数据到报表
|
|
69110
|
+
* @param {IData[]} items
|
|
69111
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69112
|
+
* @memberof GaugeConverter
|
|
69113
|
+
*/
|
|
69114
|
+
translateDataToReport(items) {
|
|
69115
|
+
var _a3;
|
|
69116
|
+
if (!this.measures.length)
|
|
69117
|
+
return;
|
|
69118
|
+
const model = clone52(this.mockModel);
|
|
69119
|
+
const seriesModels = this.calcSeriesModel(
|
|
69120
|
+
this.measures,
|
|
69121
|
+
this.dimensions[0],
|
|
69122
|
+
this.groupDimension
|
|
69123
|
+
);
|
|
69124
|
+
if (model.dechartSerieses)
|
|
69125
|
+
model.dechartSerieses.push(...seriesModels);
|
|
69126
|
+
const chartColorParams = this.getChartColorParams();
|
|
69127
|
+
Object.assign(model.userParam, chartColorParams);
|
|
69128
|
+
const serieParam = this.commputeSeriesParam();
|
|
69129
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69130
|
+
Object.assign(series, {
|
|
69131
|
+
userParam: serieParam
|
|
69132
|
+
});
|
|
69133
|
+
});
|
|
69134
|
+
return { model, options: {}, data: items };
|
|
69135
|
+
}
|
|
69136
|
+
/**
|
|
69137
|
+
* @description 计算序列参数
|
|
69138
|
+
* @returns {*} {IData}
|
|
69139
|
+
* @memberof GaugeConverter
|
|
69140
|
+
*/
|
|
69141
|
+
commputeSeriesParam() {
|
|
69142
|
+
const {
|
|
69143
|
+
series_max,
|
|
69144
|
+
series_detail_fontsize,
|
|
69145
|
+
series_detail_fontstyle,
|
|
69146
|
+
series_detail_fontcolor
|
|
69147
|
+
} = this.reportUIModel;
|
|
69148
|
+
const seriesParams = {
|
|
69149
|
+
"EC.radius": "90%",
|
|
69150
|
+
"EC.startAngle": "220",
|
|
69151
|
+
"EC.endAngle": "-40",
|
|
69152
|
+
"EC.splitNumber": "4",
|
|
69153
|
+
"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 }',
|
|
69154
|
+
"EC.axisTick": '{"splitNumber":5,"distance":5,"lineStyle":{"width":2,"color":"#ddd"}}',
|
|
69155
|
+
"EC.splitLine": '{"length":10,"distance":5,"lineStyle":{"width":2,"color":"#ddd"}}',
|
|
69156
|
+
"EC.title": '{"show":false}',
|
|
69157
|
+
"EC.pointer": '{"length":"50%"}',
|
|
69158
|
+
"EC.detail": '{"offsetCenter":[0,"60%"]}',
|
|
69159
|
+
"EC.progress": '{"show":true,"width":60}',
|
|
69160
|
+
"EC.axisLine": '{"lineStyle":{"width":60,"color":[[1,"rgb(245, 245, 245)"]]}}',
|
|
69161
|
+
"EC.axisLabel": '{"distance":76,"color":"#333","fontSize":12,"formatter": "function (num){return (num * 100) / 100 + `%` }"}'
|
|
69162
|
+
};
|
|
69163
|
+
const options = {
|
|
69164
|
+
offsetCenter: [0, "60%"],
|
|
69165
|
+
fontSize: series_detail_fontsize,
|
|
69166
|
+
color: series_detail_fontcolor
|
|
69167
|
+
};
|
|
69168
|
+
if (series_detail_fontstyle) {
|
|
69169
|
+
if (series_detail_fontstyle === "bold") {
|
|
69170
|
+
options.fontWeight = series_detail_fontstyle;
|
|
69171
|
+
} else {
|
|
69172
|
+
options.fontWeight = "normal";
|
|
69173
|
+
options.fontStyle = series_detail_fontstyle;
|
|
69174
|
+
}
|
|
69175
|
+
}
|
|
69176
|
+
seriesParams["EC.detail"] = JSON.stringify(options);
|
|
69177
|
+
if (series_max) {
|
|
69178
|
+
seriesParams["EC.max"] = JSON.stringify(series_max);
|
|
69179
|
+
seriesParams["EC.axisLabel"] = JSON.stringify({
|
|
69180
|
+
distance: 76,
|
|
69181
|
+
color: "#333",
|
|
69182
|
+
fontSize: 12,
|
|
69183
|
+
formatter: "function (num){return (num * 100) / '".concat(series_max, "' + '%' }")
|
|
69184
|
+
});
|
|
69185
|
+
}
|
|
69186
|
+
return seriesParams;
|
|
69187
|
+
}
|
|
69188
|
+
};
|
|
69189
|
+
|
|
69190
|
+
// src/controller/control/report-panel/generator/bi-converter/multi-series-bar-converter.ts
|
|
69191
|
+
var MultiSeriesBarConverter = class extends BarConverterBase {
|
|
69192
|
+
constructor() {
|
|
69193
|
+
super(...arguments);
|
|
69194
|
+
/**
|
|
69195
|
+
* @description 仿真模型
|
|
69196
|
+
* @type {IModel}
|
|
69197
|
+
* @memberof MultiSeriesBarConverter
|
|
69198
|
+
*/
|
|
69199
|
+
this.mockModel = {
|
|
69200
|
+
dechartLegend: {
|
|
69201
|
+
id: "legend",
|
|
69202
|
+
showLegend: false,
|
|
69203
|
+
appId: this.appBIReport.appId
|
|
69204
|
+
},
|
|
69205
|
+
dechartTitle: {
|
|
69206
|
+
id: "title",
|
|
69207
|
+
showTitle: false,
|
|
69208
|
+
appId: this.appBIReport.appId
|
|
69209
|
+
},
|
|
69210
|
+
chartXAxises: [
|
|
69211
|
+
{
|
|
69212
|
+
id: "0",
|
|
69213
|
+
type: "category",
|
|
69214
|
+
position: "bottom",
|
|
69215
|
+
echartsPos: "xAxis",
|
|
69216
|
+
name: "axis_xAxis_0",
|
|
69217
|
+
echartsType: "category",
|
|
69218
|
+
appId: this.appBIReport.appId
|
|
69219
|
+
}
|
|
69220
|
+
],
|
|
69221
|
+
chartYAxises: [
|
|
69222
|
+
{
|
|
69223
|
+
id: "0",
|
|
69224
|
+
type: "numeric",
|
|
69225
|
+
position: "left",
|
|
69226
|
+
echartsPos: "yAxis",
|
|
69227
|
+
echartsType: "value",
|
|
69228
|
+
name: "axis_yAxis_0",
|
|
69229
|
+
appId: this.appBIReport.appId
|
|
69230
|
+
}
|
|
69231
|
+
],
|
|
69232
|
+
readOnly: true,
|
|
69233
|
+
autoLoad: true,
|
|
69234
|
+
dechartSerieses: [],
|
|
69235
|
+
controlType: "CHART",
|
|
69236
|
+
showBusyIndicator: true,
|
|
69237
|
+
id: this.appBIReport.id,
|
|
69238
|
+
name: this.appBIReport.id,
|
|
69239
|
+
appId: this.appBIReport.appId,
|
|
69240
|
+
codeName: this.appBIReport.id,
|
|
69241
|
+
caption: this.appBIReport.name,
|
|
69242
|
+
logicName: this.appBIReport.name,
|
|
69243
|
+
appDataEntityId: this.appBIReport.appDataEntityId,
|
|
69244
|
+
userParam: {}
|
|
69245
|
+
};
|
|
69246
|
+
/**
|
|
69247
|
+
* @description 仿真序列模型
|
|
69248
|
+
* @type {IModel}
|
|
69249
|
+
* @memberof MultiSeriesBarConverter
|
|
69250
|
+
*/
|
|
69251
|
+
this.mockSerieModel = {
|
|
69252
|
+
chartSeriesEncode: {
|
|
69253
|
+
id: "0",
|
|
69254
|
+
type: "XY",
|
|
69255
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69256
|
+
chartXAxisId: "0",
|
|
69257
|
+
chartYAxisId: "0",
|
|
69258
|
+
appId: this.appBIReport.appId
|
|
69259
|
+
},
|
|
69260
|
+
seriesType: "bar",
|
|
69261
|
+
echartsType: "bar",
|
|
69262
|
+
chartDataSetId: "0",
|
|
69263
|
+
seriesLayoutBy: "column",
|
|
69264
|
+
enableChartDataSet: true,
|
|
69265
|
+
chartCoordinateSystemId: "0",
|
|
69266
|
+
appId: this.appBIReport.appId
|
|
69267
|
+
};
|
|
69268
|
+
}
|
|
69269
|
+
};
|
|
69270
|
+
|
|
69271
|
+
// src/controller/control/report-panel/generator/bi-converter/zone-col-converter.ts
|
|
69272
|
+
var ZoneColConverter = class extends ZoneConverterBase {
|
|
69273
|
+
constructor() {
|
|
69274
|
+
super(...arguments);
|
|
69275
|
+
/**
|
|
69276
|
+
* @description 仿真模型
|
|
69277
|
+
* @type {IModel}
|
|
69278
|
+
* @memberof ZoneColConverter
|
|
69279
|
+
*/
|
|
69280
|
+
this.mockModel = {
|
|
69281
|
+
userParam: {},
|
|
69282
|
+
dechartLegend: {
|
|
69283
|
+
id: "legend",
|
|
69284
|
+
showLegend: false,
|
|
69285
|
+
appId: this.appBIReport.appId
|
|
69286
|
+
},
|
|
69287
|
+
dechartTitle: {
|
|
69288
|
+
id: "title",
|
|
69289
|
+
showTitle: false,
|
|
69290
|
+
appId: this.appBIReport.appId
|
|
69291
|
+
},
|
|
69292
|
+
chartXAxises: [
|
|
69293
|
+
{
|
|
69294
|
+
id: "0",
|
|
69295
|
+
type: "category",
|
|
69296
|
+
position: "bottom",
|
|
69297
|
+
echartsPos: "xAxis",
|
|
69298
|
+
name: "axis_xAxis_0",
|
|
69299
|
+
echartsType: "category",
|
|
69300
|
+
appId: this.appBIReport.appId
|
|
69301
|
+
}
|
|
69302
|
+
],
|
|
69303
|
+
chartYAxises: [
|
|
69304
|
+
{
|
|
69305
|
+
id: "0",
|
|
69306
|
+
type: "numeric",
|
|
69307
|
+
position: "left",
|
|
69308
|
+
echartsPos: "yAxis",
|
|
69309
|
+
echartsType: "value",
|
|
69310
|
+
name: "axis_yAxis_0",
|
|
69311
|
+
appId: this.appBIReport.appId
|
|
69312
|
+
}
|
|
69313
|
+
],
|
|
69314
|
+
readOnly: true,
|
|
69315
|
+
autoLoad: true,
|
|
69316
|
+
dechartSerieses: [],
|
|
69317
|
+
controlType: "CHART",
|
|
69318
|
+
id: this.appBIReport.id,
|
|
69319
|
+
showBusyIndicator: true,
|
|
69320
|
+
name: this.appBIReport.id,
|
|
69321
|
+
appId: this.appBIReport.appId,
|
|
69322
|
+
codeName: this.appBIReport.id,
|
|
69323
|
+
caption: this.appBIReport.name,
|
|
69324
|
+
logicName: this.appBIReport.name,
|
|
69325
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69326
|
+
};
|
|
69327
|
+
/**
|
|
69328
|
+
* @description 仿真序列模型
|
|
69329
|
+
* @type {IModel}
|
|
69330
|
+
* @memberof ZoneColConverter
|
|
69331
|
+
*/
|
|
69332
|
+
this.mockSerieModel = {
|
|
69333
|
+
chartSeriesEncode: {
|
|
69334
|
+
id: "0",
|
|
69335
|
+
type: "XY",
|
|
69336
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69337
|
+
chartXAxisId: "0",
|
|
69338
|
+
chartYAxisId: "0",
|
|
69339
|
+
appId: this.appBIReport.appId
|
|
69340
|
+
},
|
|
69341
|
+
seriesType: "bar",
|
|
69342
|
+
echartsType: "bar",
|
|
69343
|
+
chartDataSetId: "0",
|
|
69344
|
+
seriesLayoutBy: "column",
|
|
69345
|
+
enableChartDataSet: true,
|
|
69346
|
+
chartCoordinateSystemId: "0",
|
|
69347
|
+
appId: this.appBIReport.appId
|
|
69348
|
+
};
|
|
69349
|
+
}
|
|
69350
|
+
};
|
|
69351
|
+
|
|
69352
|
+
// src/controller/control/report-panel/generator/bi-converter/stack-bar-converter.ts
|
|
69353
|
+
var StackBarConverter = class extends BarConverterBase {
|
|
69354
|
+
constructor() {
|
|
69355
|
+
super(...arguments);
|
|
69356
|
+
/**
|
|
69357
|
+
* @description 仿真模型
|
|
69358
|
+
* @type {IModel}
|
|
69359
|
+
* @memberof StackBarConverter
|
|
69360
|
+
*/
|
|
69361
|
+
this.mockModel = {
|
|
69362
|
+
userParam: {},
|
|
69363
|
+
dechartLegend: {
|
|
69364
|
+
id: "legend",
|
|
69365
|
+
showLegend: false,
|
|
69366
|
+
appId: this.appBIReport.appId
|
|
69367
|
+
},
|
|
69368
|
+
dechartTitle: {
|
|
69369
|
+
id: "title",
|
|
69370
|
+
showTitle: false,
|
|
69371
|
+
appId: this.appBIReport.appId
|
|
69372
|
+
},
|
|
69373
|
+
chartXAxises: [
|
|
69374
|
+
{
|
|
69375
|
+
id: "0",
|
|
69376
|
+
type: "category",
|
|
69377
|
+
position: "bottom",
|
|
69378
|
+
echartsPos: "xAxis",
|
|
69379
|
+
name: "axis_xAxis_0",
|
|
69380
|
+
echartsType: "category",
|
|
69381
|
+
appId: this.appBIReport.appId
|
|
69382
|
+
}
|
|
69383
|
+
],
|
|
69384
|
+
chartYAxises: [
|
|
69385
|
+
{
|
|
69386
|
+
id: "0",
|
|
69387
|
+
type: "numeric",
|
|
69388
|
+
position: "left",
|
|
69389
|
+
echartsPos: "yAxis",
|
|
69390
|
+
echartsType: "value",
|
|
69391
|
+
name: "axis_yAxis_0",
|
|
69392
|
+
appId: this.appBIReport.appId
|
|
69393
|
+
}
|
|
69394
|
+
],
|
|
69395
|
+
readOnly: true,
|
|
69396
|
+
autoLoad: true,
|
|
69397
|
+
dechartSerieses: [],
|
|
69398
|
+
controlType: "CHART",
|
|
69399
|
+
showBusyIndicator: true,
|
|
69400
|
+
id: this.appBIReport.id,
|
|
69401
|
+
name: this.appBIReport.id,
|
|
69402
|
+
appId: this.appBIReport.appId,
|
|
69403
|
+
codeName: this.appBIReport.id,
|
|
69404
|
+
caption: this.appBIReport.name,
|
|
69405
|
+
logicName: this.appBIReport.name,
|
|
69406
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69407
|
+
};
|
|
69408
|
+
/**
|
|
69409
|
+
* @description 仿真序列模型
|
|
69410
|
+
* @type {IModel}
|
|
69411
|
+
* @memberof StackBarConverter
|
|
69412
|
+
*/
|
|
69413
|
+
this.mockSerieModel = {
|
|
69414
|
+
chartSeriesEncode: {
|
|
69415
|
+
id: "0",
|
|
69416
|
+
type: "XY",
|
|
69417
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69418
|
+
chartXAxisId: "0",
|
|
69419
|
+
chartYAxisId: "0",
|
|
69420
|
+
appId: this.appBIReport.appId
|
|
69421
|
+
},
|
|
69422
|
+
seriesType: "bar",
|
|
69423
|
+
echartsType: "bar",
|
|
69424
|
+
chartDataSetId: "0",
|
|
69425
|
+
seriesLayoutBy: "column",
|
|
69426
|
+
enableChartDataSet: true,
|
|
69427
|
+
chartCoordinateSystemId: "0",
|
|
69428
|
+
appId: this.appBIReport.appId
|
|
69429
|
+
};
|
|
69430
|
+
}
|
|
69431
|
+
/**
|
|
69432
|
+
* @description 转化数据到报表
|
|
69433
|
+
* @param {IData[]} items
|
|
69434
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69435
|
+
* @memberof StackBarConverter
|
|
69436
|
+
*/
|
|
69437
|
+
translateDataToReport(items) {
|
|
69438
|
+
var _a3;
|
|
69439
|
+
const report = super.translateDataToReport(items);
|
|
69440
|
+
if (report) {
|
|
69441
|
+
const { model } = report;
|
|
69442
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69443
|
+
Object.assign(series.userParam, {
|
|
69444
|
+
"EC.stack": "stackcol"
|
|
69445
|
+
});
|
|
69446
|
+
});
|
|
69447
|
+
}
|
|
69448
|
+
return report;
|
|
69449
|
+
}
|
|
69450
|
+
};
|
|
69451
|
+
|
|
69452
|
+
// src/controller/control/report-panel/generator/bi-converter/multi-series-line-converter.ts
|
|
69453
|
+
var MultiSeriesLineConverter = class extends MultiSeriesConverter {
|
|
69454
|
+
constructor() {
|
|
69455
|
+
super(...arguments);
|
|
69456
|
+
/**
|
|
69457
|
+
* @description 仿真模型
|
|
69458
|
+
* @type {IModel}
|
|
69459
|
+
* @memberof MultiSeriesLineConverter
|
|
69460
|
+
*/
|
|
69461
|
+
this.mockModel = {
|
|
69462
|
+
userParam: {},
|
|
69463
|
+
dechartLegend: {
|
|
69464
|
+
id: "legend",
|
|
69465
|
+
showLegend: false,
|
|
69466
|
+
appId: this.appBIReport.appId
|
|
69467
|
+
},
|
|
69468
|
+
dechartTitle: {
|
|
69469
|
+
id: "title",
|
|
69470
|
+
showTitle: false,
|
|
69471
|
+
appId: this.appBIReport.appId
|
|
69472
|
+
},
|
|
69473
|
+
chartXAxises: [
|
|
69474
|
+
{
|
|
69475
|
+
id: "0",
|
|
69476
|
+
type: "category",
|
|
69477
|
+
position: "bottom",
|
|
69478
|
+
echartsPos: "xAxis",
|
|
69479
|
+
name: "axis_xAxis_0",
|
|
69480
|
+
echartsType: "category",
|
|
69481
|
+
appId: this.appBIReport.appId
|
|
69482
|
+
}
|
|
69483
|
+
],
|
|
69484
|
+
chartYAxises: [
|
|
69485
|
+
{
|
|
69486
|
+
id: "0",
|
|
69487
|
+
type: "numeric",
|
|
69488
|
+
position: "left",
|
|
69489
|
+
echartsPos: "yAxis",
|
|
69490
|
+
echartsType: "value",
|
|
69491
|
+
name: "axis_yAxis_0",
|
|
69492
|
+
appId: this.appBIReport.appId
|
|
69493
|
+
}
|
|
69494
|
+
],
|
|
69495
|
+
readOnly: true,
|
|
69496
|
+
autoLoad: true,
|
|
69497
|
+
dechartSerieses: [],
|
|
69498
|
+
controlType: "CHART",
|
|
69499
|
+
showBusyIndicator: true,
|
|
69500
|
+
id: this.appBIReport.id,
|
|
69501
|
+
name: this.appBIReport.id,
|
|
69502
|
+
appId: this.appBIReport.appId,
|
|
69503
|
+
codeName: this.appBIReport.id,
|
|
69504
|
+
caption: this.appBIReport.name,
|
|
69505
|
+
logicName: this.appBIReport.name,
|
|
69506
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69507
|
+
};
|
|
69508
|
+
/**
|
|
69509
|
+
* @description 仿真序列模型
|
|
69510
|
+
* @type {IModel}
|
|
69511
|
+
* @memberof MultiSeriesLineConverter
|
|
69512
|
+
*/
|
|
69513
|
+
this.mockSerieModel = {
|
|
69514
|
+
chartSeriesEncode: {
|
|
69515
|
+
id: "0",
|
|
69516
|
+
type: "XY",
|
|
69517
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69518
|
+
chartXAxisId: "0",
|
|
69519
|
+
chartYAxisId: "0",
|
|
69520
|
+
appId: this.appBIReport.appId
|
|
69521
|
+
},
|
|
69522
|
+
seriesType: "line",
|
|
69523
|
+
echartsType: "line",
|
|
69524
|
+
chartDataSetId: "0",
|
|
69525
|
+
seriesLayoutBy: "column",
|
|
69526
|
+
enableChartDataSet: true,
|
|
69527
|
+
chartCoordinateSystemId: "0",
|
|
69528
|
+
appId: this.appBIReport.appId
|
|
69529
|
+
};
|
|
69530
|
+
}
|
|
69531
|
+
/**
|
|
69532
|
+
* @description 获取标签参数
|
|
69533
|
+
* @param {IModel} seriesModel
|
|
69534
|
+
* @param {IData[]} items
|
|
69535
|
+
* @returns {*} {IData}
|
|
69536
|
+
* @memberof MultiSeriesLineConverter
|
|
69537
|
+
*/
|
|
69538
|
+
getChartLabelParams(seriesModel, items) {
|
|
69539
|
+
const { series_label_position } = this.reportUIModel;
|
|
69540
|
+
const options = super.getChartLabelParams(seriesModel, items);
|
|
69541
|
+
const tempObj = JSON.parse(options["EC.label"]);
|
|
69542
|
+
tempObj.position = series_label_position === "bottom" ? series_label_position : "top";
|
|
69543
|
+
return { "EC.label": JSON.stringify(tempObj) };
|
|
69544
|
+
}
|
|
69545
|
+
};
|
|
69546
|
+
|
|
69547
|
+
// src/controller/control/report-panel/generator/bi-converter/zone-line-converter.ts
|
|
69548
|
+
var ZoneLineConverter = class extends ZoneConverterBase {
|
|
69549
|
+
constructor() {
|
|
69550
|
+
super(...arguments);
|
|
69551
|
+
/**
|
|
69552
|
+
* @description 仿真模型
|
|
69553
|
+
* @type {IModel}
|
|
69554
|
+
* @memberof ZoneLineConverter
|
|
69555
|
+
*/
|
|
69556
|
+
this.mockModel = {
|
|
69557
|
+
userParam: {},
|
|
69558
|
+
dechartLegend: {
|
|
69559
|
+
id: "legend",
|
|
69560
|
+
showLegend: false,
|
|
69561
|
+
appId: this.appBIReport.appId
|
|
69562
|
+
},
|
|
69563
|
+
dechartTitle: {
|
|
69564
|
+
id: "title",
|
|
69565
|
+
showTitle: false,
|
|
69566
|
+
appId: this.appBIReport.appId
|
|
69567
|
+
},
|
|
69568
|
+
chartXAxises: [
|
|
69569
|
+
{
|
|
69570
|
+
id: "0",
|
|
69571
|
+
type: "category",
|
|
69572
|
+
position: "bottom",
|
|
69573
|
+
echartsPos: "xAxis",
|
|
69574
|
+
name: "axis_xAxis_0",
|
|
69575
|
+
echartsType: "category",
|
|
69576
|
+
appId: this.appBIReport.appId
|
|
69577
|
+
}
|
|
69578
|
+
],
|
|
69579
|
+
chartYAxises: [
|
|
69580
|
+
{
|
|
69581
|
+
id: "0",
|
|
69582
|
+
type: "numeric",
|
|
69583
|
+
position: "left",
|
|
69584
|
+
echartsPos: "yAxis",
|
|
69585
|
+
echartsType: "value",
|
|
69586
|
+
name: "axis_yAxis_0",
|
|
69587
|
+
appId: this.appBIReport.appId
|
|
69588
|
+
}
|
|
69589
|
+
],
|
|
69590
|
+
readOnly: true,
|
|
69591
|
+
autoLoad: true,
|
|
69592
|
+
dechartSerieses: [],
|
|
69593
|
+
controlType: "CHART",
|
|
69594
|
+
id: this.appBIReport.id,
|
|
69595
|
+
showBusyIndicator: true,
|
|
69596
|
+
name: this.appBIReport.id,
|
|
69597
|
+
appId: this.appBIReport.appId,
|
|
69598
|
+
codeName: this.appBIReport.id,
|
|
69599
|
+
caption: this.appBIReport.name,
|
|
69600
|
+
logicName: this.appBIReport.name,
|
|
69601
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69602
|
+
};
|
|
69603
|
+
/**
|
|
69604
|
+
* @description 仿真序列模型
|
|
69605
|
+
* @type {IModel}
|
|
69606
|
+
* @memberof ZoneLineConverter
|
|
69607
|
+
*/
|
|
69608
|
+
this.mockSerieModel = {
|
|
69609
|
+
chartSeriesEncode: {
|
|
69610
|
+
id: "0",
|
|
69611
|
+
type: "XY",
|
|
69612
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69613
|
+
chartXAxisId: "0",
|
|
69614
|
+
chartYAxisId: "0",
|
|
69615
|
+
appId: this.appBIReport.appId
|
|
69616
|
+
},
|
|
69617
|
+
seriesType: "line",
|
|
69618
|
+
echartsType: "line",
|
|
69619
|
+
chartDataSetId: "0",
|
|
69620
|
+
seriesLayoutBy: "column",
|
|
69621
|
+
enableChartDataSet: true,
|
|
69622
|
+
chartCoordinateSystemId: "0",
|
|
69623
|
+
appId: this.appBIReport.appId
|
|
69624
|
+
};
|
|
69625
|
+
}
|
|
69626
|
+
};
|
|
69627
|
+
|
|
69628
|
+
// src/controller/control/report-panel/generator/bi-converter/area-converter.ts
|
|
69629
|
+
var AreaConverter = class extends MultiSeriesConverter {
|
|
69630
|
+
constructor() {
|
|
69631
|
+
super(...arguments);
|
|
69632
|
+
/**
|
|
69633
|
+
* @description 仿真模型
|
|
69634
|
+
* @type {IModel}
|
|
69635
|
+
* @memberof AreaConverter
|
|
69636
|
+
*/
|
|
69637
|
+
this.mockModel = {
|
|
69638
|
+
userParam: {},
|
|
69639
|
+
dechartLegend: {
|
|
69640
|
+
id: "legend",
|
|
69641
|
+
showLegend: false,
|
|
69642
|
+
appId: this.appBIReport.appId
|
|
69643
|
+
},
|
|
69644
|
+
dechartTitle: {
|
|
69645
|
+
id: "title",
|
|
69646
|
+
showTitle: false,
|
|
69647
|
+
appId: this.appBIReport.appId
|
|
69648
|
+
},
|
|
69649
|
+
chartXAxises: [
|
|
69650
|
+
{
|
|
69651
|
+
id: "0",
|
|
69652
|
+
type: "category",
|
|
69653
|
+
position: "bottom",
|
|
69654
|
+
echartsPos: "xAxis",
|
|
69655
|
+
name: "axis_xAxis_0",
|
|
69656
|
+
echartsType: "category",
|
|
69657
|
+
appId: this.appBIReport.appId
|
|
69658
|
+
}
|
|
69659
|
+
],
|
|
69660
|
+
chartYAxises: [
|
|
69661
|
+
{
|
|
69662
|
+
id: "0",
|
|
69663
|
+
type: "numeric",
|
|
69664
|
+
position: "left",
|
|
69665
|
+
echartsPos: "yAxis",
|
|
69666
|
+
echartsType: "value",
|
|
69667
|
+
name: "axis_yAxis_0",
|
|
69668
|
+
appId: this.appBIReport.appId
|
|
69669
|
+
}
|
|
69670
|
+
],
|
|
69671
|
+
readOnly: true,
|
|
69672
|
+
autoLoad: true,
|
|
69673
|
+
dechartSerieses: [],
|
|
69674
|
+
controlType: "CHART",
|
|
69675
|
+
showBusyIndicator: true,
|
|
69676
|
+
id: this.appBIReport.id,
|
|
69677
|
+
name: this.appBIReport.id,
|
|
69678
|
+
appId: this.appBIReport.appId,
|
|
69679
|
+
codeName: this.appBIReport.id,
|
|
69680
|
+
caption: this.appBIReport.name,
|
|
69681
|
+
logicName: this.appBIReport.name,
|
|
69682
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69683
|
+
};
|
|
69684
|
+
/**
|
|
69685
|
+
* @description 仿真序列模型
|
|
69686
|
+
* @type {IModel}
|
|
69687
|
+
* @memberof AreaConverter
|
|
69688
|
+
*/
|
|
69689
|
+
this.mockSerieModel = {
|
|
69690
|
+
chartSeriesEncode: {
|
|
69691
|
+
id: "0",
|
|
69692
|
+
type: "XY",
|
|
69693
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
69694
|
+
chartXAxisId: "0",
|
|
69695
|
+
chartYAxisId: "0",
|
|
69696
|
+
appId: this.appBIReport.appId
|
|
69697
|
+
},
|
|
69698
|
+
seriesType: "line",
|
|
69699
|
+
echartsType: "line",
|
|
69700
|
+
chartDataSetId: "0",
|
|
69701
|
+
seriesLayoutBy: "column",
|
|
69702
|
+
enableChartDataSet: true,
|
|
69703
|
+
chartCoordinateSystemId: "0",
|
|
69704
|
+
appId: this.appBIReport.appId
|
|
69705
|
+
};
|
|
69706
|
+
}
|
|
69707
|
+
/**
|
|
69708
|
+
* @description 转化数据到报表
|
|
69709
|
+
* @param {IData[]} items
|
|
69710
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69711
|
+
* @memberof AreaConverter
|
|
69712
|
+
*/
|
|
69713
|
+
translateDataToReport(items) {
|
|
69714
|
+
var _a3;
|
|
69715
|
+
const report = super.translateDataToReport(items);
|
|
69716
|
+
if (report) {
|
|
69717
|
+
const { model } = report;
|
|
69718
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69719
|
+
Object.assign(series.userParam, {
|
|
69720
|
+
"EC.areaStyle": JSON.stringify({})
|
|
69721
|
+
});
|
|
69722
|
+
});
|
|
69723
|
+
}
|
|
69724
|
+
return report;
|
|
69725
|
+
}
|
|
69726
|
+
};
|
|
69727
|
+
|
|
69728
|
+
// src/controller/control/report-panel/generator/bi-converter/pie-converter.ts
|
|
69729
|
+
var PieConverter = class extends MultiSeriesConverter {
|
|
69730
|
+
constructor() {
|
|
69731
|
+
super(...arguments);
|
|
69732
|
+
/**
|
|
69733
|
+
* @description 仿真模型
|
|
69734
|
+
* @type {IModel}
|
|
69735
|
+
* @memberof PieConverter
|
|
69736
|
+
*/
|
|
69737
|
+
this.mockModel = {
|
|
69738
|
+
userParam: {},
|
|
69739
|
+
dechartLegend: {
|
|
69740
|
+
id: "legend",
|
|
69741
|
+
showLegend: false,
|
|
69742
|
+
appId: this.appBIReport.appId
|
|
69743
|
+
},
|
|
69744
|
+
dechartTitle: {
|
|
69745
|
+
id: "title",
|
|
69746
|
+
showTitle: false,
|
|
69747
|
+
appId: this.appBIReport.appId
|
|
69748
|
+
},
|
|
69749
|
+
readOnly: true,
|
|
69750
|
+
autoLoad: true,
|
|
69751
|
+
dechartSerieses: [],
|
|
69752
|
+
controlType: "CHART",
|
|
69753
|
+
id: this.appBIReport.id,
|
|
69754
|
+
showBusyIndicator: true,
|
|
69755
|
+
name: this.appBIReport.id,
|
|
69756
|
+
appId: this.appBIReport.appId,
|
|
69757
|
+
codeName: this.appBIReport.id,
|
|
69758
|
+
caption: this.appBIReport.name,
|
|
69759
|
+
logicName: this.appBIReport.name,
|
|
69760
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69761
|
+
};
|
|
69762
|
+
/**
|
|
69763
|
+
* @description 仿真序列模型
|
|
69764
|
+
* @type {IModel}
|
|
69765
|
+
* @memberof PieConverter
|
|
69766
|
+
*/
|
|
69767
|
+
this.mockSerieModel = {
|
|
69768
|
+
seriesType: "pie",
|
|
69769
|
+
echartsType: "pie",
|
|
69770
|
+
chartCoordinateSystemId: "0",
|
|
69771
|
+
chartDataSetId: "0",
|
|
69772
|
+
seriesLayoutBy: "column",
|
|
69773
|
+
enableChartDataSet: true,
|
|
69774
|
+
appId: this.appBIReport.appId
|
|
69775
|
+
};
|
|
69776
|
+
}
|
|
69777
|
+
/**
|
|
69778
|
+
* @description 转化数据到报表
|
|
69779
|
+
* @param {IData[]} items
|
|
69780
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69781
|
+
* @memberof PieConverter
|
|
69782
|
+
*/
|
|
69783
|
+
translateDataToReport(items) {
|
|
69784
|
+
var _a3;
|
|
69785
|
+
const report = super.translateDataToReport(items);
|
|
69786
|
+
if (!report)
|
|
69787
|
+
return;
|
|
69788
|
+
const { model } = report;
|
|
69789
|
+
const legendParams = this.getChartLegendParams();
|
|
69790
|
+
Object.assign(model.userParam, legendParams);
|
|
69791
|
+
const chartColorParams = this.getChartColorParams();
|
|
69792
|
+
Object.assign(model.userParam, chartColorParams);
|
|
69793
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69794
|
+
Object.assign(series, {
|
|
69795
|
+
userParam: {
|
|
69796
|
+
...this.getChartLabelParams(series, items)
|
|
69797
|
+
}
|
|
69798
|
+
});
|
|
69799
|
+
});
|
|
69800
|
+
return report;
|
|
69801
|
+
}
|
|
69802
|
+
/**
|
|
69803
|
+
* @description 获取标签参数
|
|
69804
|
+
* @param {IModel} seriesModel
|
|
69805
|
+
* @param {IData[]} items
|
|
69806
|
+
* @returns {*} {IData}
|
|
69807
|
+
* @memberof PieConverter
|
|
69808
|
+
*/
|
|
69809
|
+
getChartLabelParams(seriesModel, items) {
|
|
69810
|
+
const { series_label_data_range, series_label_percentage } = this.reportUIModel;
|
|
69811
|
+
const tempOption = super.getChartLabelParams(seriesModel, items);
|
|
69812
|
+
const options = JSON.parse(tempOption["EC.label"]);
|
|
69813
|
+
const labelLayoutOption = {};
|
|
69814
|
+
delete options.position;
|
|
69815
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
69816
|
+
const labelLayout = function(_params) {
|
|
69817
|
+
if (_params.text == "") {
|
|
69818
|
+
return {
|
|
69819
|
+
height: 0,
|
|
69820
|
+
labelLinePoints: [0, 0]
|
|
69821
|
+
};
|
|
69822
|
+
}
|
|
69823
|
+
};
|
|
69824
|
+
Object.assign(labelLayoutOption, { "EC.labelLayout": labelLayout });
|
|
69825
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
69826
|
+
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 }");
|
|
69827
|
+
}
|
|
69828
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
69829
|
+
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 }");
|
|
69830
|
+
}
|
|
69831
|
+
return {
|
|
69832
|
+
"EC.label": JSON.stringify(options),
|
|
69833
|
+
...labelLayoutOption
|
|
69834
|
+
};
|
|
69835
|
+
}
|
|
69836
|
+
};
|
|
69837
|
+
|
|
69838
|
+
// src/controller/control/report-panel/generator/bi-converter/radar-converter.ts
|
|
69839
|
+
var RadarConverter = class extends MultiSeriesConverter {
|
|
69840
|
+
constructor() {
|
|
69841
|
+
super(...arguments);
|
|
69842
|
+
/**
|
|
69843
|
+
* @description 仿真模型
|
|
69844
|
+
* @type {IModel}
|
|
69845
|
+
* @memberof RadarConverter
|
|
69846
|
+
*/
|
|
69847
|
+
this.mockModel = {
|
|
69848
|
+
userParam: {},
|
|
69849
|
+
dechartLegend: {
|
|
69850
|
+
id: "legend",
|
|
69851
|
+
showLegend: false,
|
|
69852
|
+
appId: this.appBIReport.appId
|
|
69853
|
+
},
|
|
69854
|
+
dechartTitle: {
|
|
69855
|
+
id: "title",
|
|
69856
|
+
showTitle: false,
|
|
69857
|
+
appId: this.appBIReport.appId
|
|
69858
|
+
},
|
|
69859
|
+
readOnly: true,
|
|
69860
|
+
autoLoad: true,
|
|
69861
|
+
dechartSerieses: [],
|
|
69862
|
+
controlType: "CHART",
|
|
69863
|
+
showBusyIndicator: true,
|
|
69864
|
+
id: this.appBIReport.id,
|
|
69865
|
+
name: this.appBIReport.id,
|
|
69866
|
+
appId: this.appBIReport.appId,
|
|
69867
|
+
codeName: this.appBIReport.id,
|
|
69868
|
+
caption: this.appBIReport.name,
|
|
69869
|
+
logicName: this.appBIReport.name,
|
|
69870
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
69871
|
+
};
|
|
69872
|
+
/**
|
|
69873
|
+
* @description 仿真序列模型
|
|
69874
|
+
* @type {IModel}
|
|
69875
|
+
* @memberof RadarConverter
|
|
69876
|
+
*/
|
|
69877
|
+
this.mockSerieModel = {
|
|
69878
|
+
echartsType: "radar",
|
|
69879
|
+
seriesType: "radar",
|
|
69880
|
+
chartDataSetId: "0",
|
|
69881
|
+
seriesLayoutBy: "column",
|
|
69882
|
+
enableChartDataSet: true,
|
|
69883
|
+
chartCoordinateSystemId: "0",
|
|
69884
|
+
appId: this.appBIReport.appId
|
|
69885
|
+
};
|
|
69886
|
+
}
|
|
69887
|
+
/**
|
|
69888
|
+
* @description 获取标签参数
|
|
69889
|
+
* @param {IModel} seriesModel
|
|
69890
|
+
* @param {IData[]} items
|
|
69891
|
+
* @returns {*} {IData}
|
|
69892
|
+
* @memberof RadarConverter
|
|
69893
|
+
*/
|
|
69894
|
+
getChartLabelParams(seriesModel, items) {
|
|
69895
|
+
const {
|
|
69896
|
+
series_label_show,
|
|
69897
|
+
series_label_fontstyle,
|
|
69898
|
+
series_label_fontsize,
|
|
69899
|
+
series_label_fontcolor,
|
|
69900
|
+
series_label_position,
|
|
69901
|
+
series_label_data_range
|
|
69902
|
+
} = this.reportUIModel;
|
|
69903
|
+
const options = {
|
|
69904
|
+
show: series_label_show == "1",
|
|
69905
|
+
position: series_label_position
|
|
69906
|
+
};
|
|
69907
|
+
if (series_label_fontstyle) {
|
|
69908
|
+
series_label_fontstyle === "bold" ? options.fontWeight = series_label_fontstyle : options.fontStyle = series_label_fontstyle;
|
|
69909
|
+
}
|
|
69910
|
+
if (series_label_fontsize) {
|
|
69911
|
+
options.fontSize = Number(series_label_fontsize);
|
|
69912
|
+
}
|
|
69913
|
+
if (series_label_fontcolor) {
|
|
69914
|
+
options.color = series_label_fontcolor;
|
|
69915
|
+
}
|
|
69916
|
+
if (series_label_data_range && series_label_data_range !== "all") {
|
|
69917
|
+
const { min, max: max2 } = this.calcMaxMin(seriesModel, items);
|
|
69918
|
+
options.formatter = "function(param) { \n if(param.value === ".concat(max2, " || param.value === ").concat(min, "){\n return param.value;\n }\n return '';\n }");
|
|
69919
|
+
}
|
|
69920
|
+
if (series_label_data_range && series_label_data_range === "all") {
|
|
69921
|
+
options.formatter = "function(param) {\n return param.value;\n }";
|
|
69922
|
+
}
|
|
69923
|
+
return { "EC.label": JSON.stringify(options) };
|
|
69924
|
+
}
|
|
69925
|
+
/**
|
|
69926
|
+
* @description 转化数据到报表
|
|
69927
|
+
* @param {IData[]} items
|
|
69928
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
69929
|
+
* @memberof RadarConverter
|
|
69930
|
+
*/
|
|
69931
|
+
translateDataToReport(items) {
|
|
69932
|
+
var _a3;
|
|
69933
|
+
const report = super.translateDataToReport(items);
|
|
69934
|
+
if (!report)
|
|
69935
|
+
return;
|
|
69936
|
+
const { model } = report;
|
|
69937
|
+
const chartColorParams = this.getChartColorParams();
|
|
69938
|
+
Object.assign(model.userParam, chartColorParams);
|
|
69939
|
+
const legendParams = this.getChartLegendParams();
|
|
69940
|
+
Object.assign(model.userParam, legendParams);
|
|
69941
|
+
(_a3 = model.dechartSerieses) == null ? void 0 : _a3.forEach((series) => {
|
|
69942
|
+
Object.assign(series, {
|
|
69943
|
+
userParam: {
|
|
69944
|
+
...this.getChartLabelParams(series, items),
|
|
69945
|
+
"EC.name": series.serieText
|
|
69946
|
+
}
|
|
69947
|
+
});
|
|
69948
|
+
});
|
|
69949
|
+
return report;
|
|
69950
|
+
}
|
|
69951
|
+
};
|
|
69952
|
+
|
|
69953
|
+
// src/controller/control/report-panel/generator/bi-converter/scatter-converter.ts
|
|
69954
|
+
var ScatterConverter = class extends MultiSeriesConverter {
|
|
69955
|
+
constructor() {
|
|
69956
|
+
super(...arguments);
|
|
69957
|
+
/**
|
|
69958
|
+
* @description 仿真模型
|
|
69959
|
+
* @type {IModel}
|
|
69960
|
+
* @memberof ScatterConverter
|
|
69961
|
+
*/
|
|
69962
|
+
this.mockModel = {
|
|
69963
|
+
userParam: {},
|
|
69964
|
+
dechartLegend: {
|
|
69965
|
+
id: "legend",
|
|
69966
|
+
showLegend: false,
|
|
69967
|
+
appId: this.appBIReport.appId
|
|
69968
|
+
},
|
|
69969
|
+
dechartTitle: {
|
|
69970
|
+
id: "title",
|
|
69971
|
+
showTitle: false,
|
|
69972
|
+
appId: this.appBIReport.appId
|
|
69973
|
+
},
|
|
69974
|
+
chartXAxises: [
|
|
69975
|
+
{
|
|
69976
|
+
id: "0",
|
|
69977
|
+
type: "category",
|
|
69978
|
+
position: "bottom",
|
|
69979
|
+
echartsPos: "xAxis",
|
|
69980
|
+
name: "axis_xAxis_0",
|
|
69981
|
+
echartsType: "category",
|
|
69982
|
+
appId: this.appBIReport.appId
|
|
69983
|
+
}
|
|
69984
|
+
],
|
|
69985
|
+
chartYAxises: [
|
|
69986
|
+
{
|
|
69987
|
+
id: "0",
|
|
69988
|
+
type: "numeric",
|
|
69989
|
+
position: "left",
|
|
69990
|
+
echartsPos: "yAxis",
|
|
69991
|
+
echartsType: "value",
|
|
69992
|
+
name: "axis_yAxis_0",
|
|
69993
|
+
appId: this.appBIReport.appId
|
|
69994
|
+
}
|
|
69995
|
+
],
|
|
69996
|
+
readOnly: true,
|
|
69997
|
+
autoLoad: true,
|
|
69998
|
+
dechartSerieses: [],
|
|
69999
|
+
controlType: "CHART",
|
|
70000
|
+
id: this.appBIReport.id,
|
|
70001
|
+
showBusyIndicator: true,
|
|
70002
|
+
name: this.appBIReport.id,
|
|
70003
|
+
appId: this.appBIReport.appId,
|
|
70004
|
+
codeName: this.appBIReport.id,
|
|
70005
|
+
caption: this.appBIReport.name,
|
|
70006
|
+
logicName: this.appBIReport.name,
|
|
70007
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70008
|
+
};
|
|
70009
|
+
/**
|
|
70010
|
+
* @description 仿真序列模型
|
|
70011
|
+
* @type {IModel}
|
|
70012
|
+
* @memberof ScatterConverter
|
|
70013
|
+
*/
|
|
70014
|
+
this.mockSerieModel = {
|
|
70015
|
+
chartSeriesEncode: {
|
|
70016
|
+
id: "0",
|
|
70017
|
+
type: "XY",
|
|
70018
|
+
name: "\u5750\u6807\u7CFB\u7F16\u7801",
|
|
70019
|
+
chartXAxisId: "0",
|
|
70020
|
+
chartYAxisId: "0",
|
|
70021
|
+
appId: this.appBIReport.appId
|
|
70022
|
+
},
|
|
70023
|
+
chartDataSetId: "0",
|
|
70024
|
+
seriesType: "scatter",
|
|
70025
|
+
echartsType: "scatter",
|
|
70026
|
+
seriesLayoutBy: "column",
|
|
70027
|
+
enableChartDataSet: true,
|
|
70028
|
+
chartCoordinateSystemId: "0",
|
|
70029
|
+
appId: this.appBIReport.appId
|
|
70030
|
+
};
|
|
70031
|
+
}
|
|
70032
|
+
/**
|
|
70033
|
+
* @description 获取标签参数
|
|
70034
|
+
* @param {IModel} seriesModel
|
|
70035
|
+
* @param {IData[]} items
|
|
70036
|
+
* @returns {*} {IData}
|
|
70037
|
+
* @memberof ScatterConverter
|
|
70038
|
+
*/
|
|
70039
|
+
getChartLabelParams(seriesModel, items) {
|
|
70040
|
+
const options = super.getChartLabelParams(seriesModel, items);
|
|
70041
|
+
const tempObj = JSON.parse(options["EC.label"]);
|
|
70042
|
+
tempObj.position = "top";
|
|
70043
|
+
return { "EC.label": JSON.stringify(tempObj) };
|
|
70044
|
+
}
|
|
70045
|
+
};
|
|
70046
|
+
|
|
70047
|
+
// src/controller/control/report-panel/generator/bi-converter/grid-converter.ts
|
|
70048
|
+
import { clone as clone53 } from "ramda";
|
|
70049
|
+
var GridConverter = class extends GridConverterBase {
|
|
70050
|
+
constructor() {
|
|
70051
|
+
super(...arguments);
|
|
70052
|
+
/**
|
|
70053
|
+
* @description 仿真模型
|
|
70054
|
+
* @type {IModel}
|
|
70055
|
+
* @memberof GridConverter
|
|
70056
|
+
*/
|
|
70057
|
+
this.mockModel = {
|
|
70058
|
+
controlParam: { id: this.appBIReport.id, appId: this.appBIReport.appId },
|
|
70059
|
+
fetchControlAction: {
|
|
70060
|
+
id: "fetch",
|
|
70061
|
+
appDEMethodId: "fetchdefault",
|
|
70062
|
+
appId: this.appBIReport.appId,
|
|
70063
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70064
|
+
},
|
|
70065
|
+
pagingMode: 1,
|
|
70066
|
+
autoLoad: true,
|
|
70067
|
+
pagingSize: 20,
|
|
70068
|
+
aggMode: "NONE",
|
|
70069
|
+
groupMode: "NONE",
|
|
70070
|
+
sortMode: "REMOTE",
|
|
70071
|
+
singleSelect: true,
|
|
70072
|
+
columnEnableLink: 2,
|
|
70073
|
+
controlType: "GRID",
|
|
70074
|
+
columnEnableFilter: 2,
|
|
70075
|
+
modelType: "PSDEGRID",
|
|
70076
|
+
enablePagingBar: false,
|
|
70077
|
+
enableCustomized: false,
|
|
70078
|
+
showBusyIndicator: true,
|
|
70079
|
+
id: this.appBIReport.id,
|
|
70080
|
+
name: this.appBIReport.id,
|
|
70081
|
+
modelId: this.appBIReport.id,
|
|
70082
|
+
codeName: this.appBIReport.id,
|
|
70083
|
+
appId: this.appBIReport.appId,
|
|
70084
|
+
logicName: this.appBIReport.name,
|
|
70085
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70086
|
+
};
|
|
70087
|
+
}
|
|
70088
|
+
/**
|
|
70089
|
+
* @description 计算表格列模型
|
|
70090
|
+
* @returns {*} {IModel[]}
|
|
70091
|
+
* @memberof GridConverter
|
|
70092
|
+
*/
|
|
70093
|
+
calcGridColumns() {
|
|
70094
|
+
const deGridColumns = [];
|
|
70095
|
+
if (this.dimensions.length > 0) {
|
|
70096
|
+
deGridColumns.push(
|
|
70097
|
+
...this.dimensions.map((item) => {
|
|
70098
|
+
const codeName = item.dimensionTag.toLowerCase();
|
|
70099
|
+
return {
|
|
70100
|
+
width: 150,
|
|
70101
|
+
id: codeName,
|
|
70102
|
+
widthUnit: "STAR",
|
|
70103
|
+
enableSort: false,
|
|
70104
|
+
codeName,
|
|
70105
|
+
measureTag: codeName,
|
|
70106
|
+
dataItemName: codeName,
|
|
70107
|
+
appDEFieldId: codeName,
|
|
70108
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70109
|
+
caption: item.dimensionName,
|
|
70110
|
+
appId: this.appBIReport.appId,
|
|
70111
|
+
appCodeListId: item.appCodeListId,
|
|
70112
|
+
...this.calcGridColumnStyle(false)
|
|
70113
|
+
};
|
|
70114
|
+
})
|
|
70115
|
+
);
|
|
70116
|
+
}
|
|
70117
|
+
if (this.measures.length > 0) {
|
|
70118
|
+
deGridColumns.push(
|
|
70119
|
+
...this.measures.map((item) => {
|
|
70120
|
+
const codeName = item.measureTag.toLowerCase();
|
|
70121
|
+
return {
|
|
70122
|
+
width: 150,
|
|
70123
|
+
id: codeName,
|
|
70124
|
+
widthUnit: "STAR",
|
|
70125
|
+
enableSort: false,
|
|
70126
|
+
codeName,
|
|
70127
|
+
valueType: "SIMPLE",
|
|
70128
|
+
measureTag: codeName,
|
|
70129
|
+
dataItemName: codeName,
|
|
70130
|
+
appDEFieldId: codeName,
|
|
70131
|
+
format: item.jsonFormat,
|
|
70132
|
+
caption: item.measureName,
|
|
70133
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70134
|
+
appId: this.appBIReport.appId,
|
|
70135
|
+
appCodeListId: item.appCodeListId,
|
|
70136
|
+
...this.calcGridColumnStyle()
|
|
70137
|
+
};
|
|
70138
|
+
})
|
|
70139
|
+
);
|
|
70140
|
+
}
|
|
70141
|
+
return deGridColumns;
|
|
70142
|
+
}
|
|
70143
|
+
/**
|
|
70144
|
+
* @description 计算表格数据项
|
|
70145
|
+
* @param {IModel[]} gridColumns
|
|
70146
|
+
* @returns {*} {IModel[]}
|
|
70147
|
+
* @memberof GridConverter
|
|
70148
|
+
*/
|
|
70149
|
+
calcGridDataItems(gridColumns) {
|
|
70150
|
+
const deGridDataItems = [];
|
|
70151
|
+
gridColumns.forEach((column) => {
|
|
70152
|
+
deGridDataItems.push({
|
|
70153
|
+
dataType: 25,
|
|
70154
|
+
id: column.id,
|
|
70155
|
+
valueType: "SIMPLE",
|
|
70156
|
+
format: column.format,
|
|
70157
|
+
appId: this.appBIReport.appId,
|
|
70158
|
+
measureTag: column.measureTag
|
|
70159
|
+
});
|
|
70160
|
+
if (column.columnType === "GROUPGRIDCOLUMN")
|
|
70161
|
+
deGridDataItems.push(...this.calcGridDataItems(column.degridColumns));
|
|
70162
|
+
});
|
|
70163
|
+
return deGridDataItems;
|
|
70164
|
+
}
|
|
70165
|
+
/**
|
|
70166
|
+
* @description 转化数据到报表
|
|
70167
|
+
* @param {IData[]} items
|
|
70168
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
70169
|
+
* @memberof GridConverter
|
|
70170
|
+
*/
|
|
70171
|
+
translateDataToReport(items) {
|
|
70172
|
+
if (!this.measures)
|
|
70173
|
+
return;
|
|
70174
|
+
const tempModel = clone53(this.mockModel);
|
|
70175
|
+
const degridColumns = this.calcGridColumns();
|
|
70176
|
+
const degridDataItems = this.calcGridDataItems(degridColumns);
|
|
70177
|
+
Object.assign(tempModel, { degridColumns, degridDataItems });
|
|
70178
|
+
const { vars, classList, model } = this.getGridStyle();
|
|
70179
|
+
Object.assign(tempModel, model);
|
|
70180
|
+
const spanMethod = this.calcGridColumnMerge(items);
|
|
70181
|
+
Object.assign(tempModel, spanMethod);
|
|
70182
|
+
return {
|
|
70183
|
+
data: items,
|
|
70184
|
+
model: tempModel,
|
|
70185
|
+
options: { vars, classList }
|
|
70186
|
+
};
|
|
70187
|
+
}
|
|
70188
|
+
};
|
|
70189
|
+
|
|
70190
|
+
// src/controller/control/report-panel/generator/bi-converter/cross-table-converter.ts
|
|
70191
|
+
import { clone as clone54, plus as plus5 } from "@ibiz-template/core";
|
|
70192
|
+
var CrossTableConverter = class extends GridConverterBase {
|
|
70193
|
+
constructor() {
|
|
70194
|
+
super(...arguments);
|
|
70195
|
+
/**
|
|
70196
|
+
* @description 仿真模型
|
|
70197
|
+
* @type {IModel}
|
|
70198
|
+
* @memberof CrossTableConverter
|
|
70199
|
+
*/
|
|
70200
|
+
this.mockModel = {
|
|
70201
|
+
fetchControlAction: {
|
|
70202
|
+
id: "fetch",
|
|
70203
|
+
appDEMethodId: "fetchdefault",
|
|
70204
|
+
appId: this.appBIReport.appId,
|
|
70205
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70206
|
+
},
|
|
70207
|
+
controlParam: { id: this.appBIReport.id, appId: this.appBIReport.appId },
|
|
70208
|
+
pagingMode: 1,
|
|
70209
|
+
pagingSize: 20,
|
|
70210
|
+
autoLoad: true,
|
|
70211
|
+
aggMode: "NONE",
|
|
70212
|
+
gridStyle: "USER",
|
|
70213
|
+
groupMode: "NONE",
|
|
70214
|
+
sortMode: "REMOTE",
|
|
70215
|
+
singleSelect: true,
|
|
70216
|
+
controlType: "GRID",
|
|
70217
|
+
columnEnableLink: 2,
|
|
70218
|
+
modelType: "PSDEGRID",
|
|
70219
|
+
columnEnableFilter: 2,
|
|
70220
|
+
enablePagingBar: false,
|
|
70221
|
+
id: this.appBIReport.id,
|
|
70222
|
+
showBusyIndicator: true,
|
|
70223
|
+
enableCustomized: false,
|
|
70224
|
+
name: this.appBIReport.id,
|
|
70225
|
+
modelId: this.appBIReport.id,
|
|
70226
|
+
appId: this.appBIReport.appId,
|
|
70227
|
+
codeName: this.appBIReport.id,
|
|
70228
|
+
logicName: this.appBIReport.name,
|
|
70229
|
+
appDataEntityId: this.appBIReport.appDataEntityId
|
|
70230
|
+
};
|
|
70231
|
+
/**
|
|
70232
|
+
* @description 百分比数据
|
|
70233
|
+
* @type {string[]}
|
|
70234
|
+
* @memberof CrossTableConverter
|
|
70235
|
+
*/
|
|
70236
|
+
this.percentKeys = [];
|
|
70237
|
+
/**
|
|
70238
|
+
* @description 合计列标识
|
|
70239
|
+
* @type {string}
|
|
70240
|
+
* @memberof CrossTableConverter
|
|
70241
|
+
*/
|
|
70242
|
+
this.totalColTag = "col_sum";
|
|
70243
|
+
/**
|
|
70244
|
+
* @description 指标总数
|
|
70245
|
+
* @type {IData}
|
|
70246
|
+
* @memberof CrossTableConverter
|
|
70247
|
+
*/
|
|
70248
|
+
this.measuresTotalResult = {};
|
|
70249
|
+
}
|
|
70250
|
+
/**
|
|
70251
|
+
* @description 初始化
|
|
70252
|
+
* @protected
|
|
70253
|
+
* @returns {*} {Promise<void>}
|
|
70254
|
+
* @memberof CrossTableConverter
|
|
70255
|
+
*/
|
|
70256
|
+
async onInit() {
|
|
70257
|
+
var _a3;
|
|
70258
|
+
const { appBIReportDimensions } = this.appBIReport;
|
|
70259
|
+
this.dimensions = (appBIReportDimensions == null ? void 0 : appBIReportDimensions.filter((dimension) => !dimension.placement)) || [];
|
|
70260
|
+
this.dimensionCol = appBIReportDimensions == null ? void 0 : appBIReportDimensions.find(
|
|
70261
|
+
(dimension) => dimension.placement === "COLHEADER"
|
|
70262
|
+
);
|
|
70263
|
+
if ((_a3 = this.dimensionCol) == null ? void 0 : _a3.appCodeListId) {
|
|
70264
|
+
const app = ibiz.hub.getApp(this.appBIReport.appId);
|
|
70265
|
+
this.codelistItems = await app.codeList.get(
|
|
70266
|
+
this.dimensionCol.appCodeListId,
|
|
70267
|
+
this.context,
|
|
70268
|
+
this.params
|
|
70269
|
+
);
|
|
70270
|
+
}
|
|
70271
|
+
}
|
|
70272
|
+
/**
|
|
70273
|
+
* @description 计算维度(列)
|
|
70274
|
+
* @param {IData[]} items
|
|
70275
|
+
* @returns {*} {string[]}
|
|
70276
|
+
* @memberof CrossTableConverter
|
|
70277
|
+
*/
|
|
70278
|
+
calcDimensionCols(items) {
|
|
70279
|
+
if (!this.dimensionCol)
|
|
70280
|
+
return [];
|
|
70281
|
+
if (this.codelistItems)
|
|
70282
|
+
return this.codelistItems.map((item) => item.value);
|
|
70283
|
+
const result = /* @__PURE__ */ new Set();
|
|
70284
|
+
const dimensionTag = this.dimensionCol.dimensionTag.toLowerCase();
|
|
70285
|
+
let hasBlank = false;
|
|
70286
|
+
for (const item of items) {
|
|
70287
|
+
const value = item[dimensionTag];
|
|
70288
|
+
if (!value) {
|
|
70289
|
+
hasBlank = true;
|
|
70290
|
+
} else {
|
|
70291
|
+
result.add(value);
|
|
70292
|
+
}
|
|
70293
|
+
}
|
|
70294
|
+
const resultArray = Array.from(result);
|
|
70295
|
+
if (hasBlank)
|
|
70296
|
+
resultArray.push("");
|
|
70297
|
+
return resultArray;
|
|
70298
|
+
}
|
|
70299
|
+
/**
|
|
70300
|
+
* 通过指标计算表格列
|
|
67884
70301
|
*
|
|
67885
70302
|
* @author tony001
|
|
67886
|
-
* @date 2024-
|
|
67887
|
-
* @
|
|
70303
|
+
* @date 2024-12-19 17:12:52
|
|
70304
|
+
* @param {IData} data
|
|
70305
|
+
* @param {string} [type]
|
|
70306
|
+
* @return {*} {IModel[]}
|
|
70307
|
+
*/
|
|
70308
|
+
clacMeasureColumns(parentName) {
|
|
70309
|
+
return this.measures.map((item) => {
|
|
70310
|
+
let codeName = item.measureTag.toLowerCase();
|
|
70311
|
+
if (parentName)
|
|
70312
|
+
codeName = "".concat(parentName, "@").concat(codeName);
|
|
70313
|
+
const totalCodename = "".concat(this.totalColTag, "@").concat(codeName);
|
|
70314
|
+
this.percentKeys.push(codeName);
|
|
70315
|
+
return {
|
|
70316
|
+
codeName,
|
|
70317
|
+
width: 150,
|
|
70318
|
+
id: codeName,
|
|
70319
|
+
totalCodename,
|
|
70320
|
+
widthUnit: "STAR",
|
|
70321
|
+
valueType: "SIMPLE",
|
|
70322
|
+
measureTag: codeName,
|
|
70323
|
+
dataItemName: codeName,
|
|
70324
|
+
appDEFieldId: codeName,
|
|
70325
|
+
format: item.jsonFormat,
|
|
70326
|
+
caption: item.measureName,
|
|
70327
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70328
|
+
appId: this.appBIReport.appId,
|
|
70329
|
+
appCodeListId: item.appCodeListId,
|
|
70330
|
+
...this.calcGridColumnStyle()
|
|
70331
|
+
};
|
|
70332
|
+
});
|
|
70333
|
+
}
|
|
70334
|
+
/**
|
|
70335
|
+
* @description 计算合计表格列
|
|
70336
|
+
* @param {string} position
|
|
70337
|
+
* @param {IModel[]} degridColumns
|
|
70338
|
+
* @memberof CrossTableConverter
|
|
70339
|
+
*/
|
|
70340
|
+
calcAggGridCol(position, degridColumns) {
|
|
70341
|
+
const { grid_show_agg, grid_agg_col_position } = this.reportUIModel;
|
|
70342
|
+
if (this.dimensionCol && grid_show_agg == "1" && grid_agg_col_position === position) {
|
|
70343
|
+
const children = this.clacMeasureColumns(this.totalColTag);
|
|
70344
|
+
const column = {
|
|
70345
|
+
caption: "\u5408\u8BA1",
|
|
70346
|
+
id: this.totalColTag,
|
|
70347
|
+
degridColumns: children,
|
|
70348
|
+
codeName: this.totalColTag,
|
|
70349
|
+
measureTag: this.totalColTag,
|
|
70350
|
+
appId: this.appBIReport.appId,
|
|
70351
|
+
columnType: "GROUPGRIDCOLUMN",
|
|
70352
|
+
dataItemName: this.totalColTag
|
|
70353
|
+
};
|
|
70354
|
+
degridColumns.push(column);
|
|
70355
|
+
}
|
|
70356
|
+
}
|
|
70357
|
+
/**
|
|
70358
|
+
* @description 计算合计列数据
|
|
70359
|
+
* @param {IData[]} items
|
|
70360
|
+
* @memberof CrossTableConverter
|
|
70361
|
+
*/
|
|
70362
|
+
calcAggTotalData(items) {
|
|
70363
|
+
this.measures.forEach((measure) => {
|
|
70364
|
+
const codeName = "".concat(this.totalColTag, "@").concat(measure.measureTag.toLowerCase());
|
|
70365
|
+
this.measuresTotalResult[codeName] = 0;
|
|
70366
|
+
});
|
|
70367
|
+
items.forEach((item) => {
|
|
70368
|
+
this.measures.forEach((measure) => {
|
|
70369
|
+
const codeName = "".concat(this.totalColTag, "@").concat(measure.measureTag.toLowerCase());
|
|
70370
|
+
const total = this.percentKeys.reduce((a, b) => {
|
|
70371
|
+
const bvalue = Number(item[b]) || 0;
|
|
70372
|
+
return plus5(a, bvalue);
|
|
70373
|
+
}, 0);
|
|
70374
|
+
this.measuresTotalResult[codeName] += total;
|
|
70375
|
+
item[codeName] = total;
|
|
70376
|
+
});
|
|
70377
|
+
});
|
|
70378
|
+
}
|
|
70379
|
+
/**
|
|
70380
|
+
* @description 计算交叉表
|
|
70381
|
+
* @param {string[]} dimensionCols 维度列
|
|
70382
|
+
* @returns {*} {IModel[]}
|
|
70383
|
+
* @memberof CrossTableConverter
|
|
70384
|
+
*/
|
|
70385
|
+
calcCrossTableColumns(dimensionCols) {
|
|
70386
|
+
const deGridColumns = [];
|
|
70387
|
+
if (this.dimensions) {
|
|
70388
|
+
deGridColumns.push(
|
|
70389
|
+
...this.dimensions.map((item) => {
|
|
70390
|
+
const codeName = item.dimensionTag.toLowerCase();
|
|
70391
|
+
return {
|
|
70392
|
+
codeName,
|
|
70393
|
+
width: 150,
|
|
70394
|
+
id: codeName,
|
|
70395
|
+
widthUnit: "STAR",
|
|
70396
|
+
measureTag: codeName,
|
|
70397
|
+
appDEFieldId: codeName,
|
|
70398
|
+
dataItemName: codeName,
|
|
70399
|
+
caption: item.dimensionName,
|
|
70400
|
+
columnType: "DEFGRIDCOLUMN",
|
|
70401
|
+
appId: this.appBIReport.appId,
|
|
70402
|
+
appCodeListId: item.appCodeListId,
|
|
70403
|
+
...this.calcGridColumnStyle(false)
|
|
70404
|
+
};
|
|
70405
|
+
})
|
|
70406
|
+
);
|
|
70407
|
+
}
|
|
70408
|
+
this.calcAggGridCol("left", deGridColumns);
|
|
70409
|
+
if (this.dimensionCol) {
|
|
70410
|
+
const codeNme = this.dimensionCol.dimensionTag.toLowerCase();
|
|
70411
|
+
const groupColumns = dimensionCols.map((key, index) => {
|
|
70412
|
+
var _a3, _b2;
|
|
70413
|
+
const children = this.clacMeasureColumns(key);
|
|
70414
|
+
return {
|
|
70415
|
+
degridColumns: children,
|
|
70416
|
+
id: "".concat(codeNme, "-").concat(index),
|
|
70417
|
+
appId: this.appBIReport.appId,
|
|
70418
|
+
columnType: "GROUPGRIDCOLUMN",
|
|
70419
|
+
codeName: "".concat(codeNme, "-").concat(index),
|
|
70420
|
+
measureTag: "".concat(codeNme, "-").concat(index),
|
|
70421
|
+
dataItemName: "".concat(codeNme, "-").concat(index),
|
|
70422
|
+
appDEFieldId: "".concat(codeNme, "-").concat(index),
|
|
70423
|
+
appCodeListId: this.dimensionCol.appCodeListId,
|
|
70424
|
+
caption: ((_b2 = (_a3 = this.codelistItems) == null ? void 0 : _a3.find((item) => item.value == key)) == null ? void 0 : _b2.text) || key
|
|
70425
|
+
};
|
|
70426
|
+
});
|
|
70427
|
+
deGridColumns.push(...groupColumns);
|
|
70428
|
+
} else {
|
|
70429
|
+
const children = this.clacMeasureColumns();
|
|
70430
|
+
deGridColumns.push(...children);
|
|
70431
|
+
}
|
|
70432
|
+
this.calcAggGridCol("right", deGridColumns);
|
|
70433
|
+
return deGridColumns;
|
|
70434
|
+
}
|
|
70435
|
+
/**
|
|
70436
|
+
* @description 获取数据项
|
|
70437
|
+
* @param {IData[]} items
|
|
70438
|
+
* @param {IData} item
|
|
70439
|
+
* @returns {*} {(IData | undefined)}
|
|
70440
|
+
* @memberof CrossTableConverter
|
|
70441
|
+
*/
|
|
70442
|
+
getItem(items, item) {
|
|
70443
|
+
return items.find((x) => {
|
|
70444
|
+
return this.dimensions.findIndex(
|
|
70445
|
+
(c) => x[c.dimensionTag.toLowerCase()] !== item[c.dimensionTag.toLowerCase()]
|
|
70446
|
+
) === -1;
|
|
70447
|
+
});
|
|
70448
|
+
}
|
|
70449
|
+
/**
|
|
70450
|
+
* @description 计算交叉表数据
|
|
70451
|
+
* @param {IData[]} items
|
|
70452
|
+
* @returns {*} {IData[]}
|
|
70453
|
+
* @memberof CrossTableConverter
|
|
70454
|
+
*/
|
|
70455
|
+
calcCrossTableData(items) {
|
|
70456
|
+
if (this.dimensionCol) {
|
|
70457
|
+
const result = [];
|
|
70458
|
+
const codeName = this.dimensionCol.dimensionTag.toLowerCase();
|
|
70459
|
+
items.forEach((item) => {
|
|
70460
|
+
this.measures.forEach((_item) => {
|
|
70461
|
+
const type = _item.measureTag.toLowerCase() || "";
|
|
70462
|
+
const value = item[codeName];
|
|
70463
|
+
let key = type || "";
|
|
70464
|
+
if (value)
|
|
70465
|
+
key = "".concat(value, "@").concat(type);
|
|
70466
|
+
const oldData = this.getItem(result, item);
|
|
70467
|
+
if (oldData) {
|
|
70468
|
+
oldData[key] = item[type];
|
|
70469
|
+
} else {
|
|
70470
|
+
const newItem = { [key]: item[type] };
|
|
70471
|
+
this.dimensions.forEach((x) => {
|
|
70472
|
+
newItem[x.dimensionTag.toLowerCase()] = item[x.dimensionTag.toLowerCase()];
|
|
70473
|
+
});
|
|
70474
|
+
result.push(newItem);
|
|
70475
|
+
}
|
|
70476
|
+
});
|
|
70477
|
+
});
|
|
70478
|
+
return result;
|
|
70479
|
+
}
|
|
70480
|
+
return items;
|
|
70481
|
+
}
|
|
70482
|
+
/**
|
|
70483
|
+
* @description 计算交叉表数据项
|
|
70484
|
+
* @param {IData[]} columns
|
|
70485
|
+
* @returns {*} {IModel[]}
|
|
70486
|
+
* @memberof CrossTableConverter
|
|
70487
|
+
*/
|
|
70488
|
+
calcCrossTableDataItems(columns) {
|
|
70489
|
+
const degridDataItems = [];
|
|
70490
|
+
const { grid_function_setting } = this.reportUIModel;
|
|
70491
|
+
columns.forEach((column) => {
|
|
70492
|
+
const otherParams = {};
|
|
70493
|
+
if (column.totalCodename && this.measuresTotalResult[column.totalCodename]) {
|
|
70494
|
+
if (grid_function_setting && grid_function_setting.indexOf("showPercent") !== -1) {
|
|
70495
|
+
otherParams.customCode = true;
|
|
70496
|
+
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 }");
|
|
70497
|
+
} else {
|
|
70498
|
+
otherParams.customCode = true;
|
|
70499
|
+
otherParams.scriptCode = "\n if (Object.prototype.hasOwnProperty.call(data, '".concat(column.measureTag, "')) {\n let formatValue = data['").concat(column.measureTag, "'];\n return formatValue\n }");
|
|
70500
|
+
}
|
|
70501
|
+
}
|
|
70502
|
+
degridDataItems.push({
|
|
70503
|
+
dataType: 25,
|
|
70504
|
+
id: column.id,
|
|
70505
|
+
valueType: "SIMPLE",
|
|
70506
|
+
format: column.format,
|
|
70507
|
+
measureTag: column.measureTag,
|
|
70508
|
+
appId: this.appBIReport.appId,
|
|
70509
|
+
...otherParams
|
|
70510
|
+
});
|
|
70511
|
+
if (column.columnType === "GROUPGRIDCOLUMN")
|
|
70512
|
+
degridDataItems.push(
|
|
70513
|
+
...this.calcCrossTableDataItems(column.degridColumns)
|
|
70514
|
+
);
|
|
70515
|
+
});
|
|
70516
|
+
return degridDataItems;
|
|
70517
|
+
}
|
|
70518
|
+
/**
|
|
70519
|
+
* @description 转化数据到报表
|
|
70520
|
+
* @param {IData[]} items
|
|
70521
|
+
* @returns {*} {({ model: IModel; options: IData; data: IData[] } | undefined)}
|
|
70522
|
+
* @memberof CrossTableConverter
|
|
70523
|
+
*/
|
|
70524
|
+
translateDataToReport(items) {
|
|
70525
|
+
if (!this.measures)
|
|
70526
|
+
return;
|
|
70527
|
+
const tempModel = clone54(this.mockModel);
|
|
70528
|
+
const dimensionCols = this.calcDimensionCols(items);
|
|
70529
|
+
const degridColumns = this.calcCrossTableColumns(dimensionCols);
|
|
70530
|
+
const mockDatas = this.calcCrossTableData(items);
|
|
70531
|
+
this.calcAggTotalData(mockDatas);
|
|
70532
|
+
const degridDataItems = this.calcCrossTableDataItems(degridColumns);
|
|
70533
|
+
Object.assign(tempModel, { degridColumns, degridDataItems });
|
|
70534
|
+
const { vars, classList, model } = this.getGridStyle();
|
|
70535
|
+
Object.assign(tempModel, model);
|
|
70536
|
+
const spanMethod = this.calcGridColumnMerge(mockDatas);
|
|
70537
|
+
Object.assign(tempModel, spanMethod);
|
|
70538
|
+
return { model: tempModel, options: { vars, classList }, data: mockDatas };
|
|
70539
|
+
}
|
|
70540
|
+
};
|
|
70541
|
+
|
|
70542
|
+
// src/controller/control/report-panel/generator/bi-converter/converter-factory.ts
|
|
70543
|
+
var ConverterFactory = class {
|
|
70544
|
+
/**
|
|
70545
|
+
* @description 创建转换器
|
|
70546
|
+
* @static
|
|
70547
|
+
* @param {('NUMBER'
|
|
70548
|
+
* | 'GAUGE'
|
|
70549
|
+
* | 'MULTI_SERIES_COL'
|
|
70550
|
+
* | 'STACK_COL'
|
|
70551
|
+
* | 'ZONE_COL'
|
|
70552
|
+
* | 'MULTI_SERIES_BAR'
|
|
70553
|
+
* | 'STACK_BAR'
|
|
70554
|
+
* | 'MULTI_SERIES_LINE'
|
|
70555
|
+
* | 'ZONE_LINE'
|
|
70556
|
+
* | 'AREA'
|
|
70557
|
+
* | 'GRID'
|
|
70558
|
+
* | 'CROSSTABLE'
|
|
70559
|
+
* | 'PIE'
|
|
70560
|
+
* | 'RADAR'
|
|
70561
|
+
* | 'SCATTER')} chartType
|
|
70562
|
+
* @returns {*} {(BaseConverter | undefined)}
|
|
70563
|
+
* @memberof ConverterFactory
|
|
70564
|
+
*/
|
|
70565
|
+
static createConverter(chartType, model, context, params) {
|
|
70566
|
+
switch (chartType) {
|
|
70567
|
+
case "NUMBER":
|
|
70568
|
+
return new NumberConverter(model, context, params);
|
|
70569
|
+
case "GAUGE":
|
|
70570
|
+
return new GaugeConverter(model, context, params);
|
|
70571
|
+
case "MULTI_SERIES_COL":
|
|
70572
|
+
return new MultiSeriesColConverter(model, context, params);
|
|
70573
|
+
case "STACK_COL":
|
|
70574
|
+
return new StackColConverter(model, context, params);
|
|
70575
|
+
case "ZONE_COL":
|
|
70576
|
+
return new ZoneColConverter(model, context, params);
|
|
70577
|
+
case "MULTI_SERIES_BAR":
|
|
70578
|
+
return new MultiSeriesBarConverter(model, context, params);
|
|
70579
|
+
case "STACK_BAR":
|
|
70580
|
+
return new StackBarConverter(model, context, params);
|
|
70581
|
+
case "MULTI_SERIES_LINE":
|
|
70582
|
+
return new MultiSeriesLineConverter(model, context, params);
|
|
70583
|
+
case "ZONE_LINE":
|
|
70584
|
+
return new ZoneLineConverter(model, context, params);
|
|
70585
|
+
case "AREA":
|
|
70586
|
+
return new AreaConverter(model, context, params);
|
|
70587
|
+
case "PIE":
|
|
70588
|
+
return new PieConverter(model, context, params);
|
|
70589
|
+
case "RADAR":
|
|
70590
|
+
return new RadarConverter(model, context, params);
|
|
70591
|
+
case "SCATTER":
|
|
70592
|
+
return new ScatterConverter(model, context, params);
|
|
70593
|
+
case "GRID":
|
|
70594
|
+
return new GridConverter(model, context, params);
|
|
70595
|
+
case "CROSSTABLE":
|
|
70596
|
+
return new CrossTableConverter(model, context, params);
|
|
70597
|
+
default:
|
|
70598
|
+
return void 0;
|
|
70599
|
+
}
|
|
70600
|
+
}
|
|
70601
|
+
};
|
|
70602
|
+
|
|
70603
|
+
// src/controller/control/report-panel/generator/bi-generator.ts
|
|
70604
|
+
var BIReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
70605
|
+
/**
|
|
70606
|
+
* @description 初始化配置
|
|
70607
|
+
* @returns {*} {Promise<void>}
|
|
70608
|
+
* @memberof BIReportPanelGenerator
|
|
67888
70609
|
*/
|
|
67889
70610
|
async initConfig() {
|
|
67890
70611
|
const { appDEReport } = this.model;
|
|
@@ -67892,20 +70613,47 @@ var BIReportPanelGenerator = class extends ReportPanelBaseGenerator {
|
|
|
67892
70613
|
const appBISchemeId = appDEReport.appBISchemeId.split(".").pop();
|
|
67893
70614
|
appBIReport.appBISchemeId = appBISchemeId;
|
|
67894
70615
|
this.config = appBIReport;
|
|
70616
|
+
await this.initConverter();
|
|
67895
70617
|
}
|
|
67896
70618
|
/**
|
|
67897
|
-
*
|
|
67898
|
-
*
|
|
67899
|
-
* @
|
|
67900
|
-
* @date 2024-06-20 11:06:52
|
|
67901
|
-
* @param {IData} data
|
|
67902
|
-
* @return {*} {Promise<IData>}
|
|
70619
|
+
* @description 初始化转换器
|
|
70620
|
+
* @private
|
|
70621
|
+
* @memberof BIReportPanelGenerator
|
|
67903
70622
|
*/
|
|
67904
|
-
|
|
67905
|
-
|
|
67906
|
-
|
|
70623
|
+
async initConverter() {
|
|
70624
|
+
var _a3;
|
|
70625
|
+
const { appDEReport } = this.model;
|
|
70626
|
+
if (!appDEReport || !appDEReport.appBIReport)
|
|
70627
|
+
return;
|
|
70628
|
+
const { reportUIModel } = appDEReport.appBIReport;
|
|
70629
|
+
if (reportUIModel) {
|
|
70630
|
+
const tempReportUIModel = JSON.parse(reportUIModel);
|
|
70631
|
+
if (tempReportUIModel.chart_type) {
|
|
70632
|
+
this.reportType = tempReportUIModel.chart_type;
|
|
70633
|
+
this.converter = ConverterFactory.createConverter(
|
|
70634
|
+
tempReportUIModel.chart_type,
|
|
70635
|
+
appDEReport.appBIReport,
|
|
70636
|
+
this.reportPanel.context,
|
|
70637
|
+
this.reportPanel.params
|
|
70638
|
+
);
|
|
70639
|
+
await ((_a3 = this.converter) == null ? void 0 : _a3.init());
|
|
70640
|
+
}
|
|
67907
70641
|
}
|
|
67908
|
-
|
|
70642
|
+
}
|
|
70643
|
+
/**
|
|
70644
|
+
* @description 生成
|
|
70645
|
+
* @param {IData[]} items
|
|
70646
|
+
* @returns {*} {({
|
|
70647
|
+
* model: IModel;
|
|
70648
|
+
* options: IData;
|
|
70649
|
+
* data: IData[];
|
|
70650
|
+
* }
|
|
70651
|
+
* | undefined)}
|
|
70652
|
+
* @memberof BIReportPanelGenerator
|
|
70653
|
+
*/
|
|
70654
|
+
generate(items) {
|
|
70655
|
+
var _a3;
|
|
70656
|
+
return (_a3 = this.converter) == null ? void 0 : _a3.translateDataToReport(items);
|
|
67909
70657
|
}
|
|
67910
70658
|
};
|
|
67911
70659
|
|
|
@@ -67964,42 +70712,60 @@ var ReportPanelController = class extends ControlController {
|
|
|
67964
70712
|
return this.evt;
|
|
67965
70713
|
}
|
|
67966
70714
|
/**
|
|
67967
|
-
* 是否为
|
|
67968
|
-
*
|
|
67969
|
-
* @author tony001
|
|
67970
|
-
* @date 2024-06-19 18:06:02
|
|
70715
|
+
* @description 是否为BI报表设计
|
|
67971
70716
|
* @readonly
|
|
70717
|
+
* @type {boolean}
|
|
70718
|
+
* @memberof ReportPanelController
|
|
67972
70719
|
*/
|
|
67973
|
-
get
|
|
67974
|
-
|
|
67975
|
-
|
|
70720
|
+
get isBIReportDesign() {
|
|
70721
|
+
const { appDEReport } = this.model;
|
|
70722
|
+
const biReportType = [
|
|
70723
|
+
"DESYSBIREPORTS",
|
|
70724
|
+
"SYSBICUBE",
|
|
70725
|
+
"DESYSBICUBES",
|
|
70726
|
+
"ALLSYSBICUBES",
|
|
70727
|
+
"SYSBIREPORT",
|
|
70728
|
+
"SYSBICUBEREPORTS",
|
|
70729
|
+
"ALLSYSBIREPORTS"
|
|
70730
|
+
];
|
|
70731
|
+
if ((appDEReport == null ? void 0 : appDEReport.reportType) && biReportType.includes(appDEReport == null ? void 0 : appDEReport.reportType)) {
|
|
70732
|
+
return !this.generator.reportType;
|
|
67976
70733
|
}
|
|
67977
70734
|
return false;
|
|
67978
70735
|
}
|
|
67979
70736
|
/**
|
|
67980
|
-
*
|
|
67981
|
-
*
|
|
70737
|
+
* @description 获取数据
|
|
70738
|
+
* @returns {*} {IData[]}
|
|
70739
|
+
* @memberof ReportPanelController
|
|
70740
|
+
*/
|
|
70741
|
+
getData() {
|
|
70742
|
+
var _a3;
|
|
70743
|
+
if (this.isBIReportDesign)
|
|
70744
|
+
return ((_a3 = this.generator.protoRef) == null ? void 0 : _a3.state.items) || [];
|
|
70745
|
+
return this.state.data;
|
|
70746
|
+
}
|
|
70747
|
+
/**
|
|
70748
|
+
* @description 初始化状态
|
|
67982
70749
|
* @protected
|
|
67983
70750
|
* @memberof ReportPanelController
|
|
67984
70751
|
*/
|
|
67985
70752
|
initState() {
|
|
67986
70753
|
super.initState();
|
|
67987
|
-
this.state.data =
|
|
70754
|
+
this.state.data = [];
|
|
67988
70755
|
this.state.searchParams = {};
|
|
67989
|
-
this.state.
|
|
70756
|
+
this.state.biReport = void 0;
|
|
67990
70757
|
}
|
|
67991
70758
|
/**
|
|
67992
|
-
*
|
|
67993
|
-
*
|
|
70759
|
+
* @description 生命周期-创建完成
|
|
67994
70760
|
* @protected
|
|
67995
70761
|
* @returns {*} {Promise<void>}
|
|
70762
|
+
* @memberof ReportPanelController
|
|
67996
70763
|
*/
|
|
67997
70764
|
async onCreated() {
|
|
70765
|
+
var _a3;
|
|
67998
70766
|
await super.onCreated();
|
|
67999
70767
|
this.generator = ReportPanelGeneratorFactory.getInstance(this.model, this);
|
|
68000
|
-
|
|
68001
|
-
await this.generator.initConfig();
|
|
68002
|
-
}
|
|
70768
|
+
await ((_a3 = this.generator) == null ? void 0 : _a3.initConfig());
|
|
68003
70769
|
this.dataEntity = await ibiz.hub.getAppDataEntity(
|
|
68004
70770
|
this.model.appDataEntityId,
|
|
68005
70771
|
this.model.appId
|
|
@@ -68008,10 +70774,9 @@ var ReportPanelController = class extends ControlController {
|
|
|
68008
70774
|
await this.service.init(this.context);
|
|
68009
70775
|
}
|
|
68010
70776
|
/**
|
|
68011
|
-
*
|
|
68012
|
-
*
|
|
70777
|
+
* @description 生命周期-加载完成
|
|
68013
70778
|
* @protected
|
|
68014
|
-
* @
|
|
70779
|
+
* @returns {*} {Promise<void>}
|
|
68015
70780
|
* @memberof ReportPanelController
|
|
68016
70781
|
*/
|
|
68017
70782
|
async onMounted() {
|
|
@@ -68021,32 +70786,91 @@ var ReportPanelController = class extends ControlController {
|
|
|
68021
70786
|
}
|
|
68022
70787
|
}
|
|
68023
70788
|
/**
|
|
68024
|
-
*
|
|
68025
|
-
*
|
|
70789
|
+
* @description 获取报表参数
|
|
68026
70790
|
* @protected
|
|
68027
|
-
* @
|
|
70791
|
+
* @returns {*} {IParams}
|
|
70792
|
+
* @memberof ReportPanelController
|
|
70793
|
+
*/
|
|
70794
|
+
getReportParams() {
|
|
70795
|
+
var _a3, _b2;
|
|
70796
|
+
const appBIReport = (_a3 = this.model.appDEReport) == null ? void 0 : _a3.appBIReport;
|
|
70797
|
+
if (!appBIReport)
|
|
70798
|
+
return {};
|
|
70799
|
+
const {
|
|
70800
|
+
appBICubeId,
|
|
70801
|
+
reportUIModel,
|
|
70802
|
+
appBIReportMeasures,
|
|
70803
|
+
appBIReportDimensions
|
|
70804
|
+
} = appBIReport;
|
|
70805
|
+
const uiModel = reportUIModel ? JSON.parse(reportUIModel) : {};
|
|
70806
|
+
const period = (_b2 = uiModel.period) == null ? void 0 : _b2[0];
|
|
70807
|
+
const colSort = uiModel.grid_col_sort;
|
|
70808
|
+
const result = {
|
|
70809
|
+
bicubetag: appBICubeId,
|
|
70810
|
+
bimeasures: (appBIReportMeasures == null ? void 0 : appBIReportMeasures.map((measure) => {
|
|
70811
|
+
var _a4;
|
|
70812
|
+
const item = { name: (_a4 = measure.measureTag) == null ? void 0 : _a4.toLowerCase() };
|
|
70813
|
+
if (measure.measureParams)
|
|
70814
|
+
item.param = measure.measureParams;
|
|
70815
|
+
if (measure.aggMode)
|
|
70816
|
+
item.aggmode = measure.aggMode;
|
|
70817
|
+
return item;
|
|
70818
|
+
})) || [],
|
|
70819
|
+
bidimensions: (appBIReportDimensions == null ? void 0 : appBIReportDimensions.map((dimension) => {
|
|
70820
|
+
var _a4;
|
|
70821
|
+
const item = { name: (_a4 = dimension.dimensionTag) == null ? void 0 : _a4.toLowerCase() };
|
|
70822
|
+
if (dimension.dimensionParams)
|
|
70823
|
+
item.param = dimension.dimensionParams;
|
|
70824
|
+
return item;
|
|
70825
|
+
})) || [],
|
|
70826
|
+
bisort: colSort == null ? void 0 : colSort.map((col) => "".concat(col.codename.toLowerCase(), ",").concat(col.sort)).join(";"),
|
|
70827
|
+
biperiod: period == null ? void 0 : period.params
|
|
70828
|
+
};
|
|
70829
|
+
return result;
|
|
70830
|
+
}
|
|
70831
|
+
/**
|
|
70832
|
+
* @description 获取请求过滤参数
|
|
70833
|
+
* @param {IParams} [extraParams]
|
|
70834
|
+
* @returns {*} {Promise<IParams>}
|
|
68028
70835
|
* @memberof ReportPanelController
|
|
68029
70836
|
*/
|
|
68030
|
-
|
|
68031
|
-
|
|
70837
|
+
async getFetchParams(extraParams) {
|
|
70838
|
+
const resultParams = {
|
|
70839
|
+
...this.params,
|
|
70840
|
+
...this.getReportParams()
|
|
70841
|
+
};
|
|
70842
|
+
await this._evt.emit("onBeforeLoad", void 0);
|
|
70843
|
+
Object.assign(resultParams, {
|
|
70844
|
+
...this.state.searchParams
|
|
70845
|
+
});
|
|
70846
|
+
if (extraParams) {
|
|
70847
|
+
Object.assign(resultParams, extraParams);
|
|
70848
|
+
}
|
|
70849
|
+
return resultParams;
|
|
68032
70850
|
}
|
|
68033
70851
|
/**
|
|
68034
|
-
* 加载数据
|
|
68035
|
-
*
|
|
68036
|
-
* @
|
|
68037
|
-
* @param {(MDCtrlLoadParams)} [args]
|
|
68038
|
-
* @return {*} {Promise<IData>}
|
|
70852
|
+
* @description 加载数据
|
|
70853
|
+
* @param {MDCtrlLoadParams} [args={}]
|
|
70854
|
+
* @returns {*} {Promise<IData>}
|
|
68039
70855
|
* @memberof ReportPanelController
|
|
68040
70856
|
*/
|
|
68041
70857
|
async load(args = {}) {
|
|
68042
|
-
|
|
68043
|
-
|
|
68044
|
-
|
|
68045
|
-
await this.startLoading();
|
|
70858
|
+
var _a3, _b2;
|
|
70859
|
+
if (this.isBIReportDesign)
|
|
70860
|
+
return this.state.data;
|
|
68046
70861
|
try {
|
|
70862
|
+
await this.startLoading();
|
|
70863
|
+
const { codeName, appDEReport, appDataEntityId } = this.model;
|
|
70864
|
+
const reportTag = ((_a3 = appDEReport == null ? void 0 : appDEReport.appBIReport) == null ? void 0 : _a3.id) || codeName;
|
|
70865
|
+
const enyityId = ((_b2 = appDEReport == null ? void 0 : appDEReport.appBIReport) == null ? void 0 : _b2.appDataEntityId) || appDataEntityId;
|
|
68047
70866
|
const { context } = this.handlerAbilityParams(args);
|
|
68048
70867
|
const params = await this.getFetchParams(args == null ? void 0 : args.viewParam);
|
|
68049
|
-
const res = await this.service.fetch(
|
|
70868
|
+
const res = await this.service.fetch(
|
|
70869
|
+
reportTag,
|
|
70870
|
+
enyityId,
|
|
70871
|
+
context,
|
|
70872
|
+
params
|
|
70873
|
+
);
|
|
68050
70874
|
this.state.data = res.data;
|
|
68051
70875
|
await this.afterLoad(args, res.data);
|
|
68052
70876
|
this.state.isLoaded = true;
|
|
@@ -68064,54 +70888,23 @@ var ReportPanelController = class extends ControlController {
|
|
|
68064
70888
|
return this.state.data;
|
|
68065
70889
|
}
|
|
68066
70890
|
/**
|
|
68067
|
-
* 部件加载后处理
|
|
68068
|
-
*
|
|
68069
|
-
* @
|
|
68070
|
-
* @
|
|
68071
|
-
* @
|
|
68072
|
-
* @param {IData[]} items 上游处理的数据(默认是后台数据)
|
|
68073
|
-
* @return {*} {Promise<IData[]>} 返回给后续处理的数据
|
|
70891
|
+
* @description 部件加载后处理
|
|
70892
|
+
* @param {MDCtrlLoadParams} args
|
|
70893
|
+
* @param {IData} data
|
|
70894
|
+
* @returns {*} {Promise<IData>}
|
|
70895
|
+
* @memberof ReportPanelController
|
|
68074
70896
|
*/
|
|
68075
70897
|
async afterLoad(args, data) {
|
|
70898
|
+
this.state.biReport = this.generator.generate(data);
|
|
68076
70899
|
return data;
|
|
68077
70900
|
}
|
|
68078
70901
|
/**
|
|
68079
|
-
*
|
|
68080
|
-
* @
|
|
68081
|
-
* @return {*} {Promise<IParams>}
|
|
68082
|
-
*/
|
|
68083
|
-
async getFetchParams(extraParams) {
|
|
68084
|
-
const resultParams = {
|
|
68085
|
-
...this.params
|
|
68086
|
-
};
|
|
68087
|
-
await this._evt.emit("onBeforeLoad", void 0);
|
|
68088
|
-
Object.assign(resultParams, {
|
|
68089
|
-
...this.state.searchParams
|
|
68090
|
-
});
|
|
68091
|
-
if (extraParams) {
|
|
68092
|
-
Object.assign(resultParams, extraParams);
|
|
68093
|
-
}
|
|
68094
|
-
return resultParams;
|
|
68095
|
-
}
|
|
68096
|
-
/**
|
|
68097
|
-
* 报表数据
|
|
68098
|
-
*
|
|
68099
|
-
* @return {*} {IData[]}
|
|
70902
|
+
* @description 刷新
|
|
70903
|
+
* @returns {*} {Promise<void>}
|
|
68100
70904
|
* @memberof ReportPanelController
|
|
68101
70905
|
*/
|
|
68102
|
-
getData() {
|
|
68103
|
-
var _a3;
|
|
68104
|
-
if (this.isBIReport) {
|
|
68105
|
-
return ((_a3 = this.generator.protoRef) == null ? void 0 : _a3.state.items) || [];
|
|
68106
|
-
}
|
|
68107
|
-
return [this.state.data];
|
|
68108
|
-
}
|
|
68109
|
-
/**
|
|
68110
|
-
* 部件刷新,走初始加载
|
|
68111
|
-
* @date 2023-05-23 03:42:41
|
|
68112
|
-
*/
|
|
68113
70906
|
async refresh() {
|
|
68114
|
-
if (this.
|
|
70907
|
+
if (this.isBIReportDesign) {
|
|
68115
70908
|
this.generator.load();
|
|
68116
70909
|
} else {
|
|
68117
70910
|
this.doNextActive(() => this.load({ isInitialLoad: false }), {
|
|
@@ -69345,7 +72138,7 @@ var ThemeUtil = class {
|
|
|
69345
72138
|
* @memberof ThemeUtil
|
|
69346
72139
|
*/
|
|
69347
72140
|
async loadTheme(theme, type = "COLOR") {
|
|
69348
|
-
const data =
|
|
72141
|
+
const data = clone55(theme.themeParams || {});
|
|
69349
72142
|
const path2 = data["theme-package-path"] || theme.themeUrl;
|
|
69350
72143
|
delete data.appId;
|
|
69351
72144
|
delete data["theme-package-path"];
|
|
@@ -70000,8 +72793,8 @@ var baseStyle = {
|
|
|
70000
72793
|
position: "fixed",
|
|
70001
72794
|
zIndex: "10000"
|
|
70002
72795
|
};
|
|
70003
|
-
function cloneElement(
|
|
70004
|
-
const element = getAnimationElement(
|
|
72796
|
+
function cloneElement(clone61, teleport = document.body, isRemoveChild = true) {
|
|
72797
|
+
const element = getAnimationElement(clone61);
|
|
70005
72798
|
if (element == null) {
|
|
70006
72799
|
throw new Error(ibiz.i18n.t("runtime.utils.anime.noClone"));
|
|
70007
72800
|
}
|
|
@@ -70420,11 +73213,11 @@ function arrayContains(arr, val) {
|
|
|
70420
73213
|
});
|
|
70421
73214
|
}
|
|
70422
73215
|
function cloneObject(o) {
|
|
70423
|
-
var
|
|
73216
|
+
var clone61 = {};
|
|
70424
73217
|
for (var p in o) {
|
|
70425
|
-
|
|
73218
|
+
clone61[p] = o[p];
|
|
70426
73219
|
}
|
|
70427
|
-
return
|
|
73220
|
+
return clone61;
|
|
70428
73221
|
}
|
|
70429
73222
|
function replaceObjectProps(o1, o2) {
|
|
70430
73223
|
var o = cloneObject(o1);
|
|
@@ -72336,7 +75129,7 @@ var ShortCutUtil = class {
|
|
|
72336
75129
|
};
|
|
72337
75130
|
|
|
72338
75131
|
// src/utils/bi-report-util/bi-report-util.ts
|
|
72339
|
-
import { clone as
|
|
75132
|
+
import { clone as clone56 } from "ramda";
|
|
72340
75133
|
import { RuntimeError as RuntimeError66 } from "@ibiz-template/core";
|
|
72341
75134
|
var BIReportUtil = class {
|
|
72342
75135
|
/**
|
|
@@ -72352,7 +75145,7 @@ var BIReportUtil = class {
|
|
|
72352
75145
|
async openDesignPage(context, params, data) {
|
|
72353
75146
|
if (!data.mode)
|
|
72354
75147
|
data.mode = "DATA";
|
|
72355
|
-
const tempContext =
|
|
75148
|
+
const tempContext = clone56(context);
|
|
72356
75149
|
let config = {};
|
|
72357
75150
|
if (data.mode === "DATA") {
|
|
72358
75151
|
const app = ibiz.hub.getApp(ibiz.env.appId);
|
|
@@ -73019,7 +75812,7 @@ var RecordNavUtil = class {
|
|
|
73019
75812
|
|
|
73020
75813
|
// src/utils/jsonschema-util/jsonschema-util.ts
|
|
73021
75814
|
import qs5 from "qs";
|
|
73022
|
-
import { clone as
|
|
75815
|
+
import { clone as clone57 } from "ramda";
|
|
73023
75816
|
var JsonSchemaUtil = class {
|
|
73024
75817
|
constructor() {
|
|
73025
75818
|
/**
|
|
@@ -73272,7 +76065,7 @@ var JsonSchemaUtil = class {
|
|
|
73272
76065
|
getMockEditor(context, item, valueOP) {
|
|
73273
76066
|
if (valueOP && this.excludeOPs.includes(valueOP))
|
|
73274
76067
|
return;
|
|
73275
|
-
const baseMockEditor =
|
|
76068
|
+
const baseMockEditor = clone57(this.DataTypeToEditor[item.type]);
|
|
73276
76069
|
if (!baseMockEditor)
|
|
73277
76070
|
return;
|
|
73278
76071
|
baseMockEditor.appId = context.srfappid;
|
|
@@ -77921,7 +80714,6 @@ var ViewShellHooks = class {
|
|
|
77921
80714
|
};
|
|
77922
80715
|
|
|
77923
80716
|
// src/utils/water-mark-util/water-mark-util.ts
|
|
77924
|
-
import { StringUtil as StringUtil6 } from "@ibiz-template/core";
|
|
77925
80717
|
import { isArray as isArray11 } from "lodash-es";
|
|
77926
80718
|
|
|
77927
80719
|
// src/utils/water-mark-util/water-mark-manager/water-mark-manager.ts
|
|
@@ -78262,8 +81054,16 @@ var WaterMarkUtil = class {
|
|
|
78262
81054
|
const _opts = { ...option };
|
|
78263
81055
|
if (_opts.text) {
|
|
78264
81056
|
_opts.text = isArray11(_opts.text) ? _opts.text.map(
|
|
78265
|
-
(_textItem) =>
|
|
78266
|
-
|
|
81057
|
+
(_textItem) => ScriptFactory.execSingleLine("`".concat(_textItem, "`"), {
|
|
81058
|
+
context,
|
|
81059
|
+
params,
|
|
81060
|
+
data
|
|
81061
|
+
})
|
|
81062
|
+
) : ScriptFactory.execSingleLine("`".concat(_opts.text, "`"), {
|
|
81063
|
+
context,
|
|
81064
|
+
params,
|
|
81065
|
+
data
|
|
81066
|
+
});
|
|
78267
81067
|
}
|
|
78268
81068
|
const waterMarkManager = new WaterMarkManager(
|
|
78269
81069
|
_opts,
|
|
@@ -78353,7 +81153,7 @@ var WeChatUtil = class {
|
|
|
78353
81153
|
|
|
78354
81154
|
// src/command/app/open-app-view/open-app-view.ts
|
|
78355
81155
|
import { ModelError as ModelError30, RuntimeError as RuntimeError69 } from "@ibiz-template/core";
|
|
78356
|
-
import { clone as
|
|
81156
|
+
import { clone as clone58 } from "ramda";
|
|
78357
81157
|
var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
78358
81158
|
constructor() {
|
|
78359
81159
|
ibiz.commands.register(_OpenAppViewCommand.TAG, this.exec.bind(this));
|
|
@@ -78370,7 +81170,7 @@ var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
|
78370
81170
|
* @return {*} {(Promise<IModalData | void>)}
|
|
78371
81171
|
*/
|
|
78372
81172
|
async exec(appViewId, _context, params = {}, opts = {}) {
|
|
78373
|
-
const context =
|
|
81173
|
+
const context = clone58(_context);
|
|
78374
81174
|
if (context.srfsimple) {
|
|
78375
81175
|
delete context.srfsimple;
|
|
78376
81176
|
}
|
|
@@ -79170,7 +81970,7 @@ import { QXEvent as QXEvent14 } from "qx-util";
|
|
|
79170
81970
|
|
|
79171
81971
|
// src/controller/notification/async-action.controller.ts
|
|
79172
81972
|
import { QXEvent as QXEvent12 } from "qx-util";
|
|
79173
|
-
import { clone as
|
|
81973
|
+
import { clone as clone59 } from "ramda";
|
|
79174
81974
|
import { isNil as isNil38, isNumber as isNumber5 } from "lodash-es";
|
|
79175
81975
|
import dayjs10 from "dayjs";
|
|
79176
81976
|
var AsyncActionController = class {
|
|
@@ -79281,7 +82081,7 @@ var AsyncActionController = class {
|
|
|
79281
82081
|
} else {
|
|
79282
82082
|
this.noticeResult(action);
|
|
79283
82083
|
}
|
|
79284
|
-
this.evt.emit("add",
|
|
82084
|
+
this.evt.emit("add", clone59(action));
|
|
79285
82085
|
this.evt.emit("dataChange");
|
|
79286
82086
|
}
|
|
79287
82087
|
/**
|
|
@@ -79303,7 +82103,7 @@ var AsyncActionController = class {
|
|
|
79303
82103
|
}
|
|
79304
82104
|
this.noticeResult(action);
|
|
79305
82105
|
}
|
|
79306
|
-
this.evt.emit("change",
|
|
82106
|
+
this.evt.emit("change", clone59(action));
|
|
79307
82107
|
this.evt.emit("dataChange");
|
|
79308
82108
|
}
|
|
79309
82109
|
noticeResult(action) {
|
|
@@ -81032,7 +83832,7 @@ var ViewEngineBase = class {
|
|
|
81032
83832
|
|
|
81033
83833
|
// src/engine/md-view.engine.ts
|
|
81034
83834
|
import { RuntimeModelError as RuntimeModelError74 } from "@ibiz-template/core";
|
|
81035
|
-
import { clone as
|
|
83835
|
+
import { clone as clone60 } from "ramda";
|
|
81036
83836
|
var MDViewEngine = class extends ViewEngineBase {
|
|
81037
83837
|
/**
|
|
81038
83838
|
* 多数据部件名称
|
|
@@ -81320,7 +84120,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
81320
84120
|
ibiz.i18n.t("runtime.engine.logicNewdata")
|
|
81321
84121
|
);
|
|
81322
84122
|
}
|
|
81323
|
-
const params =
|
|
84123
|
+
const params = clone60(this.view.params);
|
|
81324
84124
|
if (copyMode) {
|
|
81325
84125
|
params.srfcopymode = copyMode;
|
|
81326
84126
|
}
|
|
@@ -84823,11 +87623,14 @@ export {
|
|
|
84823
87623
|
AppMenuController,
|
|
84824
87624
|
AppMenuIconViewController,
|
|
84825
87625
|
Application,
|
|
87626
|
+
AreaConverter,
|
|
84826
87627
|
AreaSeriesGenerator,
|
|
84827
87628
|
AsyncActionService,
|
|
84828
87629
|
AuthorityService,
|
|
87630
|
+
BIReportPanelGenerator,
|
|
84829
87631
|
BIReportUtil,
|
|
84830
87632
|
BackendUIActionProvider,
|
|
87633
|
+
BarConverterBase,
|
|
84831
87634
|
BarSeriesGenerator,
|
|
84832
87635
|
BaseController,
|
|
84833
87636
|
BaseSeriesGenerator,
|
|
@@ -84863,8 +87666,10 @@ export {
|
|
|
84863
87666
|
ControlType,
|
|
84864
87667
|
ControlVO,
|
|
84865
87668
|
ControllerEvent,
|
|
87669
|
+
ConverterBase,
|
|
84866
87670
|
Counter,
|
|
84867
87671
|
CounterService,
|
|
87672
|
+
CrossTableConverter,
|
|
84868
87673
|
CustomAppMenuController,
|
|
84869
87674
|
CustomDashboardController,
|
|
84870
87675
|
DEActionMethod,
|
|
@@ -84935,9 +87740,12 @@ export {
|
|
|
84935
87740
|
GanttNodeLinkData,
|
|
84936
87741
|
GanttService,
|
|
84937
87742
|
GanttStaticNodeData,
|
|
87743
|
+
GaugeConverter,
|
|
84938
87744
|
GaugeSeriesGenerator,
|
|
84939
87745
|
GridColumnController,
|
|
84940
87746
|
GridController,
|
|
87747
|
+
GridConverter,
|
|
87748
|
+
GridConverterBase,
|
|
84941
87749
|
GridFieldColumnController,
|
|
84942
87750
|
GridFieldEditColumnController,
|
|
84943
87751
|
GridGroupColumnController,
|
|
@@ -84984,6 +87792,11 @@ export {
|
|
|
84984
87792
|
MobViewController,
|
|
84985
87793
|
Modal,
|
|
84986
87794
|
MqttService,
|
|
87795
|
+
MultiSeriesBarConverter,
|
|
87796
|
+
MultiSeriesColConverter,
|
|
87797
|
+
MultiSeriesConverter,
|
|
87798
|
+
MultiSeriesLineConverter,
|
|
87799
|
+
NumberConverter,
|
|
84987
87800
|
OpenAppViewCommand,
|
|
84988
87801
|
PANELITEM_PROVIDER_PREFIX,
|
|
84989
87802
|
PLATFORM_PROVIDER_PREFIX,
|
|
@@ -84998,6 +87811,7 @@ export {
|
|
|
84998
87811
|
PanelItemState,
|
|
84999
87812
|
PanelNotifyState,
|
|
85000
87813
|
PickupViewPanelController,
|
|
87814
|
+
PieConverter,
|
|
85001
87815
|
PieSeriesGenerator,
|
|
85002
87816
|
PlatformProviderBase,
|
|
85003
87817
|
PlatformType,
|
|
@@ -85007,16 +87821,19 @@ export {
|
|
|
85007
87821
|
PredefinedControlRender,
|
|
85008
87822
|
PresetIdentifier,
|
|
85009
87823
|
QXEventEx,
|
|
87824
|
+
RadarConverter,
|
|
85010
87825
|
RadarSeriesGenerator,
|
|
85011
87826
|
RawItemPortletController,
|
|
85012
87827
|
RawValueUtil,
|
|
85013
87828
|
RecordNavUtil,
|
|
85014
87829
|
RegisterCenter,
|
|
85015
87830
|
RemotePluginItem,
|
|
87831
|
+
ReportPanelBaseGenerator,
|
|
85016
87832
|
ReportPanelController,
|
|
85017
87833
|
ReportPanelService,
|
|
85018
87834
|
ReportPortletController,
|
|
85019
87835
|
RouteConst,
|
|
87836
|
+
ScatterConverter,
|
|
85020
87837
|
ScatterSeriesGenerator,
|
|
85021
87838
|
ScriptFactory,
|
|
85022
87839
|
ScriptFunction,
|
|
@@ -85030,6 +87847,8 @@ export {
|
|
|
85030
87847
|
SearchFormService,
|
|
85031
87848
|
ShortCutUtil,
|
|
85032
87849
|
Srfuf,
|
|
87850
|
+
StackBarConverter,
|
|
87851
|
+
StackColConverter,
|
|
85033
87852
|
StudioControlEvents,
|
|
85034
87853
|
StudioPanelEvents,
|
|
85035
87854
|
StudioViewEvents,
|
|
@@ -85067,6 +87886,8 @@ export {
|
|
|
85067
87886
|
UIDomainManager,
|
|
85068
87887
|
UILOGINNODE_PROVIDER_PREFIX,
|
|
85069
87888
|
UIMapField,
|
|
87889
|
+
User2ReportPanelGenerator,
|
|
87890
|
+
UserReportPanelGenerator,
|
|
85070
87891
|
UtilService,
|
|
85071
87892
|
V7AuthService,
|
|
85072
87893
|
VIEW_MSG_PREFIX,
|
|
@@ -85092,6 +87913,9 @@ export {
|
|
|
85092
87913
|
WizardPanelController,
|
|
85093
87914
|
WizardPanelService,
|
|
85094
87915
|
WorkFlowService,
|
|
87916
|
+
ZoneColConverter,
|
|
87917
|
+
ZoneConverterBase,
|
|
87918
|
+
ZoneLineConverter,
|
|
85095
87919
|
asyncImportData,
|
|
85096
87920
|
asyncImportData2,
|
|
85097
87921
|
calcContentAlignStyle,
|