super-page-runtime 2.0.28 → 2.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/runtime/utils/api/api-util.js +8 -6
- package/dist/es/components/runtime/utils/events/event-util.d.ts +1 -0
- package/dist/es/components/runtime/utils/events/event-util.js +5 -1
- package/dist/es/components/runtime/utils/events/standard-event.d.ts +1 -0
- package/dist/es/components/runtime/utils/events/standard-event.js +83 -43
- package/dist/es/components/runtime/utils/form/date-shortcuts.d.ts +7 -0
- package/dist/es/components/runtime/utils/form/date-shortcuts.js +96 -0
- package/dist/es/components/runtime/utils/page-helper-util.d.ts +6 -0
- package/dist/es/components/runtime/utils/page-helper-util.js +22 -2
- package/dist/es/components/runtime/utils/page-init-util.d.ts +2 -1
- package/dist/es/components/runtime/utils/page-init-util.js +34 -17
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +0 -1
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +2 -5
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +0 -1
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +37 -7
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +1 -1
- package/dist/es/components/runtime/views/super-page.vue.js +42 -10
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +2 -0
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ function getCommonFormData(pageContext) {
|
|
|
33
33
|
const pageCode = pageContext.code;
|
|
34
34
|
const pageVersion = pageContext.version;
|
|
35
35
|
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
36
|
-
const dataId = additionalParamMap ? additionalParamMap.id :
|
|
36
|
+
const dataId = additionalParamMap && additionalParamMap.id ? additionalParamMap.id : 1;
|
|
37
37
|
const ids = additionalParamMap ? additionalParamMap.ids : null;
|
|
38
38
|
const taskId = additionalParamMap ? additionalParamMap.taskId : null;
|
|
39
39
|
const permissionPrefix = pageCode;
|
|
@@ -67,7 +67,7 @@ function getCommonFormData(pageContext) {
|
|
|
67
67
|
param["taskId"] = taskId;
|
|
68
68
|
}
|
|
69
69
|
if (pageContext.tableUuids) {
|
|
70
|
-
|
|
70
|
+
const listCodes = [];
|
|
71
71
|
pageContext.tableUuids.forEach((tableUuid) => {
|
|
72
72
|
const listCode = getListCode(pageCode, pageVersion, tableUuid);
|
|
73
73
|
listCodes.push(listCode);
|
|
@@ -109,7 +109,7 @@ function getWorkflowFormData(pageContext) {
|
|
|
109
109
|
const pageCode = pageContext.code;
|
|
110
110
|
const pageVersion = pageContext.version;
|
|
111
111
|
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
112
|
-
const dataId = additionalParamMap ? additionalParamMap.id : null;
|
|
112
|
+
const dataId = additionalParamMap && additionalParamMap.id ? additionalParamMap.id : null;
|
|
113
113
|
const ids = additionalParamMap ? additionalParamMap.ids : null;
|
|
114
114
|
const taskId = additionalParamMap ? additionalParamMap.taskId : null;
|
|
115
115
|
const permissionPrefix = pageCode;
|
|
@@ -180,9 +180,8 @@ function changePermissionListToMap(pageContext) {
|
|
|
180
180
|
}
|
|
181
181
|
function changeFieldPermissionToMap(pageContext) {
|
|
182
182
|
let fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
183
|
-
pageContext.actionPermissionMap;
|
|
184
183
|
const fieldPermissions = pageContext.fieldPermissions;
|
|
185
|
-
if (fieldPermissionMap === null) {
|
|
184
|
+
if (fieldPermissionMap === null || fieldPermissionMap === void 0) {
|
|
186
185
|
fieldPermissionMap = /* @__PURE__ */ new Map();
|
|
187
186
|
}
|
|
188
187
|
if (typeof fieldPermissions !== "undefined") {
|
|
@@ -241,8 +240,11 @@ function changeFieldPermissionToMap(pageContext) {
|
|
|
241
240
|
}
|
|
242
241
|
function changeActionPermissionToMap(pageContext) {
|
|
243
242
|
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
244
|
-
|
|
243
|
+
let actionPermissionMap = pageContext.actionPermissionMap;
|
|
245
244
|
const actionPermissions = pageContext.actionPermissions;
|
|
245
|
+
if (actionPermissionMap === null || actionPermissionMap === void 0) {
|
|
246
|
+
actionPermissionMap = /* @__PURE__ */ new Map();
|
|
247
|
+
}
|
|
246
248
|
if (typeof actionPermissions !== "undefined" && actionPermissions !== null) {
|
|
247
249
|
const subModelNames = Object.keys(actionPermissions);
|
|
248
250
|
subModelNames.forEach((subModelName) => {
|
|
@@ -19,6 +19,7 @@ export declare function getCustomFunc(pageContext: PageContext, funcName: any):
|
|
|
19
19
|
export declare function removeCustomFuncFromWindow(pageDesign: PageDesign): void;
|
|
20
20
|
export declare function handleEvent($event: any, pageContext: PageContext, configure: Component, eventType: string, otherParams?: object): any;
|
|
21
21
|
export declare function getHandleEvent($event: any, pageContext: PageContext, configure: Component, eventType: string, otherParams?: object): any;
|
|
22
|
+
export declare function getTableUuid(pageContext: PageContext, configure: Component): any;
|
|
22
23
|
export declare function handleEventByEventName(pageContext: PageContext, configure: Component, eventName: string, otherParams?: object): any;
|
|
23
24
|
export declare function doBeforeClickEvent(pageContext: PageContext, configure: Component, otherParams?: object): any;
|
|
24
25
|
export declare function doAfterClickEvent(pageContext: PageContext, configure: Component, otherParams?: object): void;
|
|
@@ -91,7 +91,7 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
|
|
|
91
91
|
const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
|
|
92
92
|
let eventFun;
|
|
93
93
|
if (eventType && eventType === "click") {
|
|
94
|
-
const tableUuid =
|
|
94
|
+
const tableUuid = getTableUuid(pageContext, configure);
|
|
95
95
|
if (tableUuid) {
|
|
96
96
|
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
97
97
|
const selections = gridRef.getSelections();
|
|
@@ -122,6 +122,9 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
+
function getTableUuid(pageContext, configure) {
|
|
126
|
+
return configure.props.base.tableUuid ? configure.props.base.tableUuid : pageContext.tableUuids && pageContext.tableUuids.length > 0 ? pageContext.tableUuids[0] : null;
|
|
127
|
+
}
|
|
125
128
|
function packageEventParams(pageContext, configureObj, $event, otherParams) {
|
|
126
129
|
const params = {};
|
|
127
130
|
if (otherParams) {
|
|
@@ -603,6 +606,7 @@ export {
|
|
|
603
606
|
getEventFuncByType,
|
|
604
607
|
getEventNameByType,
|
|
605
608
|
getHandleEvent,
|
|
609
|
+
getTableUuid,
|
|
606
610
|
gridSelectAllRecords,
|
|
607
611
|
gridSelectRecord,
|
|
608
612
|
gridSelectionChange,
|
|
@@ -52,6 +52,7 @@ export declare function getSaveFormRequest(pageContext: any, configureObj: any,
|
|
|
52
52
|
*/
|
|
53
53
|
export declare function dealAfterOperate(pageContext: any, configureObj: any, data: any, successTip: any, isListButton?: boolean): void;
|
|
54
54
|
export declare function updateValuesWhenCloseDialog(parentPageContext: any, parentConfigureObj: any, sourceModel: any, sourceTableName: any): void;
|
|
55
|
+
export declare function refreshFormOrListPage(pageContext: any, configureObj: any): void;
|
|
55
56
|
export declare function doImportFinally(params: any, fileObj: any): void;
|
|
56
57
|
export declare function judgeDataNumber(buttonConfigureObj: any, ids: any): boolean;
|
|
57
58
|
export declare function dealCompleteTaskParam(commonEntity: any, isInit: any, pageContext: any, params?: any, operationResult?: any): boolean;
|
|
@@ -2,17 +2,15 @@ import { getBaseUrl, getRealRestApiPath, upperFirstCase, packageTemplateFiles, i
|
|
|
2
2
|
import http from "agilebuilder-ui/src/utils/request";
|
|
3
3
|
import { getI18n } from "agilebuilder-ui/src/utils/util";
|
|
4
4
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
5
|
-
import {
|
|
6
|
-
import { setSessionCache, getToken } from "agilebuilder-ui/src/utils/auth";
|
|
5
|
+
import { getToken } from "agilebuilder-ui/src/utils/auth";
|
|
7
6
|
import { getComponentRef } from "../global-refs.js";
|
|
8
7
|
import eventBus from "../eventBus.js";
|
|
9
8
|
import axios from "axios";
|
|
10
|
-
import { doAfterClickEvent, handleEvent } from "./event-util.js";
|
|
9
|
+
import { getTableUuid, doAfterClickEvent, handleEvent } from "./event-util.js";
|
|
11
10
|
import { setStoreInfo } from "../store-util.js";
|
|
12
11
|
import { refreshPage } from "../api/api-util.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { updateChartDatasources } from "../page-helper-util.js";
|
|
12
|
+
import { getPermissionCodes, getModelFields } from "../page-init-util.js";
|
|
13
|
+
import { updateChartDatasources, getVariableValue, setVariableValue } from "../page-helper-util.js";
|
|
16
14
|
import printLabelUtil from "./print-label.js";
|
|
17
15
|
const standardEvents = {
|
|
18
16
|
// 表单标准事件保存save
|
|
@@ -485,15 +483,25 @@ function getSaveFormRequestByParam(systemCode, backendUrl, param, url, formData)
|
|
|
485
483
|
return request;
|
|
486
484
|
}
|
|
487
485
|
function dealAfterOperate(pageContext, configureObj, data, successTip, isListButton) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
if (isListButton) {
|
|
486
|
+
const buttonForPageType = getPageType(pageContext, configureObj, isListButton);
|
|
487
|
+
if (buttonForPageType && buttonForPageType === "list") {
|
|
492
488
|
dealAfterWithList(pageContext, configureObj, data, successTip);
|
|
493
|
-
} else {
|
|
489
|
+
} else if (buttonForPageType && buttonForPageType === "form") {
|
|
494
490
|
dealAfterWithForm(pageContext, configureObj, data, successTip);
|
|
495
491
|
}
|
|
496
492
|
}
|
|
493
|
+
function getPageType(pageContext, configureObj, isListButton) {
|
|
494
|
+
let pageType;
|
|
495
|
+
if (isListButton === void 0) {
|
|
496
|
+
pageType = configureObj.props.base.tableUuid ? "list" : null;
|
|
497
|
+
} else if (isListButton === false) {
|
|
498
|
+
pageType = "form";
|
|
499
|
+
}
|
|
500
|
+
if (!pageType) {
|
|
501
|
+
pageType = pageContext.pageType;
|
|
502
|
+
}
|
|
503
|
+
return pageType;
|
|
504
|
+
}
|
|
497
505
|
function dealAfterWithForm(pageContext, configureObj, data, successTip) {
|
|
498
506
|
if (data) {
|
|
499
507
|
const commonEntity = data;
|
|
@@ -504,7 +512,9 @@ function dealAfterWithForm(pageContext, configureObj, data, successTip) {
|
|
|
504
512
|
if (commonEntity.formNo) {
|
|
505
513
|
pageContext.initFormNo = commonEntity.formNo;
|
|
506
514
|
}
|
|
507
|
-
|
|
515
|
+
debugger;
|
|
516
|
+
const totalModel = { ...dataModel, ...pageContext.entity.page };
|
|
517
|
+
afterSuccessOperateInForm(pageContext, configureObj, totalModel);
|
|
508
518
|
}
|
|
509
519
|
if (successTip) {
|
|
510
520
|
ElMessage({
|
|
@@ -526,11 +536,6 @@ function afterSuccessOperateInForm(pageContext, configureObj, dataModel) {
|
|
|
526
536
|
}
|
|
527
537
|
} else if (successOperation === "refresh") {
|
|
528
538
|
if (dataModel && (dataModel.id || dataModel.ID)) {
|
|
529
|
-
const dataIdSessio = dataModel.ID == null ? dataModel.id : dataModel.ID;
|
|
530
|
-
const route = useRoute();
|
|
531
|
-
if (route.query._t_) {
|
|
532
|
-
setSessionCache(route.query._t_ + "_id", dataIdSessio);
|
|
533
|
-
}
|
|
534
539
|
refreshPage(pageContext);
|
|
535
540
|
}
|
|
536
541
|
} else if (successOperation === "closeWindow" || successOperation === "closeWindowAndRefresh") {
|
|
@@ -540,7 +545,13 @@ function afterSuccessOperateInForm(pageContext, configureObj, dataModel) {
|
|
|
540
545
|
}
|
|
541
546
|
function closeDialog(pageContext, dataModel, isNeedValueMapping) {
|
|
542
547
|
const jumpMode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.jumpMode : null;
|
|
543
|
-
if (jumpMode
|
|
548
|
+
if (jumpMode === "openWindow" || jumpMode === "newTab") {
|
|
549
|
+
if (window.parent) {
|
|
550
|
+
window.parent.close();
|
|
551
|
+
} else {
|
|
552
|
+
window.close();
|
|
553
|
+
}
|
|
554
|
+
} else {
|
|
544
555
|
const sourceTableName = pageContext.tableName;
|
|
545
556
|
const isNeedValueMappingFinal = isNeedValueMapping !== void 0 && isNeedValueMapping === true && dataModel && dataModel !== void 0;
|
|
546
557
|
const parentPageCode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.parentPageCode : null;
|
|
@@ -548,46 +559,51 @@ function closeDialog(pageContext, dataModel, isNeedValueMapping) {
|
|
|
548
559
|
eventBus.$emit(eventPageInfo + "close-dialog", {
|
|
549
560
|
isNeedValueMapping: isNeedValueMappingFinal,
|
|
550
561
|
dataModel,
|
|
551
|
-
sourceTableName
|
|
562
|
+
sourceTableName,
|
|
563
|
+
jumpMode
|
|
552
564
|
});
|
|
553
|
-
} else if (jumpMode === "openWindow" || jumpMode === "newTab") {
|
|
554
|
-
if (window.parent) {
|
|
555
|
-
window.parent.close();
|
|
556
|
-
} else {
|
|
557
|
-
window.close();
|
|
558
|
-
}
|
|
559
|
-
} else {
|
|
560
|
-
const router = useRouter();
|
|
561
|
-
router.go(-1);
|
|
562
565
|
}
|
|
563
566
|
}
|
|
564
567
|
function updateValuesWhenCloseDialog(parentPageContext, parentConfigureObj, sourceModel, sourceTableName) {
|
|
565
|
-
const
|
|
568
|
+
const valueMappings = parentConfigureObj.runtime && parentConfigureObj.runtime.linkPage && parentConfigureObj.runtime.linkPage.valueMappings ? parentConfigureObj.runtime.linkPage.valueMappings : null;
|
|
566
569
|
const targetTableName = parentPageContext.tableName;
|
|
567
570
|
console.log("update-value66-", sourceModel, sourceTableName);
|
|
568
|
-
updateWithPageValue(
|
|
569
|
-
|
|
570
|
-
sourceTableName,
|
|
571
|
-
jumpPageSetting,
|
|
572
|
-
parentPageContext.entity.data,
|
|
573
|
-
targetTableName
|
|
574
|
-
);
|
|
575
|
-
handleEvent(null, parentPageContext, parentConfigureObj, "setValueCallback", {
|
|
571
|
+
updateWithPageValue(sourceModel, valueMappings, parentPageContext);
|
|
572
|
+
handleEvent(null, parentPageContext, parentConfigureObj, "setValue", {
|
|
576
573
|
sourceModel,
|
|
577
574
|
sourceTableName,
|
|
578
|
-
jumpPageSetting,
|
|
579
575
|
entity: parentPageContext.entity.data,
|
|
580
576
|
targetTableName
|
|
581
577
|
});
|
|
582
578
|
}
|
|
579
|
+
function updateWithPageValue(sourceModel, valueMappings, parentPageContext) {
|
|
580
|
+
debugger;
|
|
581
|
+
const entity = parentPageContext.entity.data;
|
|
582
|
+
if (sourceModel && sourceModel !== null && entity && entity !== null && valueMappings) {
|
|
583
|
+
let sourceEntity = sourceModel;
|
|
584
|
+
if (Array.isArray(sourceModel) && sourceModel.length > 0) {
|
|
585
|
+
sourceEntity = sourceModel[0];
|
|
586
|
+
}
|
|
587
|
+
valueMappings.forEach((valueMapping) => {
|
|
588
|
+
const sourceField = valueMapping.source;
|
|
589
|
+
if (!sourceField) {
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
const sourceFields = sourceField.split(".");
|
|
593
|
+
const targetValue = getVariableValue(sourceEntity, sourceFields);
|
|
594
|
+
const targetField = valueMapping.target;
|
|
595
|
+
const targetFields = getModelFields(parentPageContext, null, targetField);
|
|
596
|
+
setVariableValue(parentPageContext.entity, targetFields, targetValue);
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
}
|
|
583
600
|
function dealAfterWithList(pageContext, configureObj, row, successTip) {
|
|
584
601
|
let successOperation = configureObj.props.base.successOperation;
|
|
585
602
|
const isNeedValueMapping = configureObj.props.base.isNeedValueMapping;
|
|
586
|
-
const tableUuid = configureObj
|
|
603
|
+
const tableUuid = getTableUuid(pageContext, configureObj);
|
|
587
604
|
if (!successOperation) {
|
|
588
605
|
successOperation = "refresh";
|
|
589
606
|
}
|
|
590
|
-
console.log("dealAfterWithList--");
|
|
591
607
|
if (successOperation === "refresh") {
|
|
592
608
|
if (tableUuid) {
|
|
593
609
|
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
@@ -606,6 +622,26 @@ function dealAfterWithList(pageContext, configureObj, row, successTip) {
|
|
|
606
622
|
});
|
|
607
623
|
}
|
|
608
624
|
}
|
|
625
|
+
function refreshFormOrListPage(pageContext, configureObj) {
|
|
626
|
+
let successOperation = configureObj.props.base.successOperation;
|
|
627
|
+
const buttonForPageType = getPageType(pageContext, configureObj, false);
|
|
628
|
+
if (buttonForPageType && buttonForPageType === "list" && !successOperation) {
|
|
629
|
+
successOperation = "refresh";
|
|
630
|
+
}
|
|
631
|
+
if (successOperation === "refresh") {
|
|
632
|
+
if (buttonForPageType && buttonForPageType === "list") {
|
|
633
|
+
const tableUuid = getTableUuid(pageContext, configureObj);
|
|
634
|
+
if (tableUuid) {
|
|
635
|
+
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
636
|
+
gridRef.refresh();
|
|
637
|
+
} else {
|
|
638
|
+
console.error("tableUuid is empty");
|
|
639
|
+
}
|
|
640
|
+
} else if (buttonForPageType && buttonForPageType === "form") {
|
|
641
|
+
refreshPage(pageContext);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
609
645
|
function submitForm(params, isListButton, eventName, url) {
|
|
610
646
|
return new Promise((resolve, reject) => {
|
|
611
647
|
const pageContext = params.pageContext;
|
|
@@ -670,7 +706,10 @@ function getSubmitFormRequest(pageContext, configureObj, url, isUnControlVersion
|
|
|
670
706
|
ids,
|
|
671
707
|
null
|
|
672
708
|
);
|
|
673
|
-
|
|
709
|
+
const baseUrl = getBaseUrl(backendUrl);
|
|
710
|
+
let path = baseUrl + url;
|
|
711
|
+
path = getRealRestApiPath(path, systemCode, backendUrl);
|
|
712
|
+
http.post(path, param).then((result) => {
|
|
674
713
|
resolve(result);
|
|
675
714
|
}).catch((error) => {
|
|
676
715
|
reject(error);
|
|
@@ -987,8 +1026,8 @@ function getWorkflowSaveParams(params) {
|
|
|
987
1026
|
functionCodes = permissionPrefix + ".xxx";
|
|
988
1027
|
}
|
|
989
1028
|
if (!dataModel.id && !dataModel.ID) {
|
|
990
|
-
dataModel["
|
|
991
|
-
dataModel["
|
|
1029
|
+
dataModel["page_code"] = pageContext.code;
|
|
1030
|
+
dataModel["page_version"] = pageContext.version;
|
|
992
1031
|
}
|
|
993
1032
|
const param = {
|
|
994
1033
|
entity: dataModel,
|
|
@@ -1762,6 +1801,7 @@ export {
|
|
|
1762
1801
|
getTaskInformitions,
|
|
1763
1802
|
isVisibleWorkflowButton,
|
|
1764
1803
|
judgeDataNumber,
|
|
1804
|
+
refreshFormOrListPage,
|
|
1765
1805
|
standardEvents,
|
|
1766
1806
|
updateValuesWhenCloseDialog
|
|
1767
1807
|
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
function getDateShortCuts(dateScopeDetails, dateType, rangeType) {
|
|
2
|
+
if (!dateScopeDetails) {
|
|
3
|
+
return void 0;
|
|
4
|
+
}
|
|
5
|
+
const shortcuts = [];
|
|
6
|
+
if (dateScopeDetails.includes("today") && !["week", "month", "year"].includes(dateType)) {
|
|
7
|
+
const dateParams = {
|
|
8
|
+
text: "今天",
|
|
9
|
+
value: () => {
|
|
10
|
+
return /* @__PURE__ */ new Date();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
if (rangeType.endsWith("range")) {
|
|
14
|
+
dateParams.value = () => {
|
|
15
|
+
return [/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
shortcuts.push(dateParams);
|
|
19
|
+
}
|
|
20
|
+
if (dateScopeDetails.includes("yesterday") && !["week", "month", "year"].includes(dateType)) {
|
|
21
|
+
const date = /* @__PURE__ */ new Date();
|
|
22
|
+
date.setTime(date.getTime() - 3600 * 1e3 * 24);
|
|
23
|
+
const dateParams = {
|
|
24
|
+
text: "昨天",
|
|
25
|
+
value: () => {
|
|
26
|
+
return date;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
if (rangeType.endsWith("range")) {
|
|
30
|
+
dateParams.value = () => {
|
|
31
|
+
return [date, /* @__PURE__ */ new Date()];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
shortcuts.push(dateParams);
|
|
35
|
+
}
|
|
36
|
+
if (dateScopeDetails.includes("oneWeek") && !["month", "year"].includes(dateType)) {
|
|
37
|
+
const date = /* @__PURE__ */ new Date();
|
|
38
|
+
date.setTime(date.getTime() - 3600 * 1e3 * 24 * 7);
|
|
39
|
+
const dateParams = {
|
|
40
|
+
text: "一周前",
|
|
41
|
+
value: () => {
|
|
42
|
+
return date;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
if (rangeType.endsWith("range")) {
|
|
46
|
+
dateParams.text = "一周";
|
|
47
|
+
dateParams.value = () => {
|
|
48
|
+
return [date, /* @__PURE__ */ new Date()];
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
shortcuts.push(dateParams);
|
|
52
|
+
}
|
|
53
|
+
if (dateScopeDetails.includes("oneMonth") && !["year"].includes(dateType)) {
|
|
54
|
+
const date = /* @__PURE__ */ new Date();
|
|
55
|
+
if (date.getMonth() > 0) {
|
|
56
|
+
date.setMonth(date.getMonth() - 1);
|
|
57
|
+
} else {
|
|
58
|
+
date.setMonth(12);
|
|
59
|
+
date.setFullYear(date.getFullYear() - 1);
|
|
60
|
+
}
|
|
61
|
+
const dateParams = {
|
|
62
|
+
text: "一月前",
|
|
63
|
+
value: () => {
|
|
64
|
+
return date;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
if (rangeType.endsWith("range")) {
|
|
68
|
+
dateParams.text = "一月";
|
|
69
|
+
dateParams.value = () => {
|
|
70
|
+
return [date, /* @__PURE__ */ new Date()];
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
shortcuts.push(dateParams);
|
|
74
|
+
}
|
|
75
|
+
if (dateScopeDetails.includes("oneYear")) {
|
|
76
|
+
const date = /* @__PURE__ */ new Date();
|
|
77
|
+
date.setFullYear(date.getFullYear() - 1);
|
|
78
|
+
const dateParams = {
|
|
79
|
+
text: "一年前",
|
|
80
|
+
value: () => {
|
|
81
|
+
return date;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
if (rangeType.endsWith("range")) {
|
|
85
|
+
dateParams.text = "一年";
|
|
86
|
+
dateParams.value = () => {
|
|
87
|
+
return [date, /* @__PURE__ */ new Date()];
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
shortcuts.push(dateParams);
|
|
91
|
+
}
|
|
92
|
+
return shortcuts;
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
getDateShortCuts
|
|
96
|
+
};
|
|
@@ -98,6 +98,12 @@ export declare function formatVariableValue(pageContext: PageContext, variable:
|
|
|
98
98
|
* @returns
|
|
99
99
|
*/
|
|
100
100
|
export declare function formatValueByType(value: any, formatType: string, formatInfo: any): any;
|
|
101
|
+
/**
|
|
102
|
+
* 根据变量获取值
|
|
103
|
+
* @param entity
|
|
104
|
+
* @param variable
|
|
105
|
+
*/
|
|
106
|
+
export declare function getValueFromVariable(entity: any, variable: string): any;
|
|
101
107
|
/**
|
|
102
108
|
* 从对象中获取值
|
|
103
109
|
* @param valueSource 源对象
|
|
@@ -339,7 +339,6 @@ function setValueForVariableName(entity, variableName, newValue) {
|
|
|
339
339
|
setVariableValue(entity, fields, newValue);
|
|
340
340
|
}
|
|
341
341
|
function setVariableValue(entity, fields, newValue) {
|
|
342
|
-
debugger;
|
|
343
342
|
if (!entity || !fields || fields.length == 0) {
|
|
344
343
|
return;
|
|
345
344
|
}
|
|
@@ -478,7 +477,7 @@ function getValueFromVariable(entity, variable) {
|
|
|
478
477
|
}
|
|
479
478
|
}
|
|
480
479
|
function getValueFromSource(valueSource, paramName, paramType) {
|
|
481
|
-
if (!valueSource || !paramName) {
|
|
480
|
+
if (paramType != "context" && !valueSource || !paramName) {
|
|
482
481
|
return void 0;
|
|
483
482
|
}
|
|
484
483
|
const firstIndex = paramName.indexOf(".");
|
|
@@ -492,8 +491,28 @@ function getValueFromSource(valueSource, paramName, paramType) {
|
|
|
492
491
|
return getValueFromSource(childValue, newParamName, paramType);
|
|
493
492
|
} else {
|
|
494
493
|
if (paramType == "context") {
|
|
494
|
+
console.log("newDate", paramName);
|
|
495
495
|
if (paramName == "currentDate" || paramName == "currentTime") {
|
|
496
496
|
return /* @__PURE__ */ new Date();
|
|
497
|
+
} else if (paramName.startsWith("currentDate") && paramName.length > 11) {
|
|
498
|
+
const str = paramName.substring(11);
|
|
499
|
+
const symbol = str.substring(0, 1);
|
|
500
|
+
let num = parseInt(str.substring(1, str.length - 1), 10);
|
|
501
|
+
const unit = str.substring(str.length - 1);
|
|
502
|
+
const date = /* @__PURE__ */ new Date();
|
|
503
|
+
num = "+" === symbol ? num : -num;
|
|
504
|
+
if (unit === "d" || unit === "w") {
|
|
505
|
+
num = unit === "w" ? num * 7 : num;
|
|
506
|
+
date.setDate(date.getDate() + num);
|
|
507
|
+
} else if (unit === "m") {
|
|
508
|
+
date.setMonth(date.getMonth() + num);
|
|
509
|
+
} else if (unit === "y") {
|
|
510
|
+
date.setFullYear(date.getFullYear() + num);
|
|
511
|
+
}
|
|
512
|
+
return date;
|
|
513
|
+
}
|
|
514
|
+
if (!valueSource) {
|
|
515
|
+
return void 0;
|
|
497
516
|
}
|
|
498
517
|
}
|
|
499
518
|
return valueSource[paramName];
|
|
@@ -637,6 +656,7 @@ export {
|
|
|
637
656
|
getFormPropName,
|
|
638
657
|
getOptionDatasFromPage,
|
|
639
658
|
getValueFromSource,
|
|
659
|
+
getValueFromVariable,
|
|
640
660
|
getVariableValue,
|
|
641
661
|
monitorFieldChange,
|
|
642
662
|
queryOptionDatasources,
|
|
@@ -17,12 +17,13 @@ export declare function queryPageDesignByCode(pageCode: string): Promise<any>;
|
|
|
17
17
|
* @param pageDesign 页面设计对象
|
|
18
18
|
*/
|
|
19
19
|
export declare function convertToPageContext(pageDesign: PageDesign, pageRequest: object): PageContext | null;
|
|
20
|
+
export declare function getModelFields(pageContext: PageContext, formItemConfigure: Component, prop?: string): string[];
|
|
20
21
|
/**
|
|
21
22
|
* 获取表单元素模型名称
|
|
22
23
|
* @param pageContext 页面对象
|
|
23
24
|
* @param formItemConfigure 表单元素配置参数
|
|
24
25
|
*/
|
|
25
|
-
export declare function getFormModelFields(pageContext: PageContext, formItemConfigure:
|
|
26
|
+
export declare function getFormModelFields(pageContext: PageContext, formItemConfigure: any, prop?: string): string[];
|
|
26
27
|
/**
|
|
27
28
|
* 获取组件的权限编码
|
|
28
29
|
* @param configure
|
|
@@ -4,7 +4,9 @@ import { getAdditionalParamMap } from "./events/standard-event.js";
|
|
|
4
4
|
import { PageDimensions } from "./interfaces/page-design-types.js";
|
|
5
5
|
import { formatVariableValue, setVariableValue, getFormPropName } from "./page-helper-util.js";
|
|
6
6
|
function queryPageDesignByCode(pageCode) {
|
|
7
|
-
return http.get(
|
|
7
|
+
return http.get(
|
|
8
|
+
window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + pageCode
|
|
9
|
+
);
|
|
8
10
|
}
|
|
9
11
|
function convertToPageContext(pageDesign, pageRequest) {
|
|
10
12
|
if (pageDesign == null) {
|
|
@@ -39,6 +41,8 @@ function convertToPageContext(pageDesign, pageRequest) {
|
|
|
39
41
|
// 无ID或taskId时初始条件配置
|
|
40
42
|
subTablePageInfo: pageDesign.subTablePageInfo,
|
|
41
43
|
// 列表分页信息,格式是:{列表编码: 每页显示多少条记录},表单页面中校验有分页的子表时提示使用,提示信息格式:第 {pageNum} 页第 {row} 行记录
|
|
44
|
+
workflowCode: pageDesign.workflowCode,
|
|
45
|
+
workflowVersion: pageDesign.workflowVersion,
|
|
42
46
|
entity: {
|
|
43
47
|
data: {},
|
|
44
48
|
task: {},
|
|
@@ -49,11 +53,6 @@ function convertToPageContext(pageDesign, pageRequest) {
|
|
|
49
53
|
system: {}
|
|
50
54
|
}
|
|
51
55
|
};
|
|
52
|
-
if (pageDesign.props && pageDesign.props.activeWorkflow && pageDesign.props.workflowSource && pageDesign.props.workflowSource === "link") {
|
|
53
|
-
pageContext.workflowCode = pageDesign.props.linkWorkflowCode;
|
|
54
|
-
} else if (pageDesign.props && pageDesign.props.activeWorkflow && pageDesign.props.workflowSource && pageDesign.props.workflowSource === "create") {
|
|
55
|
-
pageContext.workflowCode = pageDesign.props.createWorkflowCode;
|
|
56
|
-
}
|
|
57
56
|
if (pageDesign.variables) {
|
|
58
57
|
const pageObj = pageContext.entity.page;
|
|
59
58
|
for (const variable of pageDesign.variables) {
|
|
@@ -111,11 +110,11 @@ function getRequestObject(pageRequest) {
|
|
|
111
110
|
;
|
|
112
111
|
return requestObj;
|
|
113
112
|
}
|
|
114
|
-
function
|
|
113
|
+
function getModelFields(pageContext, formItemConfigure, prop) {
|
|
115
114
|
if (!formItemConfigure) {
|
|
116
115
|
return ["temp"];
|
|
117
116
|
}
|
|
118
|
-
|
|
117
|
+
pageContext.entity;
|
|
119
118
|
let propsBase;
|
|
120
119
|
let propName = prop;
|
|
121
120
|
if (!prop) {
|
|
@@ -127,14 +126,28 @@ function getFormModelFields(pageContext, formItemConfigure, prop) {
|
|
|
127
126
|
fields = ["data", prop];
|
|
128
127
|
} else if (!propName || !propName.startsWith("${")) {
|
|
129
128
|
fields = ["page", formItemConfigure.uuid];
|
|
130
|
-
} else {
|
|
129
|
+
} else if (propName.startsWith("${")) {
|
|
131
130
|
propName = propName.substring(2, propName.length - 1);
|
|
132
131
|
fields = propName.split(".");
|
|
133
|
-
if (fields.length < 2) {
|
|
132
|
+
if (formItemConfigure && fields.length < 2) {
|
|
134
133
|
fields = [formItemConfigure.uuid];
|
|
135
134
|
}
|
|
135
|
+
} else if (formItemConfigure) {
|
|
136
|
+
fields = ["page", formItemConfigure.uuid];
|
|
137
|
+
}
|
|
138
|
+
if (!fields && !formItemConfigure) {
|
|
139
|
+
return ["temp"];
|
|
136
140
|
}
|
|
137
|
-
|
|
141
|
+
return fields;
|
|
142
|
+
}
|
|
143
|
+
function getFormModelFields(pageContext, formItemConfigure, prop) {
|
|
144
|
+
const fields = getModelFields(pageContext, formItemConfigure, prop);
|
|
145
|
+
const entity = pageContext.entity;
|
|
146
|
+
let propsBase;
|
|
147
|
+
if (formItemConfigure) {
|
|
148
|
+
propsBase = formItemConfigure.props.base ? formItemConfigure.props.base : {};
|
|
149
|
+
}
|
|
150
|
+
if (entity.data.ID == void 0 && entity.data.id == void 0) {
|
|
138
151
|
if (propsBase && propsBase.defaultValue) {
|
|
139
152
|
let defaultValue = formatVariableValue(pageContext, propsBase.defaultValue);
|
|
140
153
|
if (defaultValue != null && defaultValue != void 0) {
|
|
@@ -190,12 +203,15 @@ function queryPageSuperGrids(pageDesign, pageContext, publishVersion) {
|
|
|
190
203
|
if (additionalParamMap && Object.keys(additionalParamMap) > 0) {
|
|
191
204
|
additionalParamMapJson = JSON.stringify(additionalParamMap);
|
|
192
205
|
}
|
|
193
|
-
return http.post(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
206
|
+
return http.post(
|
|
207
|
+
window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/super-grids",
|
|
208
|
+
{
|
|
209
|
+
tableRuntimes,
|
|
210
|
+
additionalParamMapJson,
|
|
211
|
+
pageCode,
|
|
212
|
+
publishVersion
|
|
213
|
+
}
|
|
214
|
+
);
|
|
199
215
|
}
|
|
200
216
|
function packageFormRules(pageContext, configure) {
|
|
201
217
|
const isWorkflow = pageContext.workflowCode ? true : false;
|
|
@@ -222,6 +238,7 @@ function packageFormRules(pageContext, configure) {
|
|
|
222
238
|
export {
|
|
223
239
|
convertToPageContext,
|
|
224
240
|
getFormModelFields,
|
|
241
|
+
getModelFields,
|
|
225
242
|
getPermissionCodes,
|
|
226
243
|
packageFormRules,
|
|
227
244
|
queryPageDesignByCode,
|
|
@@ -22,7 +22,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
const runtimeClass = runtimeInfo.class;
|
|
23
23
|
const systemCode = pageContext.systemCode;
|
|
24
24
|
const backendUrl = pageContext.backendUrl;
|
|
25
|
-
debugger;
|
|
26
25
|
const tableName = configure.props && configure.props.dataOrigin && configure.props.dataOrigin.tableName;
|
|
27
26
|
let baseURL = pageContext.backendUrl;
|
|
28
27
|
if (!baseURL) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, createBlock, unref, createCommentVNode } from "vue";
|
|
2
2
|
import { setTableEvents, gridSelectRecord, gridSelectAllRecords, gridSelectionChange, cellClick, cellDblClick, rowClick, rowDblClick, headerClick } from "../../../../utils/events/event-util.js";
|
|
3
3
|
import { setVariableValue, getVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getModelFields } from "../../../../utils/page-init-util.js";
|
|
5
5
|
import eventBus from "../../../../utils/eventBus.js";
|
|
6
6
|
import { popupToPage } from "../../../../utils/table-utils.js";
|
|
7
7
|
import { getListCode } from "../../../../utils/common-util.js";
|
|
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
const runtimeStyle = runtimeInfo.style;
|
|
30
30
|
const runtimeClass = runtimeInfo.class;
|
|
31
31
|
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
32
|
-
let dynamicFields =
|
|
32
|
+
let dynamicFields = getModelFields(props.pageContext, props.configure, "${data." + prop + "}");
|
|
33
33
|
const listViewShowFlag = ref(false);
|
|
34
34
|
const baseURL = window["$vueApp"].config.globalProperties.baseURL;
|
|
35
35
|
const listViewOptions = ref({
|
|
@@ -115,7 +115,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
115
115
|
return getVariableValue(entity, dynamicFields);
|
|
116
116
|
}
|
|
117
117
|
function changeInitializationSubTable(canRrefreshSubtableData) {
|
|
118
|
-
debugger;
|
|
119
118
|
currencyListViewSetting(canRrefreshSubtableData);
|
|
120
119
|
listViewOptions.value["isPageInfo"] = false;
|
|
121
120
|
listViewOptions.value["subTableData"] = getValue();
|
|
@@ -178,7 +177,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
178
177
|
pageContext.tableUuids.push(configure.uuid);
|
|
179
178
|
}
|
|
180
179
|
function getOperations() {
|
|
181
|
-
debugger;
|
|
182
180
|
let operations = [];
|
|
183
181
|
if (isShowAdd()) {
|
|
184
182
|
const addButton = {
|
|
@@ -286,7 +284,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
286
284
|
gridRef.value.deleteRow(rowIndex, listCode, false);
|
|
287
285
|
}
|
|
288
286
|
function changeGridData(gridData) {
|
|
289
|
-
debugger;
|
|
290
287
|
setVariableValue(entity, dynamicFields, gridData);
|
|
291
288
|
}
|
|
292
289
|
function changeRowsPerpage(pageSize) {
|
|
@@ -20,7 +20,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
const superGridItems = props.pageContext.superGridItems;
|
|
21
21
|
const superGridSetting = superGridItems ? superGridItems[tableUuid] : null;
|
|
22
22
|
tableConfigure.value = superGridSetting ? superGridSetting.configure ? JSON.parse(superGridSetting.configure) : null : props.configure;
|
|
23
|
-
debugger;
|
|
24
23
|
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
25
24
|
runtimeInfo.style;
|
|
26
25
|
runtimeInfo.class;
|
package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getDateShortCuts } from "../../../../utils/form/date-shortcuts.js";
|
|
4
|
+
import { getVariableValue, setVariableValue, getValueFromVariable } from "../../../../utils/page-helper-util.js";
|
|
4
5
|
import { getCustomFunc, handleEvent } from "../../../../utils/events/event-util.js";
|
|
5
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
7
|
__name: "datepicker-runtime",
|
|
@@ -25,6 +26,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
26
|
const runtimeClass = runtimeInfo.class;
|
|
26
27
|
const headerStyle = runtimeInfo.headerStyle;
|
|
27
28
|
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
29
|
+
if (designProperty.value.dateType && designProperty.value.dateType.includes("range")) {
|
|
30
|
+
let hisValue = getVariableValue(entity, dynamicFields);
|
|
31
|
+
if (hisValue && !Array.isArray(hisValue)) {
|
|
32
|
+
hisValue = [hisValue];
|
|
33
|
+
}
|
|
34
|
+
if (!entity.data || !entity.data.id && !entity.data.ID) {
|
|
35
|
+
if (designProperty.value.defaultValue2) {
|
|
36
|
+
const defaultValue2 = getValueFromVariable(entity, designProperty.value.defaultValue2);
|
|
37
|
+
hisValue = !hisValue ? [] : hisValue;
|
|
38
|
+
if (hisValue.length == 0) {
|
|
39
|
+
hisValue.push(void 0);
|
|
40
|
+
}
|
|
41
|
+
if (hisValue.length > 1) {
|
|
42
|
+
hisValue[1] = defaultValue2;
|
|
43
|
+
} else {
|
|
44
|
+
hisValue.push(defaultValue2);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
setVariableValue(entity, dynamicFields, hisValue);
|
|
49
|
+
}
|
|
50
|
+
const shortcuts = ref(
|
|
51
|
+
getDateShortCuts(
|
|
52
|
+
designProperty.value.dateScopeDetails,
|
|
53
|
+
designProperty.value.sourceType,
|
|
54
|
+
designProperty.value.dateType
|
|
55
|
+
)
|
|
56
|
+
);
|
|
28
57
|
if (designProperty.value.shortcutsFunc) {
|
|
29
58
|
const func = getCustomFunc(props.pageContext, designProperty.value.shortcutsFunc);
|
|
30
59
|
if (func) {
|
|
@@ -35,18 +64,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
64
|
}
|
|
36
65
|
]);
|
|
37
66
|
if (returns) {
|
|
38
|
-
if (
|
|
67
|
+
if (!Array.isArray(returns)) {
|
|
39
68
|
returns = [returns];
|
|
40
69
|
}
|
|
41
|
-
if (!
|
|
42
|
-
|
|
70
|
+
if (!shortcuts.value) {
|
|
71
|
+
shortcuts.value = [];
|
|
43
72
|
}
|
|
44
73
|
for (let r of returns) {
|
|
45
74
|
if (r.text && r.value) {
|
|
46
|
-
|
|
75
|
+
shortcuts.value.push(r);
|
|
47
76
|
}
|
|
48
77
|
}
|
|
49
78
|
}
|
|
79
|
+
console.log("shortcuts", shortcuts.value);
|
|
50
80
|
}
|
|
51
81
|
}
|
|
52
82
|
return (_ctx, _cache) => {
|
|
@@ -80,7 +110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
110
|
format: designProperty.value.format,
|
|
81
111
|
modelValue: dynamicModelMethod.value,
|
|
82
112
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dynamicModelMethod.value = $event),
|
|
83
|
-
shortcuts:
|
|
113
|
+
shortcuts: shortcuts.value,
|
|
84
114
|
type: designProperty.value.dateType,
|
|
85
115
|
onChange: _cache[1] || (_cache[1] = ($event) => unref(handleEvent)($event, _ctx.pageContext, _ctx.configure, "change")),
|
|
86
116
|
onBlur: _cache[2] || (_cache[2] = ($event) => unref(handleEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
|
|
@@ -100,7 +130,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
100
130
|
format: designProperty.value.format,
|
|
101
131
|
modelValue: dynamicModelMethod.value,
|
|
102
132
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => dynamicModelMethod.value = $event),
|
|
103
|
-
shortcuts:
|
|
133
|
+
shortcuts: shortcuts.value,
|
|
104
134
|
type: designProperty.value.dateType,
|
|
105
135
|
onChange: _cache[8] || (_cache[8] = ($event) => unref(handleEvent)($event, _ctx.pageContext, _ctx.configure, "change")),
|
|
106
136
|
onBlur: _cache[9] || (_cache[9] = ($event) => unref(handleEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
|
|
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
if (pageParams["configureObj"]) {
|
|
37
37
|
delete pageParams["configureObj"];
|
|
38
38
|
}
|
|
39
|
-
Object.assign(pageRequest.value,
|
|
39
|
+
Object.assign(pageRequest.value, pageParams);
|
|
40
40
|
} catch (error) {
|
|
41
41
|
console.error(error);
|
|
42
42
|
}
|
|
@@ -9,14 +9,15 @@ import _sfc_main$3 from "./assemblys/common/task-informition-dialog.vue.js";
|
|
|
9
9
|
import _sfc_main$4 from "./assemblys/common/remove-signer-dialog.vue.js";
|
|
10
10
|
import eventBus from "../utils/eventBus.js";
|
|
11
11
|
import { getFormData } from "../utils/api/api-util.js";
|
|
12
|
-
import { getTaskInformitions, getRemoveSigner, exportFormReport, doImportFinally, doAddSigner, doCreateCopyTask, doAssign, doReturnTaskTo, doRemoveSigners, getAdditionalParamMap, updateValuesWhenCloseDialog } from "../utils/events/standard-event.js";
|
|
12
|
+
import { getTaskInformitions, getRemoveSigner, exportFormReport, doImportFinally, doAddSigner, doCreateCopyTask, doAssign, doReturnTaskTo, doRemoveSigners, getAdditionalParamMap, updateValuesWhenCloseDialog, refreshFormOrListPage } from "../utils/events/standard-event.js";
|
|
13
13
|
import { ElMessage } from "element-plus";
|
|
14
14
|
import { useI18n } from "vue-i18n";
|
|
15
15
|
import { DepartmentUserTree } from "agilebuilder-ui";
|
|
16
16
|
import { i18nValidateRulesMessage } from "../utils/events/validator-util.js";
|
|
17
17
|
import _sfc_main$5 from "./super-page-dialog.vue.js";
|
|
18
|
-
import { useRouter } from "vue-router";
|
|
18
|
+
import { useRoute, useRouter } from "vue-router";
|
|
19
19
|
import { jumpToPage } from "agilebuilder-ui/src/utils/jump-page-utils";
|
|
20
|
+
import { setSessionCache } from "agilebuilder-ui/src/utils/auth";
|
|
20
21
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
22
|
__name: "super-page",
|
|
22
23
|
props: {
|
|
@@ -96,6 +97,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
97
|
let pageContext = ref(null);
|
|
97
98
|
const buttonConfigure = ref(null);
|
|
98
99
|
const buttonPageContext = ref(null);
|
|
100
|
+
const route = useRoute();
|
|
99
101
|
function initPageDesign(pageDesign) {
|
|
100
102
|
console.log("pageDesign==", pageDesign);
|
|
101
103
|
pageContext.value = convertToPageContext(pageDesign, props.pageRequest);
|
|
@@ -175,12 +177,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
177
|
parentEventParams.value = params.eventParams;
|
|
176
178
|
openDialog(parentConfigureObj.value, parentEventParams.value);
|
|
177
179
|
});
|
|
178
|
-
eventBus.$on(
|
|
179
|
-
eventPageInfo.value + "close-dialog",
|
|
180
|
-
({ isNeedValueMapping, dataModel, sourceTableName }) => {
|
|
181
|
-
closeDialog({ isNeedValueMapping, dataModel, sourceTableName });
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
180
|
watch(
|
|
185
181
|
() => pageContext.value.isRefresh,
|
|
186
182
|
(newValue) => {
|
|
@@ -245,6 +241,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
245
241
|
} else {
|
|
246
242
|
isShowPage.value = true;
|
|
247
243
|
}
|
|
244
|
+
sessionCacheDataId();
|
|
248
245
|
});
|
|
249
246
|
}, 0);
|
|
250
247
|
} else if (props.pageCode) {
|
|
@@ -254,12 +251,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
254
251
|
const pageConf = JSON.parse(designJson);
|
|
255
252
|
pageDesignResult.value = pageConf;
|
|
256
253
|
initPageDesign(pageConf).then(() => {
|
|
254
|
+
sessionCacheDataId();
|
|
257
255
|
isShowPage.value = true;
|
|
258
256
|
});
|
|
259
257
|
}
|
|
260
258
|
});
|
|
261
259
|
}
|
|
262
260
|
}
|
|
261
|
+
function sessionCacheDataId() {
|
|
262
|
+
const dataModel = pageContext.value.entity.data;
|
|
263
|
+
const dataIdSessio = dataModel.ID == null ? dataModel.id : dataModel.ID;
|
|
264
|
+
if (route.query._t_) {
|
|
265
|
+
setSessionCache(route.query._t_ + "_id", dataIdSessio);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
263
268
|
onUpdated(() => {
|
|
264
269
|
nextTick(() => {
|
|
265
270
|
if (pageContext.value && thisRef.value) {
|
|
@@ -280,6 +285,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
280
285
|
eventBus.$off(eventPageInfo.value + "choose-return-node");
|
|
281
286
|
eventBus.$off(eventPageInfo.value + "remove-signer");
|
|
282
287
|
eventBus.$off(eventPageInfo.value + "prohibit-edit");
|
|
288
|
+
eventBus.$off(eventPageInfo.value + "open-dialog");
|
|
283
289
|
if (pageContext.value) {
|
|
284
290
|
handleEvent(null, pageContext.value, pageContext.value, "onUnmounted");
|
|
285
291
|
}
|
|
@@ -370,6 +376,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
370
376
|
popPageSetting.parentPageVersion = parentPageContext.value.version;
|
|
371
377
|
popPageSetting.isNewPage = true;
|
|
372
378
|
if (jumpMode === "popup") {
|
|
379
|
+
eventBus.$on(
|
|
380
|
+
eventPageInfo.value + "close-dialog",
|
|
381
|
+
(params) => {
|
|
382
|
+
closeFunc(params);
|
|
383
|
+
}
|
|
384
|
+
);
|
|
373
385
|
jumpPageSetting.value = popPageSetting;
|
|
374
386
|
isShowDialog.value = true;
|
|
375
387
|
} else if (jumpMode === "refresh") {
|
|
@@ -385,11 +397,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
385
397
|
console.error("页面配置信息不存在");
|
|
386
398
|
}
|
|
387
399
|
}
|
|
400
|
+
function closeFunc(params) {
|
|
401
|
+
const jumpMode = params.jumpMode;
|
|
402
|
+
if (jumpMode && jumpMode === "popup") {
|
|
403
|
+
closeDialog(params);
|
|
404
|
+
} else {
|
|
405
|
+
router.go(-1);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
388
408
|
function closeDialog(params) {
|
|
409
|
+
let dataModel;
|
|
410
|
+
let sourceTableName;
|
|
389
411
|
if (params) {
|
|
390
412
|
const isNeedValueMapping = params.isNeedValueMapping;
|
|
391
|
-
|
|
392
|
-
|
|
413
|
+
dataModel = params.dataModel;
|
|
414
|
+
sourceTableName = params.sourceTableName;
|
|
393
415
|
if (isNeedValueMapping) {
|
|
394
416
|
updateValuesWhenCloseDialog(
|
|
395
417
|
parentPageContext.value,
|
|
@@ -399,9 +421,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
399
421
|
);
|
|
400
422
|
}
|
|
401
423
|
}
|
|
424
|
+
const targetTableName = parentPageContext.value.tableName;
|
|
425
|
+
handleEvent(null, parentPageContext.value, parentConfigureObj.value, "closePopup", {
|
|
426
|
+
sourceModel: dataModel,
|
|
427
|
+
sourceTableName,
|
|
428
|
+
jumpPageSetting,
|
|
429
|
+
entity: parentPageContext.value.entity.data,
|
|
430
|
+
targetTableName
|
|
431
|
+
});
|
|
432
|
+
refreshFormOrListPage(parentPageContext.value, parentConfigureObj.value);
|
|
402
433
|
parentPageContext.value = null;
|
|
403
434
|
parentConfigureObj.value = null;
|
|
404
435
|
parentEventParams.value = null;
|
|
436
|
+
eventBus.$off(eventPageInfo.value + "close-dialog");
|
|
405
437
|
isShowDialog.value = false;
|
|
406
438
|
}
|
|
407
439
|
return (_ctx, _cache) => {
|
package/dist/es/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { getStandPermissionInfo, getFunctionInfo, FuncType } from './components/
|
|
|
4
4
|
import { getCustomTheme, getCustomThemeOptions, getNumFormatter } from './components/runtime/utils/charts/chart-util';
|
|
5
5
|
import { default as cn } from './i18n/langs/cn.js';
|
|
6
6
|
import { default as en } from './i18n/langs/en.js';
|
|
7
|
+
import { getDateShortCuts } from './components/runtime/utils/form/date-shortcuts';
|
|
7
8
|
|
|
8
9
|
export { SuperPageNew, SuperPageDialogNew, getComponentOptionConfigs };
|
|
9
10
|
export { getStandPermissionInfo, getFunctionInfo, FuncType };
|
|
10
11
|
export { getCustomTheme, getCustomThemeOptions, getNumFormatter as getNumFormatterForChart };
|
|
12
|
+
export { getDateShortCuts };
|
|
11
13
|
export { cn, en };
|
package/dist/es/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { FuncType, getFunctionInfo, getStandPermissionInfo } from "./components/
|
|
|
5
5
|
import { getCustomTheme, getCustomThemeOptions, getNumFormatter } from "./components/runtime/utils/charts/chart-util.js";
|
|
6
6
|
import { default as default4 } from "./i18n/langs/cn.js";
|
|
7
7
|
import { default as default5 } from "./i18n/langs/en.js";
|
|
8
|
+
import { getDateShortCuts } from "./components/runtime/utils/form/date-shortcuts.js";
|
|
8
9
|
export {
|
|
9
10
|
FuncType,
|
|
10
11
|
default3 as SuperPageDialogNew,
|
|
@@ -14,6 +15,7 @@ export {
|
|
|
14
15
|
getComponentOptionConfigs,
|
|
15
16
|
getCustomTheme,
|
|
16
17
|
getCustomThemeOptions,
|
|
18
|
+
getDateShortCuts,
|
|
17
19
|
getFunctionInfo,
|
|
18
20
|
getNumFormatter as getNumFormatterForChart,
|
|
19
21
|
getStandPermissionInfo
|