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
|
@@ -1,223 +1,604 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
3
|
-
import { getSizeConfig
|
|
4
|
-
import { getCustomFunc
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getSummaryTitleColumn
|
|
9
|
-
import { deepCopy
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { defineComponent, ref, onMounted, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, normalizeStyle, unref, withDirectives, createVNode, createBlock, createCommentVNode, vShow, withCtx, Fragment, renderList, h } from "vue";
|
|
2
|
+
import _sfc_main$1 from "../common/common-chart-header.vue.js";
|
|
3
|
+
import { getSizeConfig, getChartDatasFromPage, getValueFromVariable, isPromise, setValueForVariableName, updateChartDatasourcesByComponent, caculateShowCondition } from "../../../../utils/page-helper-util.js";
|
|
4
|
+
import { getCustomFunc } from "../../../../utils/events/event-util.js";
|
|
5
|
+
import _sfc_main$2 from "./group-column.vue.js";
|
|
6
|
+
import _sfc_main$3 from "./normal-column.vue.js";
|
|
7
|
+
import _sfc_main$4 from "./table-pageination.vue.js";
|
|
8
|
+
import { getSummaryTitleColumn, getSummaryDataColumn, rowDataToColumn, getColumnToRowTableConfig, colDataToRow, computeFormula, getNewColumnConfig, summaryStatistics, replacePlaceholders, getIndexColumn, getHeaderCellStyleUtil, getRowStyleUtil, getCellStyleUtil, formatColContent } from "./chart-table-util.js";
|
|
9
|
+
import { deepCopy } from "../../../../utils/common-util.js";
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "table-runtime",
|
|
12
|
+
props: {
|
|
13
|
+
configure: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: () => {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
pageContext: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => {
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(__props, { expose: __expose }) {
|
|
27
|
+
var _a;
|
|
28
|
+
const props = __props;
|
|
29
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
30
|
+
const runtimeStyle = runtimeInfo.style;
|
|
31
|
+
const runtimeClass = runtimeInfo.class;
|
|
32
|
+
const dataConfig = runtimeInfo.dataConfig;
|
|
33
|
+
const headerInfo = runtimeInfo.headerInfo ? runtimeInfo.headerInfo : {};
|
|
34
|
+
const headerRef = ref(null);
|
|
35
|
+
const isEnableGroupHeader = ref(runtimeInfo.props.isEnableGroupHeader);
|
|
36
|
+
const tableData = ref([]);
|
|
37
|
+
const tableColumnsConfig = ref([]);
|
|
38
|
+
const groupColumnsConfig = ref([]);
|
|
39
|
+
const columnsConfigKeyValues = ref({});
|
|
40
|
+
const showSummary = ref(false);
|
|
41
|
+
const tableSummaryTitle = ref({});
|
|
42
|
+
const tableSummaryColumns = ref({});
|
|
43
|
+
const groupSummaryColumns = ref({});
|
|
44
|
+
const groupSummaryDataRowIndex = [];
|
|
45
|
+
const columnStyleSourceConfig = ref({});
|
|
46
|
+
const dataFormulaMapping = ref({});
|
|
47
|
+
const gridRef = ref(null);
|
|
48
|
+
const total = ref(0);
|
|
49
|
+
let tmpTableData = [];
|
|
50
|
+
if (!props.configure.props.modelCustom) {
|
|
51
|
+
if (!isEnableGroupHeader.value) {
|
|
52
|
+
tableColumnsConfig.value = props.configure.items;
|
|
53
|
+
} else {
|
|
54
|
+
const tempGroupHeaders = [];
|
|
55
|
+
props.configure.props.groupHeaders.forEach((item) => {
|
|
56
|
+
if (!item.parentUuid) {
|
|
57
|
+
tempGroupHeaders.push(item);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
tempGroupHeaders.sort((a, b) => a.displayOrder - b.displayOrder);
|
|
61
|
+
groupColumnsConfig.value = tempGroupHeaders;
|
|
62
|
+
pushIdnexColumnToGroupHeaders();
|
|
63
|
+
}
|
|
64
|
+
(_a = props.configure.items) == null ? void 0 : _a.forEach((item) => {
|
|
65
|
+
columnsConfigKeyValues.value[item.uuid] = item;
|
|
66
|
+
if (Object.keys(item.style).length > 0) {
|
|
67
|
+
columnStyleSourceConfig.value[item.props.base.prop] = {
|
|
68
|
+
cellStyle: item.style,
|
|
69
|
+
titleStyle: item.titleStyle
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (item.formula && item.formula.trim() !== "") {
|
|
73
|
+
dataFormulaMapping.value[item.props.base.prop] = item.formula;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
showSummary.value = props.configure.props.base.showSummary;
|
|
78
|
+
if (showSummary.value || props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
|
|
79
|
+
tableSummaryTitle.value = getSummaryTitleColumn(props.configure);
|
|
80
|
+
if (showSummary.value) {
|
|
81
|
+
tableSummaryColumns.value = getSummaryDataColumn(props.configure, "table");
|
|
82
|
+
}
|
|
83
|
+
if (props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
|
|
84
|
+
groupSummaryColumns.value = getSummaryDataColumn(props.configure, "group");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
let maxHeight = 300;
|
|
88
|
+
let sizeConfig = getSizeConfig(props.pageContext, props.configure);
|
|
89
|
+
if (sizeConfig && sizeConfig.maxHeight) {
|
|
90
|
+
maxHeight = sizeConfig.maxHeight;
|
|
91
|
+
}
|
|
92
|
+
if (!maxHeight && sizeConfig && sizeConfig.fixHeight) {
|
|
93
|
+
maxHeight = sizeConfig.fixHeight;
|
|
94
|
+
}
|
|
95
|
+
if (maxHeight) {
|
|
96
|
+
maxHeight = Number(maxHeight + "");
|
|
97
|
+
}
|
|
98
|
+
onMounted(() => {
|
|
99
|
+
const resultData = getChartDatasFromPage(props.pageContext, props.configure);
|
|
100
|
+
if (resultData) {
|
|
101
|
+
updateChartDatas(resultData);
|
|
102
|
+
} else {
|
|
103
|
+
if (props.configure.props.dataOrigin.dataSource === "variable") {
|
|
104
|
+
watchVariableDataChange();
|
|
105
|
+
const tmpTableData2 = getValueFromVariable(
|
|
106
|
+
props.pageContext.entity,
|
|
107
|
+
props.configure.props.dataOrigin.variable
|
|
108
|
+
);
|
|
109
|
+
if (tmpTableData2) {
|
|
110
|
+
loadTable(tmpTableData2, resultData);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
37
114
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const o3 = function(e4, o4, n2) {
|
|
51
|
-
const r2 = B.configure.props.dataOrigin.rowToColumn.titleColumns, t2 = B.configure.props.dataOrigin.rowToColumn.dataColumns, i2 = e4.props.dataOrigin.groupField;
|
|
52
|
-
if ((!i2 || 0 === i2.length) && n2.length > 0) {
|
|
53
|
-
const e5 = [];
|
|
54
|
-
return e5.push(P("$GroupColumn", B.configure.props.dataOrigin.rowToColumn.firstColumnTitle, 0, "string")), Object.keys(n2[0]).forEach((o5, n3) => {
|
|
55
|
-
if ("$GroupColumn" === o5) return;
|
|
56
|
-
const r3 = P(o5, o5, n3 + 1, "string");
|
|
57
|
-
e5.push(r3);
|
|
58
|
-
}), e5;
|
|
115
|
+
function watchVariableDataChange() {
|
|
116
|
+
const match = props.configure.props.dataOrigin.variable.match(/\${(.*?)}/);
|
|
117
|
+
const path = match ? match[1].split(".") : [];
|
|
118
|
+
watch(
|
|
119
|
+
() => path.reduce((obj, key) => obj[key], props.pageContext.entity),
|
|
120
|
+
(newVal) => {
|
|
121
|
+
console.log("统计表格监听数据变量的变化 newVal:", newVal);
|
|
122
|
+
if (newVal) {
|
|
123
|
+
updateChartDatas(JSON.parse(JSON.stringify(newVal)));
|
|
124
|
+
} else {
|
|
125
|
+
tableData.value = [];
|
|
126
|
+
resetTableColumns();
|
|
59
127
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function updateChartDatas(resultData) {
|
|
132
|
+
if (!resultData) {
|
|
133
|
+
resultData = [];
|
|
134
|
+
}
|
|
135
|
+
resultData = resultData.length > 0 ? resultData[0] : {};
|
|
136
|
+
if (!resultData) {
|
|
137
|
+
resultData = {};
|
|
138
|
+
}
|
|
139
|
+
if (resultData.hasRender) {
|
|
140
|
+
resultData.hasRender = true;
|
|
141
|
+
console.log("重复更新!", resultData);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
updateTable(resultData);
|
|
145
|
+
resultData.hasRender = true;
|
|
146
|
+
if (dataConfig) {
|
|
147
|
+
dataConfig.autoRefresh = false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function updateTable(resultData) {
|
|
151
|
+
setCustomColumns(resultData);
|
|
152
|
+
if (props.configure.props.dataOrigin.dataSource === "service" && resultData.result) {
|
|
153
|
+
tmpTableData = resultData.result[props.configure.props.dataOrigin.service.serviceDataField];
|
|
154
|
+
} else if (props.configure.props.dataOrigin.dataSource === "variable") {
|
|
155
|
+
watchVariableDataChange();
|
|
156
|
+
tmpTableData = getValueFromVariable(
|
|
157
|
+
props.pageContext.entity,
|
|
158
|
+
props.configure.props.dataOrigin.variable
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
if (tmpTableData) {
|
|
162
|
+
loadTable(tmpTableData, resultData);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function loadTable(tmpTableData2, resultData) {
|
|
166
|
+
var _a2;
|
|
167
|
+
if (enableTransition("rowToColumn")) {
|
|
168
|
+
tmpTableData2 = rowDataToColumn(tmpTableData2, props.configure, tableColumnsConfig.value);
|
|
169
|
+
if (!isEnableGroupHeader.value) {
|
|
170
|
+
const updatedColumnConfig = updateColumnConfig(
|
|
171
|
+
props.configure,
|
|
172
|
+
tableColumnsConfig.value,
|
|
173
|
+
tmpTableData2
|
|
174
|
+
);
|
|
175
|
+
tableColumnsConfig.value = updatedColumnConfig;
|
|
176
|
+
}
|
|
177
|
+
} else if (enableTransition("columnToRow")) {
|
|
178
|
+
if (!isEnableGroupHeader.value) {
|
|
179
|
+
tableColumnsConfig.value = getColumnToRowTableConfig(props.configure);
|
|
180
|
+
}
|
|
181
|
+
tmpTableData2 = colDataToRow(tmpTableData2, props.configure);
|
|
182
|
+
}
|
|
183
|
+
if (props.configure.props.dataOrigin.dataFormatting) {
|
|
184
|
+
const func = getCustomFunc(props.pageContext, props.configure.props.dataOrigin.dataFormatting);
|
|
185
|
+
if (func) {
|
|
186
|
+
const resultValue = func.apply(func, [{ tableData: tmpTableData2 }]);
|
|
187
|
+
if (resultValue) {
|
|
188
|
+
tmpTableData2 = resultValue;
|
|
77
189
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (Object.keys(dataFormulaMapping.value).length > 0 && tmpTableData2 && tmpTableData2.length > 0) {
|
|
193
|
+
computeFormula(dataFormulaMapping.value, tmpTableData2, props.pageContext.entity);
|
|
194
|
+
}
|
|
195
|
+
if ((_a2 = props.configure.pageination) == null ? void 0 : _a2.enable) {
|
|
196
|
+
tableDataPageination(resultData);
|
|
197
|
+
} else {
|
|
198
|
+
tableData.value = tmpTableData2;
|
|
199
|
+
}
|
|
200
|
+
if (props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
|
|
201
|
+
const groupField = props.configure.props.highOrder.groupField;
|
|
202
|
+
tableData.value = groupAndAddTotals(tableData.value, groupField);
|
|
203
|
+
}
|
|
204
|
+
pushTableIndexColumn(tableColumnsConfig.value);
|
|
205
|
+
}
|
|
206
|
+
function enableTransition(type) {
|
|
207
|
+
return props.configure.props.dataOrigin.transition === type && // props.configure.props.dataOrigin.groupField &&
|
|
208
|
+
// props.configure.props.dataOrigin.groupField.length > 0 &&
|
|
209
|
+
props.configure.props.dataOrigin[type].titleColumns && props.configure.props.dataOrigin[type].titleColumns.length > 0 && props.configure.props.dataOrigin[type].dataColumns && props.configure.props.dataOrigin[type].dataColumns.length > 0;
|
|
210
|
+
}
|
|
211
|
+
function getHeaderCellStyle(data) {
|
|
212
|
+
const cellTitleStyle = columnStyleSourceConfig.value[data.column.property] ? columnStyleSourceConfig.value[data.column.property].titleStyle : null;
|
|
213
|
+
const rowTitleStyle = runtimeStyle == null ? void 0 : runtimeStyle.titleStyle;
|
|
214
|
+
return getHeaderCellStyleUtil(
|
|
215
|
+
data,
|
|
216
|
+
{ cellTitleStyle, titleStyle: rowTitleStyle },
|
|
217
|
+
props
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
function getRowStyle(data) {
|
|
221
|
+
return getRowStyleUtil(data, groupSummaryDataRowIndex, props);
|
|
222
|
+
}
|
|
223
|
+
function getCellStyle(data) {
|
|
224
|
+
const cellStyles = columnStyleSourceConfig.value[data.column.property] ? columnStyleSourceConfig.value[data.column.property].cellStyle : null;
|
|
225
|
+
return getCellStyleUtil(data, cellStyles, props);
|
|
226
|
+
}
|
|
227
|
+
const getSummaries = (param) => {
|
|
228
|
+
const { columns, data } = param;
|
|
229
|
+
const sums = [];
|
|
230
|
+
columns.forEach((column, index) => {
|
|
231
|
+
if (tableSummaryTitle.value[column.property]) {
|
|
232
|
+
const label = tableSummaryTitle.value[column.property].label;
|
|
233
|
+
sums[index] = h("div", {}, [replacePlaceholders(label, data)]);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (tableSummaryColumns.value[column.property]) {
|
|
237
|
+
const scientificData = data.filter((item, index2) => !groupSummaryDataRowIndex.includes(index2));
|
|
238
|
+
sums[index] = summaryStatistics(
|
|
239
|
+
tableSummaryColumns.value[column.property],
|
|
240
|
+
scientificData,
|
|
241
|
+
column.property,
|
|
242
|
+
props.pageContext
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
return sums;
|
|
247
|
+
};
|
|
248
|
+
function spanMethod({ row, column, rowIndex, columnIndex }) {
|
|
249
|
+
const property = column.property;
|
|
250
|
+
const highOrder = props.configure.props.highOrder;
|
|
251
|
+
if (highOrder.scopeFunc) {
|
|
252
|
+
const func = getCustomFunc(props.pageContext, highOrder.scopeFunc);
|
|
253
|
+
if (func) {
|
|
254
|
+
const resultValue = func.apply(func, [
|
|
255
|
+
{ tableData: tableData.value, row, column, rowIndex, columnIndex }
|
|
256
|
+
]);
|
|
257
|
+
if (resultValue) {
|
|
258
|
+
return resultValue;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
if (highOrder && highOrder.mergeColumn) ;
|
|
263
|
+
if (highOrder && highOrder.mergeRow && highOrder.mergeRow.includes(property)) {
|
|
264
|
+
if (rowIndex === 0) {
|
|
265
|
+
return {
|
|
266
|
+
rowspan: tableData.value.length,
|
|
267
|
+
colspan: 1
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function updateColumnConfig(configure, columnConfigs, pivotedData) {
|
|
274
|
+
const columnFields = props.configure.props.dataOrigin.rowToColumn.titleColumns;
|
|
275
|
+
const valueFields = props.configure.props.dataOrigin.rowToColumn.dataColumns;
|
|
276
|
+
const groupByFields = configure.props.dataOrigin.groupField;
|
|
277
|
+
if ((!groupByFields || groupByFields.length === 0) && pivotedData.length > 0) {
|
|
278
|
+
const newConfig = [];
|
|
279
|
+
newConfig.push(
|
|
280
|
+
getNewColumnConfig(
|
|
281
|
+
"$GroupColumn",
|
|
282
|
+
props.configure.props.dataOrigin.rowToColumn.firstColumnTitle,
|
|
283
|
+
0,
|
|
284
|
+
"string"
|
|
285
|
+
)
|
|
286
|
+
);
|
|
287
|
+
Object.keys(pivotedData[0]).forEach((key, index) => {
|
|
288
|
+
if (key === "$GroupColumn") {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const newConfigItem = getNewColumnConfig(key, key, index + 1, "string");
|
|
292
|
+
newConfig.push(newConfigItem);
|
|
100
293
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const o2 = se.value[e3.column.property] ? se.value[e3.column.property].cellStyle : null;
|
|
134
|
-
return J(e3, o2, B);
|
|
135
|
-
}
|
|
136
|
-
he && he.maxHeight && (me = he.maxHeight), !me && he && he.fixHeight && (me = he.fixHeight), me && (me = Number(me + "")), n(() => {
|
|
137
|
-
const e3 = b(B.pageContext, B.configure);
|
|
138
|
-
if (e3) ye(e3);
|
|
139
|
-
else if ("variable" === B.configure.props.dataOrigin.dataSource) {
|
|
140
|
-
ve();
|
|
141
|
-
const o2 = O(B.pageContext.entity, B.configure.props.dataOrigin.variable);
|
|
142
|
-
o2 && Ce(o2, e3);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
const Se = (e3) => {
|
|
146
|
-
const { columns: o2, data: n2 } = e3, r2 = [];
|
|
147
|
-
return o2.forEach((e4, o3) => {
|
|
148
|
-
if (ae.value[e4.property]) {
|
|
149
|
-
const t2 = ae.value[e4.property].label;
|
|
150
|
-
r2[o3] = y("div", {}, [G(t2, n2)]);
|
|
151
|
-
} else if (ue.value[e4.property]) {
|
|
152
|
-
const t2 = n2.filter((e5, o4) => !pe.includes(o4));
|
|
153
|
-
r2[o3] = U(ue.value[e4.property], t2, e4.property, B.pageContext);
|
|
154
|
-
}
|
|
155
|
-
}), r2;
|
|
156
|
-
};
|
|
157
|
-
function je({ row: e3, column: o2, rowIndex: n2, columnIndex: r2 }) {
|
|
158
|
-
const t2 = o2.property, i2 = B.configure.props.highOrder;
|
|
159
|
-
if (i2.scopeFunc) {
|
|
160
|
-
const t3 = $(B.pageContext, i2.scopeFunc);
|
|
161
|
-
if (t3) {
|
|
162
|
-
const i3 = t3.apply(t3, [{ tableData: oe.value, row: e3, column: o2, rowIndex: n2, columnIndex: r2 }]);
|
|
163
|
-
if (i3) return i3;
|
|
164
|
-
}
|
|
165
|
-
} else if (i2 && i2.mergeColumn, i2 && i2.mergeRow && i2.mergeRow.includes(t2) && 0 === n2) return { rowspan: oe.value.length, colspan: 1 };
|
|
166
|
-
}
|
|
167
|
-
function Ee(e3, o2) {
|
|
168
|
-
"frontend" === B.configure.pageination.type ? ke(e3, o2) : Fe(e3, o2);
|
|
169
|
-
}
|
|
170
|
-
function $e(e3, o2) {
|
|
171
|
-
"frontend" === B.configure.pageination.type ? ke(e3, o2) : Fe(e3, o2);
|
|
172
|
-
}
|
|
173
|
-
function ke(e3, o2) {
|
|
174
|
-
de && (oe.value = de.slice((e3 - 1) * o2, e3 * o2));
|
|
175
|
-
}
|
|
176
|
-
function Fe(e3, o2) {
|
|
177
|
-
B.configure.pageination.currentPageSet && S(B.pageContext.entity, B.configure.pageination.currentPageSet, e3), B.configure.pageination.pageSizeSet && S(B.pageContext.entity, B.configure.pageination.pageSizeSet, o2), j(B.pageContext, B.configure.uuid);
|
|
178
|
-
}
|
|
179
|
-
function Ie(e3) {
|
|
180
|
-
const o2 = e3.showCondition;
|
|
181
|
-
return E(B.pageContext, o2);
|
|
182
|
-
}
|
|
183
|
-
function Re(e3) {
|
|
184
|
-
if (B.configure.props.modelCustom) {
|
|
185
|
-
const o2 = $(B.pageContext, B.configure.props.modelCustom);
|
|
186
|
-
if (o2) {
|
|
187
|
-
const n2 = o2.apply(o2, [{ pageContext: B.pageContext, configureObj: B.configure, value: e3 }]);
|
|
188
|
-
w(n2) ? n2.then((e4) => {
|
|
189
|
-
ne.value = e4.columns;
|
|
190
|
-
}) : ne.value = n2.columns;
|
|
294
|
+
return newConfig;
|
|
295
|
+
} else {
|
|
296
|
+
const updatedConfig = [...columnConfigs].filter(
|
|
297
|
+
(item) => !columnFields.includes(item.props.base.prop) && !valueFields.includes(item.props.base.prop)
|
|
298
|
+
);
|
|
299
|
+
const valueFieldsRegex = new RegExp(`(${valueFields.join("|")})$`);
|
|
300
|
+
const columnCombinations = /* @__PURE__ */ new Set();
|
|
301
|
+
pivotedData.forEach((record) => {
|
|
302
|
+
Object.keys(record).forEach((key) => {
|
|
303
|
+
if (valueFields.some((valueField) => key.includes(valueField))) {
|
|
304
|
+
const parts = key.split(valueFieldsRegex);
|
|
305
|
+
const combination = parts[0];
|
|
306
|
+
columnCombinations.add(combination);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
columnCombinations.forEach((combination) => {
|
|
311
|
+
valueFields.forEach((valueField) => {
|
|
312
|
+
var _a2;
|
|
313
|
+
(_a2 = tableColumnsConfig.value.find(
|
|
314
|
+
(item) => item.props.base.prop === valueField
|
|
315
|
+
)) == null ? void 0 : _a2.props.base.name;
|
|
316
|
+
const newConfigItem = getNewColumnConfig(
|
|
317
|
+
`${combination}${valueField}`,
|
|
318
|
+
`${combination}${valueField}`,
|
|
319
|
+
updatedConfig.length + 1,
|
|
320
|
+
typeof pivotedData[0][`${combination}${valueField}`] === "number" ? "number" : "string"
|
|
321
|
+
);
|
|
322
|
+
updatedConfig.push(newConfigItem);
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
return updatedConfig;
|
|
191
326
|
}
|
|
192
327
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
328
|
+
function groupAndAddTotals(data, groupFields) {
|
|
329
|
+
var _a2, _b;
|
|
330
|
+
if (groupSummaryColumns.value.length === 0) {
|
|
331
|
+
return data;
|
|
332
|
+
}
|
|
333
|
+
const result = [];
|
|
334
|
+
const groupColumns = (_a2 = props.configure.items) == null ? void 0 : _a2.filter(
|
|
335
|
+
(item) => groupFields.includes(item.props.base.prop)
|
|
336
|
+
);
|
|
337
|
+
const summaryColumns = (_b = props.configure.items) == null ? void 0 : _b.filter(
|
|
338
|
+
(item) => item.props.base.groupSummary === true
|
|
339
|
+
);
|
|
340
|
+
const groupedData = {};
|
|
341
|
+
data.forEach((item) => {
|
|
342
|
+
const key = groupFields.map((field) => item[field]).join("|");
|
|
343
|
+
if (!groupedData[key]) {
|
|
344
|
+
groupedData[key] = [];
|
|
345
|
+
}
|
|
346
|
+
groupedData[key].push(item);
|
|
347
|
+
});
|
|
348
|
+
const groupResult = Object.values(groupedData);
|
|
349
|
+
for (let i = 0; i < groupResult.length; i++) {
|
|
350
|
+
const group = groupResult[i];
|
|
351
|
+
const total2 = {};
|
|
352
|
+
summaryColumns == null ? void 0 : summaryColumns.forEach((column) => {
|
|
353
|
+
const prop = column.props.base.prop;
|
|
354
|
+
const res = summaryStatistics(groupSummaryColumns.value[prop], group, prop, props.pageContext);
|
|
355
|
+
total2[prop] = res;
|
|
356
|
+
});
|
|
357
|
+
result.push(...group);
|
|
358
|
+
groupColumns == null ? void 0 : groupColumns.forEach((column) => {
|
|
359
|
+
const prop = column.props.base.prop;
|
|
360
|
+
total2[prop] = replacePlaceholders(column.props.base.summaryTitle, group[0]);
|
|
361
|
+
});
|
|
362
|
+
result.push(total2);
|
|
363
|
+
groupSummaryDataRowIndex.push(result.length - 1);
|
|
364
|
+
}
|
|
365
|
+
return result;
|
|
366
|
+
}
|
|
367
|
+
function pushTableIndexColumn(tableColumnsConfig2) {
|
|
368
|
+
if (props.configure.props.base.showIndex && tableColumnsConfig2.findIndex((item) => item.props.base.prop === "$index") === -1) {
|
|
369
|
+
const indexColumn = getIndexColumn();
|
|
370
|
+
if (indexColumn) {
|
|
371
|
+
tableColumnsConfig2.unshift(indexColumn);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function tableDataPageination(resultData) {
|
|
376
|
+
if (props.configure.pageination.type === "frontend") {
|
|
377
|
+
total.value = tmpTableData.length;
|
|
378
|
+
frontendPageination(1, props.configure.pageination.pageSize);
|
|
379
|
+
} else if (props.configure.pageination.type === "backend") {
|
|
380
|
+
tableData.value = tmpTableData;
|
|
381
|
+
if (props.configure.pageination.totalFrom) {
|
|
382
|
+
total.value = resultData.result[props.configure.pageination.totalFrom];
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function pageChange(currentPage, pageSize) {
|
|
387
|
+
if (props.configure.pageination.type === "frontend") {
|
|
388
|
+
frontendPageination(currentPage, pageSize);
|
|
389
|
+
} else {
|
|
390
|
+
backendPageination(currentPage, pageSize);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
function pageSizeChange(currentPage, pageSize) {
|
|
394
|
+
if (props.configure.pageination.type === "frontend") {
|
|
395
|
+
frontendPageination(currentPage, pageSize);
|
|
396
|
+
} else {
|
|
397
|
+
backendPageination(currentPage, pageSize);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function frontendPageination(currentPage, pageSize) {
|
|
401
|
+
if (tmpTableData) {
|
|
402
|
+
tableData.value = tmpTableData.slice((currentPage - 1) * pageSize, currentPage * pageSize);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function backendPageination(currentPage, pageSize) {
|
|
406
|
+
if (props.configure.pageination.currentPageSet) {
|
|
407
|
+
setValueForVariableName(
|
|
408
|
+
props.pageContext.entity,
|
|
409
|
+
props.configure.pageination.currentPageSet,
|
|
410
|
+
currentPage
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
if (props.configure.pageination.pageSizeSet) {
|
|
414
|
+
setValueForVariableName(
|
|
415
|
+
props.pageContext.entity,
|
|
416
|
+
props.configure.pageination.pageSizeSet,
|
|
417
|
+
pageSize
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
updateChartDatasourcesByComponent(props.pageContext, props.configure.uuid);
|
|
421
|
+
}
|
|
422
|
+
function calacShowColumn(column) {
|
|
423
|
+
const showCondition = column.showCondition;
|
|
424
|
+
return caculateShowCondition(props.pageContext, showCondition);
|
|
425
|
+
}
|
|
426
|
+
function resetTableColumns() {
|
|
427
|
+
console.log("重置统计表格列配置");
|
|
428
|
+
if (!props.configure.props.modelCustom) {
|
|
429
|
+
if (!isEnableGroupHeader.value) {
|
|
430
|
+
tableColumnsConfig.value = props.configure.items;
|
|
431
|
+
} else {
|
|
432
|
+
groupColumnsConfig.value = props.configure.props.groupHeaders;
|
|
433
|
+
}
|
|
434
|
+
} else {
|
|
435
|
+
setCustomColumns(null);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
function setCustomColumns(resultData) {
|
|
439
|
+
if (props.configure.props.modelCustom) {
|
|
440
|
+
const func = getCustomFunc(props.pageContext, props.configure.props.modelCustom);
|
|
441
|
+
if (func) {
|
|
442
|
+
const resultValue = func.apply(func, [
|
|
443
|
+
{
|
|
444
|
+
pageContext: props.pageContext,
|
|
445
|
+
configureObj: props.configure,
|
|
446
|
+
value: resultData
|
|
447
|
+
}
|
|
448
|
+
]);
|
|
449
|
+
if (isPromise(resultValue)) {
|
|
450
|
+
resultValue.then((res) => {
|
|
451
|
+
tableColumnsConfig.value = res.columns;
|
|
452
|
+
});
|
|
453
|
+
} else {
|
|
454
|
+
tableColumnsConfig.value = resultValue.columns;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function exportChart() {
|
|
460
|
+
let tableColumns = [];
|
|
461
|
+
let columns = [];
|
|
462
|
+
if (!isEnableGroupHeader.value) {
|
|
463
|
+
columns = props.configure.items;
|
|
464
|
+
} else {
|
|
465
|
+
columns = props.configure.props.groupHeaders;
|
|
466
|
+
}
|
|
467
|
+
let formatColumns = [];
|
|
468
|
+
pakcageExportColumn(columns, tableColumns, formatColumns);
|
|
469
|
+
const exportData = formatTableData(formatColumns);
|
|
470
|
+
return {
|
|
471
|
+
isTable: true,
|
|
472
|
+
dataArr: exportData,
|
|
473
|
+
columns: tableColumns
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
function pakcageExportColumn(columns, tableColumns, formatColumns) {
|
|
477
|
+
columns.forEach((col) => {
|
|
478
|
+
const propName = col.props.base.prop;
|
|
479
|
+
const label = col.props.base.name;
|
|
480
|
+
const i18nKey = label;
|
|
481
|
+
let tableCol = { name: propName, label, i18nKey };
|
|
482
|
+
if (col.children && col.childern.length > 0) {
|
|
483
|
+
tableCol.children = [];
|
|
484
|
+
pakcageExportColumn(col.children, tableCol.children, formatColumns);
|
|
485
|
+
}
|
|
486
|
+
if (col.props.format && col.props.format.type) {
|
|
487
|
+
formatColumns.push(col);
|
|
488
|
+
}
|
|
489
|
+
tableColumns.push(tableCol);
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function formatTableData(formatColumns) {
|
|
493
|
+
let exportTableData = [];
|
|
494
|
+
if (tableData.value) {
|
|
495
|
+
exportTableData = deepCopy(tableData.value);
|
|
496
|
+
exportTableData.forEach((row) => {
|
|
497
|
+
formatColumns.forEach((col) => {
|
|
498
|
+
const label = formatColContent(
|
|
499
|
+
row,
|
|
500
|
+
col.props.format,
|
|
501
|
+
col,
|
|
502
|
+
props.pageContext,
|
|
503
|
+
props.configure
|
|
504
|
+
);
|
|
505
|
+
row[col.props.base.prop] = label;
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
return exportTableData;
|
|
510
|
+
}
|
|
511
|
+
function pushIdnexColumnToGroupHeaders() {
|
|
512
|
+
if (props.configure.props.base.showIndex) {
|
|
513
|
+
groupColumnsConfig.value.unshift({
|
|
514
|
+
columnUuid: "$index",
|
|
515
|
+
displayOrder: 0,
|
|
516
|
+
isLeaf: true,
|
|
517
|
+
prop: "$index",
|
|
518
|
+
titleText: "序号",
|
|
519
|
+
uuid: "$index"
|
|
520
|
+
});
|
|
521
|
+
const indexColumn = getIndexColumn();
|
|
522
|
+
if (indexColumn) {
|
|
523
|
+
columnsConfigKeyValues.value["$index"] = indexColumn;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
__expose({
|
|
528
|
+
updateChartDatas,
|
|
529
|
+
exportChart
|
|
199
530
|
});
|
|
531
|
+
return (_ctx, _cache) => {
|
|
532
|
+
const _component_el_table = resolveComponent("el-table");
|
|
533
|
+
return openBlock(), createElementBlock("div", {
|
|
534
|
+
style: normalizeStyle([unref(runtimeStyle), { "display": "flex", "flex-direction": "column" }]),
|
|
535
|
+
class: normalizeClass([unref(runtimeClass), "amb-widget-chart amb-widget-flex"]),
|
|
536
|
+
ref: "thisRef"
|
|
537
|
+
}, [
|
|
538
|
+
withDirectives(createVNode(_sfc_main$1, {
|
|
539
|
+
ref_key: "headerRef",
|
|
540
|
+
ref: headerRef,
|
|
541
|
+
headerInfo: unref(headerInfo),
|
|
542
|
+
configure: __props.configure,
|
|
543
|
+
pageContext: __props.pageContext
|
|
544
|
+
}, null, 8, ["headerInfo", "configure", "pageContext"]), [
|
|
545
|
+
[vShow, unref(headerInfo).showHeader || __props.pageContext.showHomepageSearch]
|
|
546
|
+
]),
|
|
547
|
+
createVNode(_component_el_table, {
|
|
548
|
+
ref_key: "gridRef",
|
|
549
|
+
ref: gridRef,
|
|
550
|
+
data: tableData.value,
|
|
551
|
+
style: { "width": "100%" },
|
|
552
|
+
"max-height": unref(maxHeight),
|
|
553
|
+
"header-cell-style": getHeaderCellStyle,
|
|
554
|
+
"row-style": getRowStyle,
|
|
555
|
+
"cell-style": getCellStyle,
|
|
556
|
+
"show-summary": showSummary.value,
|
|
557
|
+
stripe: __props.configure.props.base.stripe,
|
|
558
|
+
"summary-method": getSummaries,
|
|
559
|
+
"span-method": spanMethod
|
|
560
|
+
}, {
|
|
561
|
+
default: withCtx(() => [
|
|
562
|
+
isEnableGroupHeader.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(groupColumnsConfig.value, (item, index) => {
|
|
563
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
564
|
+
!item.isLeaf ? (openBlock(), createBlock(_sfc_main$2, {
|
|
565
|
+
key: 0,
|
|
566
|
+
configure: __props.configure,
|
|
567
|
+
pageContext: __props.pageContext,
|
|
568
|
+
groupColumn: item,
|
|
569
|
+
columnsConfigKeyValues: columnsConfigKeyValues.value
|
|
570
|
+
}, null, 8, ["configure", "pageContext", "groupColumn", "columnsConfigKeyValues"])) : calacShowColumn(columnsConfigKeyValues.value[item.columnUuid]) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
571
|
+
key: 1,
|
|
572
|
+
configure: __props.configure,
|
|
573
|
+
pageContext: __props.pageContext,
|
|
574
|
+
column: columnsConfigKeyValues.value[item.columnUuid]
|
|
575
|
+
}, null, 8, ["configure", "pageContext", "column"])) : createCommentVNode("", true)
|
|
576
|
+
], 64);
|
|
577
|
+
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(tableColumnsConfig.value, (column, index) => {
|
|
578
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
579
|
+
calacShowColumn(column) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
580
|
+
key: 0,
|
|
581
|
+
column,
|
|
582
|
+
configure: __props.configure,
|
|
583
|
+
pageContext: __props.pageContext
|
|
584
|
+
}, null, 8, ["column", "configure", "pageContext"])) : createCommentVNode("", true)
|
|
585
|
+
], 64);
|
|
586
|
+
}), 128))
|
|
587
|
+
]),
|
|
588
|
+
_: 1
|
|
589
|
+
}, 8, ["data", "max-height", "show-summary", "stripe"]),
|
|
590
|
+
__props.configure.pageination && __props.configure.pageination.enable ? (openBlock(), createBlock(_sfc_main$4, {
|
|
591
|
+
key: 0,
|
|
592
|
+
configure: __props.configure,
|
|
593
|
+
"table-data": tableData.value,
|
|
594
|
+
total: total.value,
|
|
595
|
+
onPageChange: pageChange,
|
|
596
|
+
onPageSizeChange: pageSizeChange
|
|
597
|
+
}, null, 8, ["configure", "table-data", "total"])) : createCommentVNode("", true)
|
|
598
|
+
], 6);
|
|
599
|
+
};
|
|
200
600
|
}
|
|
201
|
-
|
|
202
|
-
let e3 = [], o2 = [];
|
|
203
|
-
o2 = ee.value ? B.configure.props.groupHeaders : B.configure.items;
|
|
204
|
-
let n2 = [];
|
|
205
|
-
He(o2, e3, n2);
|
|
206
|
-
return { isTable: true, dataArr: function(e4) {
|
|
207
|
-
let o3 = [];
|
|
208
|
-
oe.value && (o3 = A(oe.value), o3.forEach((o4) => {
|
|
209
|
-
e4.forEach((e5) => {
|
|
210
|
-
const n3 = L(o4, e5.props.format, e5, B.pageContext, B.configure);
|
|
211
|
-
o4[e5.props.base.prop] = n3;
|
|
212
|
-
});
|
|
213
|
-
}));
|
|
214
|
-
return o3;
|
|
215
|
-
}(n2), columns: e3 };
|
|
216
|
-
} }), (o2, n2) => {
|
|
217
|
-
const r2 = t("el-table");
|
|
218
|
-
return a(), i("div", { style: l([p(Q), { display: "flex", "flex-direction": "column" }]), class: u([p(W), "amb-widget-chart amb-widget-flex"]), ref: "thisRef" }, [s(c(C, { ref_key: "headerRef", ref: Z, headerInfo: p(Y), configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["headerInfo", "configure", "pageContext"]), [[d, p(Y).showHeader || e2.pageContext.showHomepageSearch]]), c(r2, { ref_key: "gridRef", ref: ge, data: oe.value, style: { width: "100%" }, "max-height": p(me), "header-cell-style": be, "row-style": Oe, "cell-style": we, "show-summary": ie.value, stripe: e2.configure.props.base.stripe, "summary-method": Se, "span-method": je }, { default: m(() => [ee.value ? (a(true), i(h, { key: 0 }, v(re.value, (o3, n3) => (a(), i(h, { key: n3 }, [o3.isLeaf ? Ie(te.value[o3.columnUuid]) ? (a(), g(F, { key: 1, configure: e2.configure, pageContext: e2.pageContext, column: te.value[o3.columnUuid] }, null, 8, ["configure", "pageContext", "column"])) : f("", true) : (a(), g(k, { key: 0, configure: e2.configure, pageContext: e2.pageContext, groupColumn: o3, columnsConfigKeyValues: te.value }, null, 8, ["configure", "pageContext", "groupColumn", "columnsConfigKeyValues"]))], 64))), 128)) : (a(true), i(h, { key: 1 }, v(ne.value, (o3, n3) => (a(), i(h, { key: n3 }, [Ie(o3) ? (a(), g(F, { key: 0, column: o3, configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["column", "configure", "pageContext"])) : f("", true)], 64))), 128))]), _: 1 }, 8, ["data", "max-height", "show-summary", "stripe"]), e2.configure.pageination && e2.configure.pageination.enable ? (a(), g(I, { key: 0, configure: e2.configure, "table-data": oe.value, total: fe.value, onPageChange: Ee, onPageSizeChange: $e }, null, 8, ["configure", "table-data", "total"])) : f("", true)], 6);
|
|
219
|
-
};
|
|
220
|
-
} });
|
|
601
|
+
});
|
|
221
602
|
export {
|
|
222
|
-
|
|
603
|
+
_sfc_main as default
|
|
223
604
|
};
|