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,274 +1,644 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { setTableEvents
|
|
3
|
-
import { caculateShowCondition
|
|
4
|
-
import { getModelFields
|
|
5
|
-
import
|
|
6
|
-
import { popupToPage
|
|
7
|
-
import { getListCode
|
|
8
|
-
import { getAdditionalParamMap
|
|
9
|
-
import { getRowStyleUtil
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
import { defineComponent, ref, onMounted, onUnmounted, resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, unref } from "vue";
|
|
2
|
+
import { setTableEvents, gridSelectRecord, gridSelectAllRecords, gridSelectionChange, cellClick, cellDblClick, rowClick, rowDblClick, headerClick, getHandleEvent } from "../../../../utils/events/event-util.js";
|
|
3
|
+
import { caculateShowCondition, setVariableValue, getVariableValue, getSizeConfig } from "../../../../utils/page-helper-util.js";
|
|
4
|
+
import { getModelFields, getDefaultValue } from "../../../../utils/page-init-util.js";
|
|
5
|
+
import bus from "../../../../utils/eventBus.js";
|
|
6
|
+
import { popupToPage, getOperationButtons } from "../../../../utils/table-utils.js";
|
|
7
|
+
import { getListCode, getBaseUrl } from "../../../../utils/common-util.js";
|
|
8
|
+
import { getAdditionalParamMap } from "../../../../utils/events/standard-event.js";
|
|
9
|
+
import { getRowStyleUtil, getCellStyleUtil, getHeaderCellStyleUtil } from "../../chart/table/chart-table-util.js";
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "sub-table-runtime",
|
|
12
|
+
props: {
|
|
13
|
+
pageContext: {},
|
|
14
|
+
configure: {}
|
|
15
|
+
},
|
|
16
|
+
emits: ["setSafeDeleteTableCode"],
|
|
17
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const pageContext = props.pageContext;
|
|
20
|
+
let configure = props.configure;
|
|
21
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
22
|
+
if (pageContext.isTest) {
|
|
23
|
+
runtimeInfo.value = props.configure.runtime ? props.configure.runtime : {};
|
|
24
|
+
} else {
|
|
25
|
+
if (pageContext.tableRuntimes && pageContext.tableRuntimes[configure.uuid]) {
|
|
26
|
+
configure = JSON.parse(pageContext.tableRuntimes[configure.uuid].configure);
|
|
27
|
+
runtimeInfo.value = configure.runtime ? configure.runtime : {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const listCode = getListCode(pageContext.code, pageContext.version, configure.uuid);
|
|
31
|
+
const dataModel = pageContext.entity.data;
|
|
32
|
+
const prop = configure.code ? configure.code : listCode;
|
|
33
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
34
|
+
const tableEvents = runtimeInfo && runtimeInfo.events ? runtimeInfo.events : [];
|
|
35
|
+
const selections = ref([]);
|
|
36
|
+
const superGridItems = pageContext.superGridItems;
|
|
37
|
+
const superGridSetting = superGridItems ? superGridItems[configure.uuid] : null;
|
|
38
|
+
console.log("superGridSetting===", superGridItems, superGridSetting);
|
|
39
|
+
const runtimeStyle = runtimeInfo.style;
|
|
40
|
+
const runtimeClass = runtimeInfo.class;
|
|
41
|
+
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
42
|
+
let dynamicFields = getModelFields(props.configure, prop);
|
|
43
|
+
let baseURL = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
|
|
44
|
+
if (!baseURL) {
|
|
45
|
+
baseURL = window["$vueApp"].config.globalProperties.baseURL;
|
|
46
|
+
}
|
|
47
|
+
const listViewShowFlag = ref(false);
|
|
48
|
+
let componentKey = ref(0);
|
|
49
|
+
const rowKeyProp = configure.props.dataOrigin.principalLinkage;
|
|
50
|
+
const listViewOptions = ref({
|
|
51
|
+
isSql: true,
|
|
52
|
+
subTableData: null,
|
|
53
|
+
rowKeyProp,
|
|
54
|
+
extraParam: {},
|
|
55
|
+
operations: {},
|
|
56
|
+
hiddenColumns: [],
|
|
57
|
+
pageCode: pageContext.code,
|
|
58
|
+
pageVersion: pageContext.version,
|
|
59
|
+
pageContext,
|
|
60
|
+
configureObj: configure,
|
|
61
|
+
showPageArea: false,
|
|
62
|
+
showRowForm: false,
|
|
63
|
+
showOverflowTooltip: !!(configure.props && configure.props.otherSettings && (configure.props.otherSettings.isBreakLine === void 0 || configure.props.otherSettings.isBreakLine === false)),
|
|
64
|
+
// 单元格内容是否换行显示
|
|
65
|
+
backendUrl: baseURL,
|
|
66
|
+
cellStyleRender: getCellStyle,
|
|
67
|
+
rowStyleRender: getRowStyle,
|
|
68
|
+
titleStyleRender: getTitleStyle
|
|
69
|
+
});
|
|
70
|
+
const $emit = __emit;
|
|
71
|
+
if (runtimeStyle) {
|
|
72
|
+
listViewOptions.value["tableStyle"] = runtimeStyle;
|
|
73
|
+
}
|
|
74
|
+
if (runtimeClass) {
|
|
75
|
+
listViewOptions.value["tableClass"] = runtimeClass;
|
|
76
|
+
}
|
|
77
|
+
if (configure.props && configure.props.base && configure.props.base.subPaging === true) {
|
|
78
|
+
listViewOptions.value.showPageArea = true;
|
|
79
|
+
} else {
|
|
80
|
+
listViewOptions.value.showPageArea = false;
|
|
81
|
+
}
|
|
82
|
+
if (configure.props.base.showRowForm) {
|
|
83
|
+
listViewOptions.value.showRowForm = configure.props.base.showRowForm;
|
|
84
|
+
}
|
|
85
|
+
const gridRef = ref(null);
|
|
86
|
+
onMounted(() => {
|
|
87
|
+
const tableUuid = configure.uuid;
|
|
88
|
+
const subTableWatchProps = pageContext.subTableWatchProps;
|
|
89
|
+
bus.$on("_refreshSubTable_" + tableUuid, (params) => {
|
|
90
|
+
console.log("-_refreshSubTable--tableUuid=", tableUuid, "params=", params);
|
|
91
|
+
const propName = params.propName;
|
|
92
|
+
if (subTableWatchProps && subTableWatchProps[tableUuid] && subTableWatchProps[tableUuid].length > 0) {
|
|
93
|
+
const mainFormProps = subTableWatchProps[tableUuid];
|
|
94
|
+
if (mainFormProps.indexOf(propName) >= 0) {
|
|
95
|
+
reloadSubTableData();
|
|
96
|
+
}
|
|
51
97
|
}
|
|
52
|
-
|
|
98
|
+
});
|
|
99
|
+
bus.$on("_refreshSubTableHandle_" + tableUuid, (params) => {
|
|
100
|
+
console.log("-_refreshSubTableHandle_--tableUuid=", tableUuid, "params=", params);
|
|
101
|
+
reloadSubTableData();
|
|
102
|
+
});
|
|
103
|
+
bus.$on(
|
|
104
|
+
"_refreshChildData_" + tableUuid,
|
|
105
|
+
(gridData) => {
|
|
106
|
+
console.log("-_refreshChildData_--tableUuid=", tableUuid);
|
|
107
|
+
refreshChildTableData(gridData);
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
bus.$on(listCode + "-pickFileDone", (data) => {
|
|
111
|
+
console.log("superPage5555---listCode---pickFileDone--listCode=", listCode, "data=", data);
|
|
112
|
+
gridRef.value.pickFileDone(data);
|
|
113
|
+
});
|
|
114
|
+
bus.$on(listCode + "-scanDone", (data) => {
|
|
115
|
+
console.log("superPage5555---listCode---scanDone--listCode=", listCode, "data=", data);
|
|
116
|
+
gridRef.value.scanDone(data);
|
|
117
|
+
});
|
|
118
|
+
if (listViewOptions.value && listViewOptions.value.configureObj.props.base && listViewOptions.value.configureObj.props.base.isSafeDelete) {
|
|
119
|
+
$emit("setSafeDeleteTableCode", listViewOptions.value.extraParam.tableName);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
function reloadSubTableData() {
|
|
123
|
+
if (gridRef.value) {
|
|
124
|
+
listViewOptions.value["subTableData"] = null;
|
|
125
|
+
gridRef.value.reloadSubTableData(listCode);
|
|
53
126
|
}
|
|
54
|
-
return false;
|
|
55
127
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
128
|
+
onUnmounted(() => {
|
|
129
|
+
if (timer) {
|
|
130
|
+
clearTimeout(timer);
|
|
131
|
+
}
|
|
132
|
+
if (timer2) {
|
|
133
|
+
clearTimeout(timer2);
|
|
134
|
+
}
|
|
135
|
+
const tableUuid = configure.uuid;
|
|
136
|
+
bus.$off("_refreshSubTable_" + tableUuid);
|
|
137
|
+
bus.$off("_refreshSubTableHandle_" + tableUuid);
|
|
138
|
+
bus.$off("_refreshChildData_" + tableUuid);
|
|
139
|
+
bus.$off(listCode + "-pickFileDone");
|
|
140
|
+
bus.$off(listCode + "-scanDone");
|
|
141
|
+
});
|
|
142
|
+
function currencyListViewSetting(canRrefreshSubtableData) {
|
|
143
|
+
if (canRrefreshSubtableData === void 0) {
|
|
144
|
+
canRrefreshSubtableData = judgeInitializationSubTable();
|
|
145
|
+
}
|
|
146
|
+
listViewOptions.value["isPageInfo"] = false;
|
|
147
|
+
listViewOptions.value["isFormSubTable"] = true;
|
|
148
|
+
listViewOptions.value["canRrefreshSubtableData"] = canRrefreshSubtableData;
|
|
149
|
+
listViewOptions.value["getFormData"] = getParentFormData;
|
|
150
|
+
listViewOptions.value["getGridData"] = getGridData;
|
|
151
|
+
listViewOptions.value.extraParam["subTableListViewCode"] = listCode;
|
|
152
|
+
listViewOptions.value.extraParam["beanName"] = pageContext.beanName;
|
|
153
|
+
listViewOptions.value.extraParam["subtableSetting"] = configure.props && configure.props.otherSettings ? JSON.stringify(configure.props.otherSettings) : null;
|
|
154
|
+
listViewOptions.value.extraParam["additionalParamMap"] = additionalParamMap;
|
|
155
|
+
listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
|
|
156
|
+
listViewOptions.value.extraParam["contextMap"] = pageContext.entity.context;
|
|
157
|
+
listViewOptions.value.extraParam["taskMap"] = pageContext.entity.task;
|
|
158
|
+
if (!(configure.props && configure.props.base && configure.props.base.showOperation)) {
|
|
159
|
+
let hiddenColumns = listViewOptions.value.hiddenColumns;
|
|
160
|
+
if (!hiddenColumns) {
|
|
161
|
+
hiddenColumns = ["operation"];
|
|
162
|
+
} else {
|
|
163
|
+
hiddenColumns.push("operation");
|
|
77
164
|
}
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
165
|
+
listViewOptions.value["hiddenColumns"] = hiddenColumns;
|
|
166
|
+
}
|
|
167
|
+
listViewOptions.value["showOperationButton"] = configure.props && configure.props.base ? configure.props.base.showOperation : false;
|
|
168
|
+
listViewOptions.value["isPdfEditor"] = false;
|
|
169
|
+
listViewOptions.value["tableRecordMaxNum"] = configure.props && configure.props.otherSettings ? configure.props.otherSettings.tableRecordMaxNum : null;
|
|
170
|
+
let sizeConfig = getSizeConfig(pageContext, configure);
|
|
171
|
+
if (sizeConfig && sizeConfig.fixHeight) {
|
|
172
|
+
listViewOptions.value["formSetHeight"] = sizeConfig.fixHeight;
|
|
173
|
+
}
|
|
174
|
+
if (sizeConfig && sizeConfig.maxHeight) {
|
|
175
|
+
listViewOptions.value["formSetMaxHeight"] = sizeConfig.maxHeight;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function judgeInitializationSubTable() {
|
|
179
|
+
if (!configure.props || !configure.props.otherSettings) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (configure.props.otherSettings.sourceQueryTableData && configure.props.otherSettings.timeToInitializeSubTable && configure.props.otherSettings.timeToInitializeSubTable.length > 0) {
|
|
183
|
+
let flag = false;
|
|
184
|
+
if (configure.props.otherSettings.timeToInitializeSubTable.indexOf("create") !== -1) {
|
|
185
|
+
if (dataModel.id || dataModel.ID) {
|
|
186
|
+
flag = false;
|
|
187
|
+
} else {
|
|
188
|
+
flag = true;
|
|
189
|
+
}
|
|
90
190
|
}
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
191
|
+
if (configure.props.otherSettings.timeToInitializeSubTable.indexOf("noData") !== -1) {
|
|
192
|
+
const tableData = dataModel[prop];
|
|
193
|
+
if (!tableData || tableData.length <= 0) {
|
|
194
|
+
flag = true;
|
|
195
|
+
}
|
|
94
196
|
}
|
|
95
|
-
return
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const e3 = N.customEvents;
|
|
100
|
-
e3 && (oe.value.eventCallBack = e3), ee.value = true, ge();
|
|
101
|
-
}
|
|
102
|
-
function ge() {
|
|
103
|
-
N.tableUuids || (N.tableUuids = []), N.tableUuids.indexOf(A.uuid) < 0 && N.tableUuids.push(A.uuid);
|
|
104
|
-
}
|
|
105
|
-
n(() => {
|
|
106
|
-
const e3 = A.uuid, t2 = N.subTableWatchProps;
|
|
107
|
-
y.$on("_refreshSubTable_" + e3, (n2) => {
|
|
108
|
-
console.log("-_refreshSubTable--tableUuid=", e3, "params=", n2);
|
|
109
|
-
const o2 = n2.propName;
|
|
110
|
-
if (t2 && t2[e3] && t2[e3].length > 0) {
|
|
111
|
-
t2[e3].indexOf(o2) >= 0 && le();
|
|
112
|
-
}
|
|
113
|
-
}), y.$on("_refreshSubTableHandle_" + e3, (t3) => {
|
|
114
|
-
console.log("-_refreshSubTableHandle_--tableUuid=", e3, "params=", t3), le();
|
|
115
|
-
}), y.$on("_refreshChildData_" + e3, (t3) => {
|
|
116
|
-
console.log("-_refreshChildData_--tableUuid=", e3), function(e4) {
|
|
117
|
-
Le(e4), de = setTimeout(() => {
|
|
118
|
-
ie.value && (ie.value.refreshChildData(z, e4, A.props && A.props.base && true === A.props.base.subPaging), oe.value.extraParam.entityMap = N.entity.data);
|
|
119
|
-
}, 10);
|
|
120
|
-
}(t3);
|
|
121
|
-
}), y.$on(z + "-pickFileDone", (e4) => {
|
|
122
|
-
console.log("superPage5555---listCode---pickFileDone--listCode=", z, "data=", e4), ie.value.pickFileDone(e4);
|
|
123
|
-
}), y.$on(z + "-scanDone", (e4) => {
|
|
124
|
-
console.log("superPage5555---listCode---scanDone--listCode=", z, "data=", e4), ie.value.scanDone(e4);
|
|
125
|
-
}), oe.value && oe.value.configureObj.props.base && oe.value.configureObj.props.base.isSafeDelete && ae("setSafeDeleteTableCode", oe.value.extraParam.tableName);
|
|
126
|
-
}), o(() => {
|
|
127
|
-
pe && clearTimeout(pe), de && clearTimeout(de);
|
|
128
|
-
const e3 = A.uuid;
|
|
129
|
-
y.$off("_refreshSubTable_" + e3), y.$off("_refreshSubTableHandle_" + e3), y.$off("_refreshChildData_" + e3), y.$off(z + "-pickFileDone"), y.$off(z + "-scanDone");
|
|
130
|
-
});
|
|
131
|
-
const ve = t({});
|
|
132
|
-
function me(e3) {
|
|
133
|
-
if (!e3) return;
|
|
134
|
-
return ve.value[e3.uuid] = e3, he;
|
|
135
|
-
}
|
|
136
|
-
function he(e3, t2, n2, o2, a2, i2) {
|
|
137
|
-
const l2 = { originalValue: e3, formatValue: t2, row: n2, column: o2, rowIndex: a2, button: i2, id: n2.ID ? n2.ID : n2.id }, u2 = ve.value[i2.sourceButton.uuid], s2 = A;
|
|
138
|
-
u2.props.base.tableUuid = s2.uuid, S(null, N, u2, "click", l2);
|
|
139
|
-
}
|
|
140
|
-
function Se(e3, t2, n2, o2, a2, i2) {
|
|
141
|
-
if (!w(H.pageContext, A.props.base.showOperationCondition)) return false;
|
|
142
|
-
const l2 = N.fieldPermissionMap, u2 = N.actionPermissionMap;
|
|
143
|
-
let s2 = true;
|
|
144
|
-
if (l2 && null !== l2) {
|
|
145
|
-
const e4 = l2.get("all_fields");
|
|
146
|
-
void 0 === e4 || false !== e4.canEdit || void 0 !== e4.rowIndexes && null !== e4.rowIndexes && 0 !== e4.rowIndexes.length || (s2 = false);
|
|
147
|
-
}
|
|
148
|
-
if (true === s2 && E && u2 && null !== u2) {
|
|
149
|
-
let e4 = u2.get(E);
|
|
150
|
-
e4 || (e4 = u2.get("all_sub_tables")), e4 && void 0 !== e4.canAdd && false === e4.canAdd && (s2 = false);
|
|
151
|
-
}
|
|
152
|
-
return s2;
|
|
153
|
-
}
|
|
154
|
-
function we(e3, t2, n2, o2, a2, i2) {
|
|
155
|
-
let l2 = Se();
|
|
156
|
-
return true === l2 && (l2 = w(H.pageContext, A.props.base.showAddBtnCondition, n2)), l2;
|
|
157
|
-
}
|
|
158
|
-
function Te(e3, t2, n2, o2, a2, i2) {
|
|
159
|
-
const l2 = N.fieldPermissionMap, u2 = N.actionPermissionMap;
|
|
160
|
-
let s2 = true;
|
|
161
|
-
if (l2 && null !== l2) {
|
|
162
|
-
const e4 = l2.get("all_fields");
|
|
163
|
-
void 0 === e4 || false !== e4.canEdit || void 0 !== e4.rowIndexes && null !== e4.rowIndexes && 0 !== e4.rowIndexes.length || (s2 = false);
|
|
164
|
-
}
|
|
165
|
-
if (true === s2 && E && u2 && null !== u2) {
|
|
166
|
-
let e4 = u2.get(E);
|
|
167
|
-
if (e4 || (e4 = u2.get("all_sub_tables")), e4 && void 0 !== e4.canDelete && false === e4.canDelete && (s2 = false), e4 && void 0 !== e4.canDelete && true === e4.canDelete && e4.deleteRowIndexes) if (e4.deleteRowIndexes.length > 0) if (i2) s2 = true;
|
|
168
|
-
else {
|
|
169
|
-
const t3 = function(e5) {
|
|
170
|
-
return e5 && e5.id ? e5.id : e5 && e5.ID ? e5.ID : void 0;
|
|
171
|
-
}(n2);
|
|
172
|
-
s2 = void 0 !== t3 && e4.deleteRowIndexes.indexOf(t3) >= 0;
|
|
173
|
-
}
|
|
174
|
-
else s2 = false;
|
|
175
|
-
}
|
|
176
|
-
return s2;
|
|
177
|
-
}
|
|
178
|
-
function De(e3, t2, n2, o2, a2, i2) {
|
|
179
|
-
let l2 = Te(0, 0, n2, 0, 0, i2);
|
|
180
|
-
return true === l2 && (l2 = w(H.pageContext, A.props.base.showDeleteBtnCondition, n2)), l2;
|
|
181
|
-
}
|
|
182
|
-
function xe(e3, t2, n2, o2, a2) {
|
|
183
|
-
ie.value.createRow(z, {}, { getDefaultValueFunc: P });
|
|
184
|
-
}
|
|
185
|
-
function Ce(e3, t2, n2, o2, a2) {
|
|
186
|
-
ie.value.deleteRow(a2, z, false);
|
|
187
|
-
}
|
|
188
|
-
function Pe(e3) {
|
|
189
|
-
T(X, Y, e3);
|
|
190
|
-
}
|
|
191
|
-
function ye(e3) {
|
|
192
|
-
console.log("表单组件--Item--changeRowsPerpage==pageSize=", e3), N.subTablePageInfo || (N.subTablePageInfo = {}), N.subTablePageInfo[E] = { pageSize: e3 };
|
|
193
|
-
}
|
|
194
|
-
function _e(e3) {
|
|
195
|
-
const t2 = e3.key, n2 = e3.value;
|
|
196
|
-
N.selectOptions || (N.selectOptions = {}), N.selectOptions[t2] = n2;
|
|
197
|
-
}
|
|
198
|
-
function Ie(e3) {
|
|
199
|
-
const t2 = N.code + "_";
|
|
200
|
-
y.$emit(t2 + "prohibit-edit", e3);
|
|
201
|
-
}
|
|
202
|
-
function Re(e3) {
|
|
203
|
-
const t2 = N.entity.data;
|
|
204
|
-
if (e3) for (const n2 in e3) t2[n2] = e3[n2];
|
|
205
|
-
}
|
|
206
|
-
function Oe(e3, t2) {
|
|
207
|
-
if (void 0 !== t2) {
|
|
208
|
-
J.value = e3;
|
|
209
|
-
p(N, A, { selection: e3, row: t2 });
|
|
197
|
+
return flag;
|
|
198
|
+
} else {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
210
201
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
202
|
+
function getParentFormData() {
|
|
203
|
+
return pageContext.entity.data;
|
|
204
|
+
}
|
|
205
|
+
function getGridData() {
|
|
206
|
+
return getVariableValue(entity, dynamicFields);
|
|
207
|
+
}
|
|
208
|
+
function initializationSubTable() {
|
|
209
|
+
const canRrefreshSubtableData = judgeInitializationSubTable();
|
|
210
|
+
if (canRrefreshSubtableData) {
|
|
211
|
+
changeInitializationSubTable(canRrefreshSubtableData);
|
|
212
|
+
} else {
|
|
213
|
+
currencyListViewSetting(canRrefreshSubtableData);
|
|
214
|
+
listViewOptions.value["isPageInfo"] = false;
|
|
215
|
+
listViewOptions.value["subTableData"] = getValue();
|
|
216
|
+
setGridDataEventOptions();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
let timer;
|
|
220
|
+
let timer2;
|
|
221
|
+
function changeInitializationSubTable(canRrefreshSubtableData) {
|
|
222
|
+
currencyListViewSetting(canRrefreshSubtableData);
|
|
223
|
+
listViewOptions.value["subTableData"] = null;
|
|
224
|
+
setGridDataEventOptions();
|
|
225
|
+
listViewShowFlag.value = false;
|
|
226
|
+
timer = setTimeout(() => {
|
|
227
|
+
listViewShowFlag.value = true;
|
|
228
|
+
componentKey.value = componentKey.value + 1;
|
|
229
|
+
setGridToStore();
|
|
230
|
+
}, 10);
|
|
231
|
+
}
|
|
232
|
+
function setGridDataEventOptions() {
|
|
233
|
+
setSubTableValidateInfo();
|
|
234
|
+
setTableEvents(listViewOptions.value, tableEvents, pageContext, configure);
|
|
235
|
+
const customEvents = pageContext.customEvents;
|
|
236
|
+
if (customEvents) {
|
|
237
|
+
listViewOptions.value["eventCallBack"] = customEvents;
|
|
238
|
+
}
|
|
239
|
+
listViewShowFlag.value = true;
|
|
240
|
+
setGridToStore();
|
|
241
|
+
}
|
|
242
|
+
function setSubTableValidateInfo() {
|
|
243
|
+
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
244
|
+
const actionPermissionMap = pageContext.actionPermissionMap;
|
|
245
|
+
if (fieldPermissionMap && fieldPermissionMap != null) {
|
|
246
|
+
let validateRules = fieldPermissionMap.get(prop);
|
|
247
|
+
if (!validateRules) {
|
|
248
|
+
const allValidateRules = fieldPermissionMap.get("all_fields");
|
|
249
|
+
if (allValidateRules) {
|
|
250
|
+
validateRules = [allValidateRules];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (validateRules) {
|
|
254
|
+
listViewOptions.value["validateRules"] = validateRules;
|
|
255
|
+
} else {
|
|
256
|
+
listViewOptions.value["validateRules"] = null;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (actionPermissionMap && actionPermissionMap != null) {
|
|
260
|
+
let actionPermission = actionPermissionMap.get(prop);
|
|
261
|
+
if (!actionPermission) {
|
|
262
|
+
actionPermission = actionPermissionMap.get("all_sub_tables");
|
|
263
|
+
}
|
|
264
|
+
listViewOptions.value["actionPermission"] = actionPermission;
|
|
265
|
+
}
|
|
266
|
+
if (!listViewOptions.value["operations"]) {
|
|
267
|
+
listViewOptions.value["operations"] = {};
|
|
268
|
+
}
|
|
269
|
+
const subTableOperations = getOperations();
|
|
270
|
+
listViewOptions.value["operations"]["operation"] = subTableOperations;
|
|
271
|
+
listViewOptions.value["subTableCanAdd"] = isShowAddWf();
|
|
272
|
+
}
|
|
273
|
+
function setGridToStore() {
|
|
274
|
+
if (!pageContext.tableUuids) {
|
|
275
|
+
pageContext.tableUuids = [];
|
|
276
|
+
}
|
|
277
|
+
if (pageContext.tableUuids.indexOf(configure.uuid) < 0) {
|
|
278
|
+
pageContext.tableUuids.push(configure.uuid);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function getOperations() {
|
|
282
|
+
let operations = [];
|
|
283
|
+
let isShowOperation = caculateShowCondition(props.pageContext, configure.props.base.showOperationCondition);
|
|
284
|
+
if (isShowOperation && isShowAddWf()) {
|
|
285
|
+
const addButton = {
|
|
286
|
+
props: {
|
|
287
|
+
elementType: "el-button",
|
|
288
|
+
icon: "Plus",
|
|
289
|
+
type: "primary",
|
|
290
|
+
circle: true,
|
|
291
|
+
size: "mini",
|
|
292
|
+
permission: "true"
|
|
293
|
+
},
|
|
294
|
+
onClick: addSubTableData,
|
|
295
|
+
isShow: isShowAdd
|
|
296
|
+
};
|
|
297
|
+
operations.push(addButton);
|
|
298
|
+
}
|
|
299
|
+
if (isShowOperation && isShowDeleteWf(null, null, null, null, null, true)) {
|
|
300
|
+
const removeButton = {
|
|
301
|
+
props: {
|
|
302
|
+
elementType: "el-button",
|
|
303
|
+
icon: "Minus",
|
|
304
|
+
type: "danger",
|
|
305
|
+
circle: true,
|
|
306
|
+
size: "mini",
|
|
307
|
+
permission: "true"
|
|
308
|
+
},
|
|
309
|
+
onClick: removeSubTableData,
|
|
310
|
+
isShow: isShowDelete
|
|
311
|
+
};
|
|
312
|
+
operations.push(removeButton);
|
|
313
|
+
}
|
|
314
|
+
getOperationButtons(pageContext, configure, operations, getOperationButtonClickEvent);
|
|
315
|
+
return operations;
|
|
316
|
+
}
|
|
317
|
+
const operationButtonObj = ref({});
|
|
318
|
+
function getOperationButtonClickEvent(buttonConfigure) {
|
|
319
|
+
if (!buttonConfigure) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
operationButtonObj.value[buttonConfigure.uuid] = buttonConfigure;
|
|
323
|
+
let onClick = customButtonClick;
|
|
324
|
+
return onClick;
|
|
325
|
+
}
|
|
326
|
+
function customButtonClick(originalValue, formatValue, row, column, rowIndex, button) {
|
|
327
|
+
const otherParams = {
|
|
328
|
+
originalValue,
|
|
329
|
+
formatValue,
|
|
330
|
+
row,
|
|
331
|
+
column,
|
|
332
|
+
rowIndex,
|
|
333
|
+
button,
|
|
334
|
+
id: row.ID ? row.ID : row.id
|
|
335
|
+
};
|
|
336
|
+
const buttonConfigure = operationButtonObj.value[button.sourceButton.uuid];
|
|
337
|
+
const tableConfigure = configure;
|
|
338
|
+
buttonConfigure.props.base.tableUuid = tableConfigure.uuid;
|
|
339
|
+
getHandleEvent(null, pageContext, buttonConfigure, "click", otherParams);
|
|
340
|
+
}
|
|
341
|
+
initializationSubTable();
|
|
342
|
+
function getEntityId(row) {
|
|
343
|
+
if (row && row.id) {
|
|
344
|
+
return row.id;
|
|
345
|
+
} else if (row && row.ID) {
|
|
346
|
+
return row.ID;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function isShowAddWf(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
350
|
+
const isShowOperation = caculateShowCondition(props.pageContext, configure.props.base.showOperationCondition);
|
|
351
|
+
if (!isShowOperation) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
355
|
+
const actionPermissionMap = pageContext.actionPermissionMap;
|
|
356
|
+
let canAdd = true;
|
|
357
|
+
if (fieldPermissionMap && fieldPermissionMap !== null) {
|
|
358
|
+
const allFieldPermission = fieldPermissionMap.get("all_fields");
|
|
359
|
+
if (typeof allFieldPermission !== "undefined" && allFieldPermission.canEdit === false && (allFieldPermission.rowIndexes === void 0 || allFieldPermission.rowIndexes === null || allFieldPermission.rowIndexes.length === 0)) {
|
|
360
|
+
canAdd = false;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (canAdd === true && prop && actionPermissionMap && actionPermissionMap !== null) {
|
|
364
|
+
let oneTableActionPermission = actionPermissionMap.get(prop);
|
|
365
|
+
if (!oneTableActionPermission) {
|
|
366
|
+
oneTableActionPermission = actionPermissionMap.get("all_sub_tables");
|
|
367
|
+
}
|
|
368
|
+
if (oneTableActionPermission && oneTableActionPermission.canAdd !== void 0 && oneTableActionPermission.canAdd === false) {
|
|
369
|
+
canAdd = false;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return canAdd;
|
|
373
|
+
}
|
|
374
|
+
function isShowAdd(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
375
|
+
let canAdd = isShowAddWf();
|
|
376
|
+
if (canAdd === true) {
|
|
377
|
+
canAdd = caculateShowCondition(props.pageContext, configure.props.base.showAddBtnCondition, row);
|
|
378
|
+
}
|
|
379
|
+
return canAdd;
|
|
380
|
+
}
|
|
381
|
+
function isShowDeleteWf(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
382
|
+
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
383
|
+
const actionPermissionMap = pageContext.actionPermissionMap;
|
|
384
|
+
let canDelete = true;
|
|
385
|
+
if (fieldPermissionMap && fieldPermissionMap !== null) {
|
|
386
|
+
const allFieldPermission = fieldPermissionMap.get("all_fields");
|
|
387
|
+
if (typeof allFieldPermission !== "undefined" && allFieldPermission.canEdit === false && (allFieldPermission.rowIndexes === void 0 || allFieldPermission.rowIndexes === null || allFieldPermission.rowIndexes.length === 0)) {
|
|
388
|
+
canDelete = false;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (canDelete === true && prop && actionPermissionMap && actionPermissionMap !== null) {
|
|
392
|
+
let oneTableActionPermission = actionPermissionMap.get(prop);
|
|
393
|
+
if (!oneTableActionPermission) {
|
|
394
|
+
oneTableActionPermission = actionPermissionMap.get("all_sub_tables");
|
|
395
|
+
}
|
|
396
|
+
if (oneTableActionPermission && oneTableActionPermission.canDelete !== void 0 && oneTableActionPermission.canDelete === false) {
|
|
397
|
+
canDelete = false;
|
|
398
|
+
}
|
|
399
|
+
if (oneTableActionPermission && oneTableActionPermission.canDelete !== void 0 && oneTableActionPermission.canDelete === true) {
|
|
400
|
+
if (oneTableActionPermission.deleteRowIndexes) {
|
|
401
|
+
if (oneTableActionPermission.deleteRowIndexes.length > 0) {
|
|
402
|
+
if (isFormJudge) {
|
|
403
|
+
canDelete = true;
|
|
404
|
+
} else {
|
|
405
|
+
const rowId = getEntityId(row);
|
|
406
|
+
if (rowId !== void 0 && oneTableActionPermission.deleteRowIndexes.indexOf(rowId) >= 0) {
|
|
407
|
+
canDelete = true;
|
|
408
|
+
} else {
|
|
409
|
+
canDelete = false;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
} else {
|
|
413
|
+
canDelete = false;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return canDelete;
|
|
419
|
+
}
|
|
420
|
+
function isShowDelete(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
421
|
+
let canDelete = isShowDeleteWf(originalValue, formatValue, row, column, rowIndex, isFormJudge);
|
|
422
|
+
if (canDelete === true) {
|
|
423
|
+
canDelete = caculateShowCondition(props.pageContext, configure.props.base.showDeleteBtnCondition, row);
|
|
424
|
+
}
|
|
425
|
+
return canDelete;
|
|
426
|
+
}
|
|
427
|
+
function addSubTableData(originalValue, formatValue, row, column, rowIndex) {
|
|
428
|
+
gridRef.value.createRow(listCode, {}, { getDefaultValueFunc: getDefaultValue });
|
|
429
|
+
}
|
|
430
|
+
function removeSubTableData(originalValue, formatValue, row, column, rowIndex) {
|
|
431
|
+
gridRef.value.deleteRow(rowIndex, listCode, false);
|
|
432
|
+
}
|
|
433
|
+
function changeGridData(gridData) {
|
|
434
|
+
setVariableValue(entity, dynamicFields, gridData);
|
|
435
|
+
}
|
|
436
|
+
function changeRowsPerpage(pageSize) {
|
|
437
|
+
console.log("表单组件--Item--changeRowsPerpage==pageSize=", pageSize);
|
|
438
|
+
if (!pageContext.subTablePageInfo) {
|
|
439
|
+
pageContext.subTablePageInfo = {};
|
|
440
|
+
}
|
|
441
|
+
pageContext.subTablePageInfo[prop] = { pageSize };
|
|
442
|
+
}
|
|
443
|
+
function setSelectOptions(valueSetOptions) {
|
|
444
|
+
const propName = valueSetOptions.key;
|
|
445
|
+
const options = valueSetOptions.value;
|
|
446
|
+
if (!pageContext.selectOptions) {
|
|
447
|
+
pageContext.selectOptions = {};
|
|
448
|
+
}
|
|
449
|
+
pageContext.selectOptions[propName] = options;
|
|
450
|
+
}
|
|
451
|
+
function fnProhibitToEdit(data) {
|
|
452
|
+
const myPageCode = pageContext.code;
|
|
453
|
+
const eventPageInfo = myPageCode + "_";
|
|
454
|
+
bus.$emit(eventPageInfo + "prohibit-edit", data);
|
|
455
|
+
}
|
|
456
|
+
function refresMainTableFields(entity2) {
|
|
457
|
+
const dataModel2 = pageContext.entity.data;
|
|
458
|
+
if (entity2) {
|
|
459
|
+
for (const key in entity2) {
|
|
460
|
+
dataModel2[key] = entity2[key];
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
function select(selection, row) {
|
|
465
|
+
if (row !== void 0) {
|
|
466
|
+
selections.value = selection;
|
|
467
|
+
const params = {
|
|
468
|
+
selection,
|
|
469
|
+
row
|
|
470
|
+
};
|
|
471
|
+
gridSelectRecord(pageContext, configure, params);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
function selectAll(selection) {
|
|
475
|
+
selections.value = selection;
|
|
476
|
+
const params = {
|
|
477
|
+
selection
|
|
478
|
+
};
|
|
479
|
+
gridSelectAllRecords(pageContext, configure, params);
|
|
480
|
+
}
|
|
481
|
+
function selectionChange(newSelection) {
|
|
482
|
+
const params = {
|
|
483
|
+
newSelection
|
|
484
|
+
};
|
|
485
|
+
gridSelectionChange(pageContext, configure, params);
|
|
486
|
+
}
|
|
487
|
+
function cellClickEvent(row, column, cell, event) {
|
|
488
|
+
const params = {
|
|
489
|
+
row,
|
|
490
|
+
column,
|
|
491
|
+
cell,
|
|
492
|
+
event
|
|
493
|
+
};
|
|
494
|
+
cellClick(pageContext, configure, params);
|
|
495
|
+
}
|
|
496
|
+
function cellDblClickEvent(row, column, cell, event) {
|
|
497
|
+
const params = {
|
|
498
|
+
row,
|
|
499
|
+
column,
|
|
500
|
+
cell,
|
|
501
|
+
event
|
|
502
|
+
};
|
|
503
|
+
cellDblClick(pageContext, configure, params);
|
|
504
|
+
}
|
|
505
|
+
function rowClickEvent(row, column, event) {
|
|
506
|
+
const params = {
|
|
507
|
+
row,
|
|
508
|
+
column,
|
|
509
|
+
event
|
|
510
|
+
};
|
|
511
|
+
rowClick(pageContext, configure, params);
|
|
512
|
+
}
|
|
513
|
+
function rowDblClickEvent(row, column, event) {
|
|
514
|
+
const params = {
|
|
515
|
+
row,
|
|
516
|
+
column,
|
|
517
|
+
event
|
|
518
|
+
};
|
|
519
|
+
rowDblClick(pageContext, configure, params);
|
|
520
|
+
}
|
|
521
|
+
function headerClickEvent(column, event) {
|
|
522
|
+
const params = {
|
|
523
|
+
column,
|
|
524
|
+
event
|
|
525
|
+
};
|
|
526
|
+
headerClick(pageContext, configure, params);
|
|
527
|
+
}
|
|
528
|
+
function changeFormData(formData) {
|
|
529
|
+
pageContext.entity.data = formData;
|
|
530
|
+
}
|
|
531
|
+
function validatorSunTableListData() {
|
|
532
|
+
return gridRef.value.validatorSunTableListData();
|
|
533
|
+
}
|
|
534
|
+
function createRow() {
|
|
535
|
+
return gridRef.value.createRow(listCode);
|
|
536
|
+
}
|
|
537
|
+
function getSelections() {
|
|
538
|
+
return selections.value;
|
|
539
|
+
}
|
|
540
|
+
function getSelectionIds() {
|
|
541
|
+
const dataIds = [];
|
|
542
|
+
if (selections.value) {
|
|
543
|
+
selections.value.forEach((item) => {
|
|
544
|
+
dataIds.push(item.id ? item.id : item.ID ? item.ID : null);
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
return dataIds;
|
|
548
|
+
}
|
|
549
|
+
function clearSelections() {
|
|
550
|
+
selections.value = [];
|
|
551
|
+
}
|
|
552
|
+
function getTableConfigure() {
|
|
553
|
+
return configure;
|
|
554
|
+
}
|
|
555
|
+
function getValue() {
|
|
556
|
+
return getVariableValue(entity, dynamicFields);
|
|
557
|
+
}
|
|
558
|
+
function setValue(value) {
|
|
559
|
+
return setVariableValue(entity, dynamicFields, value);
|
|
560
|
+
}
|
|
561
|
+
function refreshChildTableData(gridData) {
|
|
562
|
+
setValue(gridData);
|
|
563
|
+
timer2 = setTimeout(() => {
|
|
564
|
+
if (gridRef.value) {
|
|
565
|
+
gridRef.value.refreshChildData(listCode, gridData, configure.props && configure.props.base && configure.props.base.subPaging === true);
|
|
566
|
+
listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
|
|
567
|
+
}
|
|
568
|
+
}, 10);
|
|
569
|
+
}
|
|
570
|
+
function getRowStyle(data) {
|
|
571
|
+
const style = getRowStyleUtil(data, null, props);
|
|
572
|
+
return style;
|
|
573
|
+
}
|
|
574
|
+
function getCellStyle(data) {
|
|
575
|
+
return getCellStyleUtil(data, data.cellStyle, props);
|
|
576
|
+
}
|
|
577
|
+
function getTitleStyle(data) {
|
|
578
|
+
const cellTitleStyle = data.titleStyle;
|
|
579
|
+
const rowTitleStyle = props.configure.style.titleStyle;
|
|
580
|
+
return getHeaderCellStyleUtil(data, { cellTitleStyle, titleStyle: rowTitleStyle }, props);
|
|
581
|
+
}
|
|
582
|
+
function getTableSelectOptions() {
|
|
583
|
+
if (gridRef.value) {
|
|
584
|
+
return gridRef.value.getTableSelectOptions(listCode);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function dynamicControlTableEdit(pageContext2, customRules, listCode2) {
|
|
588
|
+
if (gridRef.value) {
|
|
589
|
+
gridRef.value.dynamicControlTableEdit(pageContext2, customRules, listCode2);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function doLayout(hiddenColumns) {
|
|
593
|
+
if (gridRef.value) {
|
|
594
|
+
gridRef.value.doLayout(hiddenColumns);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
__expose({
|
|
598
|
+
createRow,
|
|
599
|
+
getSelections,
|
|
600
|
+
getSelectionIds,
|
|
601
|
+
clearSelections,
|
|
602
|
+
getTableConfigure,
|
|
603
|
+
validatorSunTableListData,
|
|
604
|
+
getValue,
|
|
605
|
+
setValue,
|
|
606
|
+
getTableSelectOptions,
|
|
607
|
+
dynamicControlTableEdit,
|
|
608
|
+
doLayout
|
|
609
|
+
});
|
|
610
|
+
return (_ctx, _cache) => {
|
|
611
|
+
const _component_super_grid = resolveComponent("super-grid");
|
|
612
|
+
return openBlock(), createElementBlock("div", null, [
|
|
613
|
+
listViewShowFlag.value ? (openBlock(), createBlock(_component_super_grid, {
|
|
614
|
+
key: 0,
|
|
615
|
+
ref_key: "gridRef",
|
|
616
|
+
ref: gridRef,
|
|
617
|
+
url: unref(baseURL) + "/dsc/commons/sub-table",
|
|
618
|
+
options: listViewOptions.value,
|
|
619
|
+
code: unref(listCode),
|
|
620
|
+
settings: unref(superGridSetting),
|
|
621
|
+
onSelect: select,
|
|
622
|
+
onSelectAll: selectAll,
|
|
623
|
+
onSelectionChange: selectionChange,
|
|
624
|
+
onCellClick: cellClickEvent,
|
|
625
|
+
onCellDblclick: cellDblClickEvent,
|
|
626
|
+
onRowClick: rowClickEvent,
|
|
627
|
+
onRowDblclick: rowDblClickEvent,
|
|
628
|
+
onHeaderClick: headerClickEvent,
|
|
629
|
+
onFnProhibitToEdit: fnProhibitToEdit,
|
|
630
|
+
onChangeGridData: changeGridData,
|
|
631
|
+
onReloadGrid: changeInitializationSubTable,
|
|
632
|
+
onRefresMainTableFields: refresMainTableFields,
|
|
633
|
+
onSetSelectOptions: setSelectOptions,
|
|
634
|
+
onChangeRowsPerPage: changeRowsPerpage,
|
|
635
|
+
onNewOpenGridDialog: unref(popupToPage),
|
|
636
|
+
onChangeFormData: changeFormData
|
|
637
|
+
}, null, 8, ["url", "options", "code", "settings", "onNewOpenGridDialog"])) : createCommentVNode("", true)
|
|
638
|
+
]);
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
});
|
|
272
642
|
export {
|
|
273
|
-
|
|
643
|
+
_sfc_main as default
|
|
274
644
|
};
|