super-page-runtime 2.2.29-tmp1 → 2.2.29-tmp2
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/es/_virtual/_plugin-vue_export-helper.js +7 -5
- package/dist/es/assets/chart-themes/theme1.js +6 -2
- package/dist/es/assets/chart-themes/theme2.js +6 -2
- package/dist/es/assets/chart-themes/theme3.js +6 -2
- package/dist/es/components/runtime/utils/api/api-util.js +7 -4
- package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
- package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
- package/dist/es/components/runtime/utils/barcode-util.js +33 -9
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
- package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
- package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -69
- package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
- package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -38
- package/dist/es/components/runtime/utils/charts/chart-util.js +522 -226
- package/dist/es/components/runtime/utils/common-util.js +156 -76
- package/dist/es/components/runtime/utils/eventBus.js +8 -3
- package/dist/es/components/runtime/utils/events/event-util.js +775 -362
- package/dist/es/components/runtime/utils/events/print-label.js +140 -73
- package/dist/es/components/runtime/utils/events/standard-event.js +2320 -820
- package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
- package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
- package/dist/es/components/runtime/utils/form/scan-util.js +162 -62
- package/dist/es/components/runtime/utils/global-refs.js +84 -53
- package/dist/es/components/runtime/utils/i18n-util.js +20 -11
- package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
- package/dist/es/components/runtime/utils/page-helper-util.js +660 -280
- package/dist/es/components/runtime/utils/page-init-util.js +405 -144
- package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
- package/dist/es/components/runtime/utils/page-store.js +68 -23
- package/dist/es/components/runtime/utils/store-util.js +13 -9
- package/dist/es/components/runtime/utils/store.js +2 -2
- package/dist/es/components/runtime/utils/table-utils.js +81 -40
- package/dist/es/components/runtime/utils/tree-utils.js +37 -17
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +83 -21
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +46 -14
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +132 -36
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +18 -4
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +107 -17
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +198 -54
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +60 -11
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +203 -54
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -33
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -44
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -33
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -33
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +599 -253
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -213
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -33
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -63
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -305
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -265
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
- package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
- package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -43
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -70
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +246 -59
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -34
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -29
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -65
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -89
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
- package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
- package/dist/es/components/runtime/views/home-chart.vue.js +160 -41
- package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -21
- package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page.vue.js +756 -230
- package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
- package/dist/es/i18n/langs/cn.js +55 -2
- package/dist/es/i18n/langs/en.js +55 -2
- package/package.json +2 -2
|
@@ -4,337 +4,717 @@ import { executeExpression } from "agilebuilder-ui/src/utils/calculator/calculat
|
|
|
4
4
|
import { getComponentRef } from "./global-refs.js";
|
|
5
5
|
import { watch } from "vue";
|
|
6
6
|
import { deepCopy, getBaseUrl } from "./common-util.js";
|
|
7
|
-
function getComponentOptionConfigs(
|
|
8
|
-
if (!
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
function getComponentOptionConfigs(component, pageContext2) {
|
|
8
|
+
if (!component.props || !component.props.dataOrigin) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (component.name && component.name === "table") {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const dataOriginInfo = component.props.dataOrigin;
|
|
15
|
+
const infoObj = {
|
|
16
|
+
uuid: component.uuid
|
|
17
|
+
};
|
|
18
|
+
if (dataOriginInfo.optionValueSetType == "optionGroup") {
|
|
19
|
+
infoObj.type = "optionGroup";
|
|
20
|
+
infoObj.props = {
|
|
21
|
+
code: dataOriginInfo.optionGroup
|
|
22
|
+
};
|
|
23
|
+
} else if (dataOriginInfo.optionValueSetType == "dynamicData") {
|
|
24
|
+
infoObj.type = "dynamicData";
|
|
25
|
+
infoObj.filterType = dataOriginInfo.filterType;
|
|
26
|
+
infoObj.props = {
|
|
27
|
+
code: dataOriginInfo.dynamicDataSourceCode
|
|
28
|
+
};
|
|
29
|
+
} else if (dataOriginInfo.optionValueSetType == "dataTable") {
|
|
30
|
+
infoObj.filterType = dataOriginInfo.filterType;
|
|
31
|
+
const tempObj = getTableQueryInfo(dataOriginInfo, pageContext2);
|
|
32
|
+
Object.assign(infoObj, tempObj);
|
|
33
|
+
} else if (dataOriginInfo.optionValueSetType == "service") {
|
|
34
|
+
infoObj.filterType = dataOriginInfo.filterType;
|
|
35
|
+
const tempObj = getServiceQueryInfo(dataOriginInfo, pageContext2);
|
|
36
|
+
Object.assign(infoObj, tempObj);
|
|
37
|
+
}
|
|
38
|
+
if (infoObj.type) {
|
|
39
|
+
return infoObj;
|
|
40
|
+
} else {
|
|
41
|
+
return void 0;
|
|
42
|
+
}
|
|
23
43
|
}
|
|
24
|
-
function getTableQueryInfo(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
for (const
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
function getTableQueryInfo(dataOriginInfo, pageContext2) {
|
|
45
|
+
const infoObj = {};
|
|
46
|
+
infoObj.type = "dataTable";
|
|
47
|
+
infoObj.props = {
|
|
48
|
+
tableName: dataOriginInfo.tableName,
|
|
49
|
+
systemCode: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysCode : pageContext2.systemCode,
|
|
50
|
+
systemVersion: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysVersion : pageContext2.systemVersion
|
|
51
|
+
};
|
|
52
|
+
if (dataOriginInfo.sortFields) {
|
|
53
|
+
const sortFields = [];
|
|
54
|
+
for (const field of dataOriginInfo.sortFields) {
|
|
55
|
+
if (field.name) {
|
|
56
|
+
sortFields.push({
|
|
57
|
+
prop: field.name,
|
|
58
|
+
order: field.type ? field.type : "asc"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
infoObj.props.sorts = sortFields;
|
|
63
|
+
}
|
|
64
|
+
const autoMonitorFields = [];
|
|
65
|
+
if (dataOriginInfo.filterList) {
|
|
66
|
+
const searchForm = [];
|
|
67
|
+
for (const f of dataOriginInfo.filterList) {
|
|
68
|
+
if (!f.propName) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (!f.propDbName) {
|
|
72
|
+
f.propDbName = f.propName;
|
|
73
|
+
}
|
|
74
|
+
const tempObj = {};
|
|
75
|
+
Object.assign(tempObj, f);
|
|
76
|
+
const paramsNames = getParamNames(f.propValue);
|
|
77
|
+
for (const p of paramsNames) {
|
|
78
|
+
if (p && (p.startsWith("${data.") || p.startsWith("${task.") || p.startsWith("${page."))) {
|
|
79
|
+
if (!autoMonitorFields.includes(p)) {
|
|
80
|
+
autoMonitorFields.push(p);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (f.propValue) ;
|
|
85
|
+
searchForm.push(tempObj);
|
|
86
|
+
}
|
|
87
|
+
infoObj.props.searchForm = searchForm;
|
|
88
|
+
}
|
|
89
|
+
infoObj.props.monitorFields = autoMonitorFields;
|
|
90
|
+
const queryFields = [];
|
|
91
|
+
if (dataOriginInfo.tableValueField) {
|
|
92
|
+
infoObj.props.valueField = dataOriginInfo.tableValueField;
|
|
93
|
+
}
|
|
94
|
+
if (dataOriginInfo.tableLableField && queryFields.indexOf(dataOriginInfo.tableLableField) == -1) {
|
|
95
|
+
infoObj.props.lableField = dataOriginInfo.tableLableField;
|
|
96
|
+
}
|
|
97
|
+
if (dataOriginInfo.autoSets) {
|
|
98
|
+
for (const field of dataOriginInfo.autoSets) {
|
|
99
|
+
if (field.source && queryFields.indexOf(field.source) == -1) {
|
|
100
|
+
queryFields.push(field.source);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
infoObj.props.queryFields = queryFields;
|
|
105
|
+
infoObj.props.pageSize = dataOriginInfo.displayQuantity;
|
|
106
|
+
return infoObj;
|
|
49
107
|
}
|
|
50
|
-
function getServiceQueryInfo(
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
108
|
+
function getServiceQueryInfo(dataOriginInfo, pageContext2) {
|
|
109
|
+
const infoObj = {};
|
|
110
|
+
infoObj.type = "service";
|
|
111
|
+
infoObj.props = {
|
|
112
|
+
serivceCode: dataOriginInfo.serviceCode,
|
|
113
|
+
systemCode: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysCode : pageContext2.systemCode,
|
|
114
|
+
systemVersion: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysCode : pageContext2.systemCode
|
|
115
|
+
};
|
|
116
|
+
if (dataOriginInfo.serviceInputs) {
|
|
117
|
+
const searchForm = [];
|
|
118
|
+
for (const f of dataOriginInfo.serviceInputs) {
|
|
119
|
+
if (!f.name || f.value) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const tempObj = {};
|
|
123
|
+
Object.assign(tempObj, f);
|
|
124
|
+
searchForm.push(tempObj);
|
|
125
|
+
}
|
|
126
|
+
infoObj.props.inputs = searchForm;
|
|
127
|
+
}
|
|
128
|
+
infoObj.props.dataSetField = dataOriginInfo.serviceDataSetField;
|
|
129
|
+
infoObj.props.valueField = dataOriginInfo.serviceValueField;
|
|
130
|
+
infoObj.props.labelField = dataOriginInfo.serviceLabelField;
|
|
131
|
+
return infoObj;
|
|
62
132
|
}
|
|
63
|
-
function updateChartDatasources(
|
|
64
|
-
return new Promise((
|
|
65
|
-
if (!
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
133
|
+
function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isInit) {
|
|
134
|
+
return new Promise((resolve, reject) => {
|
|
135
|
+
if (!dataSourceConfs || dataSourceConfs.length == 0) {
|
|
136
|
+
reject(new Error("无需查询的统计图配置!"));
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const dataSourceConfsCopy = deepCopy(dataSourceConfs);
|
|
140
|
+
dataSourceConfsCopy.forEach((item) => {
|
|
141
|
+
const services = item.services;
|
|
142
|
+
if (services && services.length > 0) {
|
|
143
|
+
const serviceInputs = services[0].serviceInputs;
|
|
144
|
+
if (serviceInputs) {
|
|
145
|
+
services[0].serviceInParams = {};
|
|
146
|
+
serviceInputs.forEach((inParam) => {
|
|
147
|
+
const paramName = inParam.name;
|
|
148
|
+
const paramValue = inParam.value;
|
|
149
|
+
services[0].serviceInParams[paramName] = getValueFromVariable(
|
|
150
|
+
pageContext2.entity,
|
|
151
|
+
paramValue
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
delete services[0].serviceInputs;
|
|
155
|
+
}
|
|
75
156
|
}
|
|
76
157
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
158
|
+
const entityData2 = pageContext2.entity ? pageContext2.entity : {};
|
|
159
|
+
const additionalParamMap = {};
|
|
160
|
+
if (entityData2.request) {
|
|
161
|
+
Object.assign(additionalParamMap, entityData2.request);
|
|
162
|
+
}
|
|
163
|
+
if (entityData2.page) {
|
|
164
|
+
Object.assign(additionalParamMap, entityData2.page);
|
|
165
|
+
}
|
|
166
|
+
if (appendParams) {
|
|
167
|
+
Object.assign(additionalParamMap, appendParams);
|
|
168
|
+
}
|
|
169
|
+
const taskMap = {};
|
|
170
|
+
if (entityData2.task) {
|
|
171
|
+
Object.assign(taskMap, entityData2.task);
|
|
172
|
+
}
|
|
173
|
+
const param = {
|
|
174
|
+
entityMap: entityData2.data,
|
|
175
|
+
additionalParamMap,
|
|
176
|
+
taskMap,
|
|
177
|
+
dataSourceList: dataSourceConfsCopy,
|
|
178
|
+
systemCode: pageContext2.systemCode,
|
|
179
|
+
pageCode: pageContext2.code
|
|
180
|
+
};
|
|
181
|
+
const backendUrl = pageContext2.backendUrl;
|
|
182
|
+
const baseUrl = getBaseUrl(backendUrl, pageContext2.isTest);
|
|
183
|
+
const url = baseUrl + "/common/common-data/find-chart-datas";
|
|
184
|
+
http.post(url, param, {
|
|
185
|
+
headers: { customSystem: pageContext2.systemCode }
|
|
186
|
+
}).then((result) => {
|
|
83
187
|
var _a, _b;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
188
|
+
if (!pageContext2.chartDataSourceMap) {
|
|
189
|
+
pageContext2.chartDataSourceMap = {};
|
|
190
|
+
}
|
|
191
|
+
for (const uuid in result) {
|
|
192
|
+
pageContext2.chartDataSourceMap[uuid] = result[uuid];
|
|
193
|
+
const componentObj = getComponentRef(pageContext2, uuid);
|
|
194
|
+
if (componentObj) {
|
|
195
|
+
const chartConfig = componentObj.getConfigure();
|
|
196
|
+
if (!isInit || chartConfig && (chartConfig.initializationQuery === void 0 || chartConfig.initializationQuery)) {
|
|
197
|
+
if (componentObj.updateChartDatas) {
|
|
198
|
+
componentObj.updateChartDatas(result[uuid]);
|
|
199
|
+
if ((_b = (_a = chartConfig.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet) {
|
|
200
|
+
const serviceData = result[uuid] && result[uuid].length > 0 ? result[uuid][0] : {};
|
|
201
|
+
const chartData = serviceData && serviceData.result ? serviceData.result : {};
|
|
202
|
+
let datas = null;
|
|
203
|
+
if (chartConfig.serviceDataField) {
|
|
204
|
+
datas = chartData[chartConfig.serviceDataField];
|
|
205
|
+
} else {
|
|
206
|
+
if (chartData) {
|
|
207
|
+
if (Array.isArray(chartData)) {
|
|
208
|
+
datas = chartData;
|
|
209
|
+
} else {
|
|
210
|
+
datas = [chartData];
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (!datas) {
|
|
215
|
+
datas = [];
|
|
216
|
+
}
|
|
217
|
+
setValueForVariableName(
|
|
218
|
+
pageContext2.entity,
|
|
219
|
+
chartConfig.runtime.dataConfig.resultSet,
|
|
220
|
+
datas
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
94
224
|
}
|
|
95
225
|
}
|
|
96
226
|
}
|
|
97
|
-
console.log("查询统计图数据完成",
|
|
98
|
-
|
|
99
|
-
|
|
227
|
+
console.log("查询统计图数据完成", result);
|
|
228
|
+
resolve(result);
|
|
229
|
+
}).catch((error) => {
|
|
230
|
+
console.log("查询统计图数据失败", error);
|
|
231
|
+
reject(error);
|
|
100
232
|
});
|
|
101
233
|
});
|
|
102
234
|
}
|
|
103
|
-
function updateChartDatasourcesByComponent(
|
|
104
|
-
const
|
|
105
|
-
|
|
235
|
+
function updateChartDatasourcesByComponent(pageContext2, componentUuid) {
|
|
236
|
+
const chartDataSource = pageContext2.initChartServiceConfigs.find(
|
|
237
|
+
(item) => item.uuid === componentUuid
|
|
238
|
+
);
|
|
239
|
+
if (chartDataSource) {
|
|
240
|
+
updateChartDatasources(pageContext2, [chartDataSource], null, false);
|
|
241
|
+
}
|
|
106
242
|
}
|
|
107
|
-
function updateOptionDatasources(
|
|
108
|
-
return new Promise((
|
|
109
|
-
if (!
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
243
|
+
function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
|
|
244
|
+
return new Promise((resolve, reject) => {
|
|
245
|
+
if (!dataSourceConfs || dataSourceConfs.length == 0) {
|
|
246
|
+
reject(new Error("无需查询的配置!"));
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const entityData2 = pageContext2.entity ? pageContext2.entity : {};
|
|
250
|
+
const additionalParamMap = {};
|
|
251
|
+
if (entityData2.request) {
|
|
252
|
+
Object.assign(additionalParamMap, entityData2.request);
|
|
253
|
+
}
|
|
254
|
+
if (entityData2.page) {
|
|
255
|
+
Object.assign(additionalParamMap, entityData2.page);
|
|
256
|
+
}
|
|
257
|
+
additionalParamMap.query = query;
|
|
258
|
+
const param = {
|
|
259
|
+
entityMap: entityData2.data,
|
|
260
|
+
additionalParamMap,
|
|
261
|
+
dataSourceList: dataSourceConfs,
|
|
262
|
+
systemCode: pageContext2.systemCode,
|
|
263
|
+
query
|
|
264
|
+
};
|
|
265
|
+
const backendUrl = pageContext2.backendUrl;
|
|
266
|
+
const baseUrl = getBaseUrl(backendUrl, pageContext2.isTest);
|
|
267
|
+
const url = baseUrl + "/common/common-data/find-datas";
|
|
268
|
+
http.post(url, param).then((result) => {
|
|
269
|
+
if (!pageContext2.optionSourceMap) {
|
|
270
|
+
pageContext2.optionSourceMap = {};
|
|
271
|
+
}
|
|
272
|
+
for (const uuid in result) {
|
|
273
|
+
pageContext2.optionSourceMap[uuid] = result[uuid];
|
|
274
|
+
const componentObj = getComponentRef(pageContext2, uuid);
|
|
275
|
+
if (componentObj && componentObj.updateOptions) {
|
|
276
|
+
componentObj.updateOptions(result[uuid]);
|
|
277
|
+
}
|
|
119
278
|
}
|
|
120
|
-
console.log("查询选项数据完成",
|
|
121
|
-
|
|
122
|
-
|
|
279
|
+
console.log("查询选项数据完成", result);
|
|
280
|
+
resolve(result);
|
|
281
|
+
}).catch((error) => {
|
|
282
|
+
console.log("查询选项数据失败", error);
|
|
283
|
+
reject(error);
|
|
123
284
|
});
|
|
124
285
|
});
|
|
125
286
|
}
|
|
126
|
-
function getOptionDatasFromPage(
|
|
127
|
-
return getComponentOptionDatasFromPage(
|
|
287
|
+
function getOptionDatasFromPage(pageContext2, configure) {
|
|
288
|
+
return getComponentOptionDatasFromPage(pageContext2, configure.uuid);
|
|
128
289
|
}
|
|
129
|
-
function getComponentOptionDatasFromPage(
|
|
130
|
-
const
|
|
131
|
-
|
|
290
|
+
function getComponentOptionDatasFromPage(pageContext2, configureUuid) {
|
|
291
|
+
const optionSourceMap = getOptionDatasSourceMap(pageContext2);
|
|
292
|
+
const cacheOptions = optionSourceMap[configureUuid];
|
|
293
|
+
return cacheOptions ? cacheOptions : [];
|
|
132
294
|
}
|
|
133
|
-
function getOptionDatasSourceMap(
|
|
134
|
-
if (!
|
|
135
|
-
|
|
136
|
-
|
|
295
|
+
function getOptionDatasSourceMap(pageContext2) {
|
|
296
|
+
if (!pageContext2 || !pageContext2.optionSourceMap) {
|
|
297
|
+
return {};
|
|
298
|
+
}
|
|
299
|
+
const cacheOptions = pageContext2.optionSourceMap;
|
|
300
|
+
return cacheOptions ? cacheOptions : {};
|
|
137
301
|
}
|
|
138
|
-
function getChartDatasFromPage(
|
|
139
|
-
if (!
|
|
140
|
-
|
|
302
|
+
function getChartDatasFromPage(pageContext2, configure) {
|
|
303
|
+
if (!pageContext2 || !pageContext2.chartDataSourceMap || !configure) {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
const cacheDatas = pageContext2.chartDataSourceMap[configure.uuid];
|
|
307
|
+
return cacheDatas;
|
|
141
308
|
}
|
|
142
|
-
function queryOptionDatasources(
|
|
143
|
-
return updateOptionDatasources(
|
|
309
|
+
function queryOptionDatasources(pageContext2, dataSourceConf, query) {
|
|
310
|
+
return updateOptionDatasources(pageContext2, dataSourceConf ? [dataSourceConf] : [], query);
|
|
144
311
|
}
|
|
145
|
-
function autoSetAfterSelect(
|
|
146
|
-
if (!
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
312
|
+
function autoSetAfterSelect(component, pageContext2, autoSets, selItems) {
|
|
313
|
+
if (!autoSets || autoSets.length == 0) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const entity = pageContext2.entity ? pageContext2.entity : {};
|
|
317
|
+
for (const as of autoSets) {
|
|
318
|
+
if (!as.source || !as.target) {
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
const values = getValuesByField(selItems, as.source);
|
|
322
|
+
let targetField = as.target;
|
|
323
|
+
if (!targetField || !targetField.startsWith("${")) {
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
targetField = targetField.substring(2, targetField.length - 1);
|
|
327
|
+
const fields = targetField.split(".");
|
|
328
|
+
setVariableValue(entity, fields, values.join(","));
|
|
155
329
|
}
|
|
156
330
|
}
|
|
157
|
-
function getValuesByField(
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
331
|
+
function getValuesByField(items, fieldName) {
|
|
332
|
+
if (!items) {
|
|
333
|
+
return [""];
|
|
334
|
+
} else {
|
|
335
|
+
const values = [];
|
|
336
|
+
for (const i of items) {
|
|
337
|
+
let val = i[fieldName];
|
|
338
|
+
if (val == void 0 || val == null) {
|
|
339
|
+
val = "";
|
|
340
|
+
}
|
|
341
|
+
values.push(val);
|
|
163
342
|
}
|
|
164
|
-
return
|
|
343
|
+
return values;
|
|
165
344
|
}
|
|
166
|
-
return [""];
|
|
167
345
|
}
|
|
168
|
-
function getVariableValue(
|
|
169
|
-
if (!
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
346
|
+
function getVariableValue(entity, fields) {
|
|
347
|
+
if (!entity || !fields || fields.length == 0) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
let tempObj = entity;
|
|
351
|
+
for (let i = 0; i < fields.length; i++) {
|
|
352
|
+
if (tempObj == void 0) {
|
|
353
|
+
return tempObj;
|
|
354
|
+
}
|
|
355
|
+
const fieldName = fields[i];
|
|
356
|
+
tempObj = tempObj[fieldName];
|
|
357
|
+
}
|
|
358
|
+
return tempObj;
|
|
176
359
|
}
|
|
177
|
-
function setValueForVariableName(
|
|
178
|
-
if (!
|
|
179
|
-
|
|
360
|
+
function setValueForVariableName(entity, variableName, newValue) {
|
|
361
|
+
if (!variableName || !variableName.startsWith("${")) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
variableName = variableName.substring(2, variableName.length - 1);
|
|
365
|
+
const fields = variableName.split(".");
|
|
366
|
+
setVariableValue(entity, fields, newValue);
|
|
180
367
|
}
|
|
181
|
-
function setVariableValue(
|
|
182
|
-
if (!
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
368
|
+
function setVariableValue(entity, fields, newValue) {
|
|
369
|
+
if (!entity || !fields || fields.length == 0) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
let tempObj = entity;
|
|
373
|
+
for (let i = 0; i < fields.length; i++) {
|
|
374
|
+
const fieldName = fields[i];
|
|
375
|
+
if (i + 1 === fields.length) {
|
|
376
|
+
tempObj[fieldName] = newValue;
|
|
377
|
+
} else {
|
|
378
|
+
if (tempObj[fieldName] === void 0) {
|
|
379
|
+
tempObj[fieldName] = {};
|
|
380
|
+
}
|
|
381
|
+
tempObj = tempObj[fieldName];
|
|
382
|
+
}
|
|
187
383
|
}
|
|
188
384
|
}
|
|
189
|
-
function setVariableValueWithProp(
|
|
190
|
-
if (!
|
|
191
|
-
|
|
385
|
+
function setVariableValueWithProp(entity, prop, newValue) {
|
|
386
|
+
if (!entity || !prop) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const fields = prop.split(".");
|
|
390
|
+
setVariableValue(entity, fields, newValue);
|
|
192
391
|
}
|
|
193
|
-
function formatVariableValue(
|
|
194
|
-
if (!
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
392
|
+
function formatVariableValue(pageContext2, variable) {
|
|
393
|
+
if (!pageContext2 || variable == "" || variable == null || variable == void 0) {
|
|
394
|
+
return variable;
|
|
395
|
+
}
|
|
396
|
+
const entity = pageContext2.entity ? pageContext2.entity : {};
|
|
397
|
+
const t = getParamNames(variable);
|
|
398
|
+
for (const c in t) {
|
|
399
|
+
const param = t[c];
|
|
400
|
+
const paramValue = getValueFromVariable(entity, param);
|
|
401
|
+
if (paramValue && Object.prototype.toString.call(paramValue) === "[object Date]") {
|
|
402
|
+
return dayjs(paramValue).format("YYYY-MM-DD hh:mm:ss");
|
|
403
|
+
} else if (paramValue && typeof paramValue === "number") {
|
|
404
|
+
return paramValue;
|
|
405
|
+
}
|
|
406
|
+
variable = variable.replace(
|
|
407
|
+
param,
|
|
408
|
+
paramValue === void 0 || paramValue === null ? "" : paramValue
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
return variable;
|
|
203
412
|
}
|
|
204
|
-
function getParamNames(
|
|
205
|
-
if (!
|
|
206
|
-
|
|
207
|
-
|
|
413
|
+
function getParamNames(variable) {
|
|
414
|
+
if (!variable) {
|
|
415
|
+
return [];
|
|
416
|
+
}
|
|
417
|
+
const reg = /\$\{[^\{|\}]+\}/g;
|
|
418
|
+
const paramNames = variable.match(reg);
|
|
419
|
+
return paramNames ? paramNames : [];
|
|
208
420
|
}
|
|
209
|
-
function formatValueByType(
|
|
210
|
-
if (!
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
421
|
+
function formatValueByType(value, formatType, formatInfo) {
|
|
422
|
+
if (!formatType || value == "" || value == null || value == void 0) {
|
|
423
|
+
return value;
|
|
424
|
+
}
|
|
425
|
+
console.log("aaa", value, formatType, formatInfo);
|
|
426
|
+
formatInfo = formatInfo ? formatInfo : {};
|
|
427
|
+
if (formatType == "number" || formatType == "percent") {
|
|
428
|
+
if (isNaN(value)) {
|
|
429
|
+
return value;
|
|
430
|
+
}
|
|
431
|
+
let precision = parseInt(formatInfo.decimalDigit);
|
|
432
|
+
if (precision == null || isNaN(precision)) {
|
|
433
|
+
precision = -1;
|
|
434
|
+
}
|
|
435
|
+
value = parseFloat(value);
|
|
436
|
+
if (formatType == "percent") {
|
|
437
|
+
value = value * 100;
|
|
438
|
+
}
|
|
439
|
+
if (precision > -1) {
|
|
440
|
+
value = parseFloat(value.toFixed(precision));
|
|
441
|
+
}
|
|
442
|
+
if (formatType == "percent") {
|
|
443
|
+
value = value + "%";
|
|
444
|
+
} else {
|
|
445
|
+
if (formatInfo.thousandsSeparator) {
|
|
446
|
+
const parts = value.toString().split(".");
|
|
447
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
448
|
+
value = parts.length > 1 ? parts.join(".") : parts[0];
|
|
449
|
+
}
|
|
450
|
+
if (formatInfo.symbol) {
|
|
451
|
+
value = formatInfo.symbol + "" + value;
|
|
219
452
|
}
|
|
220
|
-
o.symbol && (e = o.symbol + "" + e);
|
|
221
453
|
}
|
|
222
|
-
return
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
454
|
+
return value;
|
|
455
|
+
} else if (formatType == "date" || formatType == "time") {
|
|
456
|
+
let formatStr = "";
|
|
457
|
+
if (formatType == "date") {
|
|
458
|
+
formatStr = formatInfo.dateFormat;
|
|
459
|
+
if (!formatStr) {
|
|
460
|
+
formatStr = "YYYY-MM-DD";
|
|
461
|
+
}
|
|
462
|
+
} else {
|
|
463
|
+
formatStr = formatInfo.timeFormat;
|
|
464
|
+
if (!formatStr) {
|
|
465
|
+
formatStr = "HH:mm:ss";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
return dayjs(value).format(formatStr);
|
|
469
|
+
} else if (formatType == "custom" && formatInfo.formatEventUuid) {
|
|
470
|
+
console.log("自定义方法", formatInfo);
|
|
227
471
|
}
|
|
228
|
-
return
|
|
472
|
+
return value;
|
|
229
473
|
}
|
|
230
|
-
function getValueFromVariable(
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
474
|
+
function getValueFromVariable(entity, variable, row2) {
|
|
475
|
+
if (variable == null || variable == void 0) {
|
|
476
|
+
return variable;
|
|
477
|
+
}
|
|
478
|
+
if (variable.startsWith("${") && variable.endsWith("}")) {
|
|
479
|
+
let paramName = variable.substring(2, variable.length - 1);
|
|
480
|
+
let paramType = null;
|
|
481
|
+
let valueSource = null;
|
|
482
|
+
if (paramName.startsWith("data.")) {
|
|
483
|
+
paramName = paramName.substring(5);
|
|
484
|
+
valueSource = entity.data;
|
|
485
|
+
paramType = "data";
|
|
486
|
+
} else if (paramName.startsWith("page.")) {
|
|
487
|
+
paramName = paramName.substring(5);
|
|
488
|
+
paramType = "page";
|
|
489
|
+
valueSource = entity.page;
|
|
490
|
+
} else if (paramName.startsWith("task.")) {
|
|
491
|
+
paramName = paramName.substring(5);
|
|
492
|
+
paramType = "task";
|
|
493
|
+
valueSource = entity.task;
|
|
494
|
+
} else if (paramName.startsWith("request.")) {
|
|
495
|
+
paramName = paramName.substring(8);
|
|
496
|
+
paramType = "request";
|
|
497
|
+
valueSource = entity.request;
|
|
498
|
+
} else if (paramName.startsWith("context.")) {
|
|
499
|
+
paramName = paramName.substring(8);
|
|
500
|
+
paramType = "context";
|
|
501
|
+
valueSource = entity.context;
|
|
502
|
+
} else if (paramName.startsWith("system.")) {
|
|
503
|
+
paramName = paramName.substring(7);
|
|
504
|
+
paramType = "system";
|
|
505
|
+
valueSource = entity.system;
|
|
506
|
+
} else if (paramName.startsWith("fixed.")) {
|
|
507
|
+
return paramName.substring(6);
|
|
508
|
+
} else if (paramName.startsWith("row.")) {
|
|
509
|
+
paramName = paramName.substring(4);
|
|
510
|
+
valueSource = row2;
|
|
511
|
+
paramType = "row";
|
|
512
|
+
}
|
|
513
|
+
if (!paramName) {
|
|
514
|
+
console.log("获取变量失败", variable, entity);
|
|
515
|
+
return "";
|
|
516
|
+
}
|
|
517
|
+
return getValueFromSource(valueSource, paramName, paramType);
|
|
518
|
+
} else {
|
|
519
|
+
return variable;
|
|
520
|
+
}
|
|
247
521
|
}
|
|
248
|
-
function getValueFromSource(
|
|
249
|
-
if ("context"
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
522
|
+
function getValueFromSource(valueSource, paramName, paramType) {
|
|
523
|
+
if (paramType != "context" && !valueSource || !paramName) {
|
|
524
|
+
return void 0;
|
|
525
|
+
}
|
|
526
|
+
const firstIndex = paramName.indexOf(".");
|
|
527
|
+
if (firstIndex > -1) {
|
|
528
|
+
const tempParamName = paramName.substring(0, firstIndex);
|
|
529
|
+
const newParamName = paramName.substring(firstIndex + 1);
|
|
530
|
+
let childValue = valueSource[tempParamName];
|
|
531
|
+
if (childValue && Array.isArray(childValue) && childValue.length > 0) {
|
|
532
|
+
childValue = childValue[0];
|
|
533
|
+
}
|
|
534
|
+
return getValueFromSource(childValue, newParamName, paramType);
|
|
535
|
+
} else {
|
|
536
|
+
if (paramType == "context") {
|
|
537
|
+
if (paramName == "currentDate" || paramName == "currentTime") {
|
|
538
|
+
return /* @__PURE__ */ new Date();
|
|
539
|
+
} else if (paramName.startsWith("currentDate") && paramName.length > 11) {
|
|
540
|
+
const str = paramName.substring(11);
|
|
541
|
+
const symbol = str.substring(0, 1);
|
|
542
|
+
let num = parseInt(str.substring(1, str.length - 1), 10);
|
|
543
|
+
const unit = str.substring(str.length - 1);
|
|
544
|
+
const date = /* @__PURE__ */ new Date();
|
|
545
|
+
num = "+" === symbol ? num : -num;
|
|
546
|
+
if (unit === "d" || unit === "w") {
|
|
547
|
+
num = unit === "w" ? num * 7 : num;
|
|
548
|
+
date.setDate(date.getDate() + num);
|
|
549
|
+
} else if (unit === "m") {
|
|
550
|
+
date.setMonth(date.getMonth() + num);
|
|
551
|
+
} else if (unit === "y") {
|
|
552
|
+
date.setFullYear(date.getFullYear() + num);
|
|
553
|
+
}
|
|
554
|
+
return date;
|
|
555
|
+
}
|
|
556
|
+
if (!valueSource) {
|
|
557
|
+
return void 0;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return valueSource[paramName];
|
|
561
|
+
}
|
|
267
562
|
}
|
|
268
563
|
function caculateShowCondition(pageContext, showConditions, row) {
|
|
269
|
-
if (!showConditions ||
|
|
564
|
+
if (!showConditions || showConditions.length == 0 || !pageContext || !pageContext.entity) {
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
270
567
|
const entityData = pageContext.entity;
|
|
271
568
|
let conditions = "";
|
|
272
569
|
const maxLen = showConditions.length;
|
|
273
|
-
for (let
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
570
|
+
for (let i = 0; i < maxLen; i++) {
|
|
571
|
+
const condition = showConditions[i];
|
|
572
|
+
const propName = condition.propName;
|
|
573
|
+
let operator = condition.operator;
|
|
574
|
+
if (!propName || propName === "") {
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
if (!operator) {
|
|
578
|
+
operator = "EQ";
|
|
579
|
+
}
|
|
580
|
+
const leftValue = getValueFromVariable(entityData, propName, row);
|
|
581
|
+
let propValue = getValueFromVariable(entityData, condition.propValue, row);
|
|
582
|
+
const dataType = condition.dataType;
|
|
583
|
+
if (operator == "CONTAIN" || operator == "NOT_CONTAIN") {
|
|
584
|
+
if (leftValue && !leftValue.includes) {
|
|
585
|
+
operator = operator == "CONTAIN" ? "EQ" : "NET";
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
let variableIsNullStr = condition.variableIsNull;
|
|
589
|
+
if (!variableIsNullStr) {
|
|
590
|
+
variableIsNullStr = "null";
|
|
591
|
+
}
|
|
592
|
+
let conditionResult = void 0;
|
|
593
|
+
if (propValue === void 0 || propValue === "") {
|
|
594
|
+
propValue = null;
|
|
595
|
+
if (variableIsNullStr === "null") {
|
|
596
|
+
operator = "IS_NULL";
|
|
597
|
+
} else if (variableIsNullStr === "notequal") {
|
|
598
|
+
operator = "IS_NOT_NULL";
|
|
599
|
+
} else {
|
|
600
|
+
conditionResult = true;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (conditionResult == void 0) {
|
|
604
|
+
try {
|
|
605
|
+
conditionResult = executeExpression(leftValue, operator, propValue, dataType);
|
|
606
|
+
} catch (e) {
|
|
607
|
+
console.log("executeExpression error", e);
|
|
608
|
+
conditionResult = false;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const leftBracket = condition.leftBracket;
|
|
612
|
+
const rightBracket = condition.rightBracket;
|
|
613
|
+
let joinSign = condition.joinSign;
|
|
614
|
+
if (leftBracket && leftBracket !== null && leftBracket !== "") {
|
|
615
|
+
conditions = conditions + leftBracket;
|
|
616
|
+
conditions = conditions + " ";
|
|
617
|
+
}
|
|
618
|
+
conditions += conditionResult + " ";
|
|
619
|
+
if (rightBracket && rightBracket !== null && rightBracket !== "") {
|
|
620
|
+
conditions = conditions + rightBracket;
|
|
621
|
+
conditions = conditions + " ";
|
|
622
|
+
}
|
|
623
|
+
if (i < maxLen - 1) {
|
|
624
|
+
if (joinSign && joinSign !== null && joinSign !== "") {
|
|
625
|
+
const joinSignIgnoreCase = joinSign.toLowerCase();
|
|
626
|
+
if (joinSignIgnoreCase === "and") {
|
|
627
|
+
joinSign = joinSignIgnoreCase.replace("and", "&&");
|
|
628
|
+
} else if (joinSignIgnoreCase === "or") {
|
|
629
|
+
joinSign = joinSignIgnoreCase.replace("or", "||");
|
|
630
|
+
}
|
|
631
|
+
conditions += joinSign + " ";
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
if (conditions) {
|
|
636
|
+
return eval("(" + conditions + ")");
|
|
637
|
+
} else {
|
|
638
|
+
return true;
|
|
639
|
+
}
|
|
296
640
|
}
|
|
297
|
-
function monitorFieldChange(
|
|
298
|
-
if (!
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
641
|
+
function monitorFieldChange(pageContext2, monitorFields, triggerFunc) {
|
|
642
|
+
if (!triggerFunc || !pageContext2 || !monitorFields || monitorFields.length == 0) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
const monitorFieldInfos = [];
|
|
646
|
+
const preFields = [];
|
|
647
|
+
for (let propName of monitorFields) {
|
|
648
|
+
if (propName.startsWith("${")) {
|
|
649
|
+
propName = propName.substring(2, propName.length - 1);
|
|
650
|
+
const fields = propName.split(".");
|
|
651
|
+
if (fields[0] === "page" || fields[0] === "task" || fields[0] === "data") {
|
|
652
|
+
monitorFieldInfos.push(fields);
|
|
653
|
+
if (!preFields.includes(fields[0])) {
|
|
654
|
+
preFields.push(fields[0]);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
const entity = pageContext2.entity;
|
|
660
|
+
let firstValue = getMonitorFieldValues(monitorFieldInfos, entity);
|
|
661
|
+
let monitorTimeout = false;
|
|
662
|
+
for (const preField of preFields) {
|
|
663
|
+
watch(entity[preField], () => {
|
|
664
|
+
if (monitorTimeout) {
|
|
665
|
+
clearTimeout(monitorTimeout);
|
|
666
|
+
}
|
|
667
|
+
monitorTimeout = setTimeout(function() {
|
|
668
|
+
const newValue = getMonitorFieldValues(monitorFieldInfos, entity);
|
|
669
|
+
if (firstValue != newValue) {
|
|
670
|
+
firstValue = newValue;
|
|
671
|
+
triggerFunc();
|
|
672
|
+
}
|
|
673
|
+
}, 200);
|
|
674
|
+
});
|
|
675
|
+
}
|
|
313
676
|
}
|
|
314
|
-
function getMonitorFieldValues(
|
|
315
|
-
let
|
|
316
|
-
for (const
|
|
317
|
-
|
|
677
|
+
function getMonitorFieldValues(monitorFieldInfos, entity) {
|
|
678
|
+
let values = "";
|
|
679
|
+
for (const fieldInfo of monitorFieldInfos) {
|
|
680
|
+
values += "_" + getVariableValue(entity, fieldInfo);
|
|
681
|
+
}
|
|
682
|
+
return values;
|
|
318
683
|
}
|
|
319
|
-
function getFormPropName(
|
|
320
|
-
|
|
684
|
+
function getFormPropName(prop) {
|
|
685
|
+
if (prop && prop.indexOf("${") >= 0) {
|
|
686
|
+
return prop.substring(prop.indexOf(".") + 1, prop.lastIndexOf("}"));
|
|
687
|
+
} else {
|
|
688
|
+
return prop;
|
|
689
|
+
}
|
|
321
690
|
}
|
|
322
|
-
function getSizeConfig(
|
|
323
|
-
const
|
|
324
|
-
let
|
|
325
|
-
|
|
691
|
+
function getSizeConfig(pageContext2, configure) {
|
|
692
|
+
const pageModeType = getPageModeType(pageContext2);
|
|
693
|
+
let sizeConfig;
|
|
694
|
+
if (configure.props && configure.props.size && configure.props.size[pageModeType]) {
|
|
695
|
+
sizeConfig = configure.props.size[pageModeType];
|
|
696
|
+
}
|
|
697
|
+
if (!sizeConfig && configure.props && configure.props.size) {
|
|
698
|
+
sizeConfig = configure.props.size["pc"];
|
|
699
|
+
}
|
|
700
|
+
return sizeConfig;
|
|
326
701
|
}
|
|
327
|
-
function getPageModeType(
|
|
328
|
-
let
|
|
329
|
-
|
|
702
|
+
function getPageModeType(pageContext2) {
|
|
703
|
+
let dimensions = pageContext2.dimensions;
|
|
704
|
+
if (!dimensions) {
|
|
705
|
+
dimensions = "pc";
|
|
706
|
+
}
|
|
707
|
+
return dimensions;
|
|
330
708
|
}
|
|
331
|
-
function isPromise(
|
|
332
|
-
return
|
|
709
|
+
function isPromise(p) {
|
|
710
|
+
return p && Object.prototype.toString.call(p) === "[object Promise]";
|
|
333
711
|
}
|
|
334
|
-
function decomposeVariable(
|
|
335
|
-
if (!
|
|
336
|
-
|
|
337
|
-
|
|
712
|
+
function decomposeVariable(variable) {
|
|
713
|
+
if (!variable) {
|
|
714
|
+
return [];
|
|
715
|
+
}
|
|
716
|
+
const paramNames = variable.match(/\${(.*?)}/);
|
|
717
|
+
return paramNames ? paramNames[1].split(".") : [];
|
|
338
718
|
}
|
|
339
719
|
export {
|
|
340
720
|
autoSetAfterSelect,
|