super-page-runtime 2.1.54 → 2.1.60
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/page-expose-util.js +17 -14
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +0 -1
- package/dist/es/components/runtime/utils/charts/chart-util.d.ts +24 -0
- package/dist/es/components/runtime/utils/charts/chart-util.js +4 -1
- package/dist/es/components/runtime/utils/common-util.js +2 -5
- package/dist/es/components/runtime/utils/events/event-util.d.ts +1 -0
- package/dist/es/components/runtime/utils/events/event-util.js +7 -3
- package/dist/es/components/runtime/utils/events/standard-event.d.ts +1 -1
- package/dist/es/components/runtime/utils/events/standard-event.js +102 -38
- package/dist/es/components/runtime/utils/events/validator-util.d.ts +1 -1
- package/dist/es/components/runtime/utils/events/validator-util.js +4 -3
- package/dist/es/components/runtime/utils/page-helper-util.js +0 -1
- package/dist/es/components/runtime/utils/page-init-util.js +11 -9
- package/dist/es/components/runtime/utils/table-utils.d.ts +1 -0
- package/dist/es/components/runtime/utils/table-utils.js +39 -7
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +12 -3
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -1
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +14 -2
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +16 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +106 -55
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +0 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +14 -8
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +11 -1
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +11 -1
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +11 -1
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +11 -1
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +14 -2
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +11 -1
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +30 -10
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +9 -4
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +34 -64
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +20 -8
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +11 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +30 -3
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +24 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +31 -5
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +33 -2
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +21 -2
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +26 -4
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +29 -2
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +29 -14
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +32 -5
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +29 -2
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +26 -4
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +29 -2
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +22 -3
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +27 -8
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +18 -1
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +29 -4
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +25 -2
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +29 -2
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +3 -5
- package/dist/es/components/runtime/views/super-page.vue.js +89 -26
- package/dist/es/i18n/langs/cn.js +3 -1
- package/dist/es/i18n/langs/en.js +3 -1
- package/dist/es/style.css +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { getComponentRefByCode, getComponentRef } from "../global-refs.js";
|
|
|
3
3
|
import eventBus from "../eventBus.js";
|
|
4
4
|
import http from "agilebuilder-ui/src/utils/request";
|
|
5
5
|
import { getAdditionalParamMap, refreshPage } from "../events/standard-event.js";
|
|
6
|
-
import { updateFormItemEditState,
|
|
6
|
+
import { updateFormItemEditState, disabledAllFields } from "../events/validator-util.js";
|
|
7
7
|
import { getBaseUrl, deepCopy } from "../common-util.js";
|
|
8
8
|
import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
|
|
9
9
|
import { getFormModelFields, getModelFields } from "../page-init-util.js";
|
|
@@ -180,8 +180,8 @@ const functions = {
|
|
|
180
180
|
* 禁用所有字段
|
|
181
181
|
* @param pageContext 页面上下文
|
|
182
182
|
*/
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
disabledAllFields(pageContext) {
|
|
184
|
+
disabledAllFields(pageContext);
|
|
185
185
|
},
|
|
186
186
|
/**
|
|
187
187
|
* 控制表格编辑权限
|
|
@@ -215,7 +215,7 @@ const functions = {
|
|
|
215
215
|
params.requestParams = getAdditionalParamMap(pageContext);
|
|
216
216
|
}
|
|
217
217
|
if (!params.taskParamMap) {
|
|
218
|
-
params.
|
|
218
|
+
params.taskParamMap = pageContext.entity.task;
|
|
219
219
|
}
|
|
220
220
|
let baseUrl = pageContext.backendUrl;
|
|
221
221
|
if (!baseUrl) {
|
|
@@ -227,8 +227,7 @@ const functions = {
|
|
|
227
227
|
eventBus.$emit(pageContext.code + "_open-dialog", {
|
|
228
228
|
pageContext,
|
|
229
229
|
eventParams: openParam.eventParams,
|
|
230
|
-
configureObj: { props: { linkPage: openParam } }
|
|
231
|
-
jumpPageSetting: openParam.jumpPageSetting
|
|
230
|
+
configureObj: { props: { linkPage: openParam } }
|
|
232
231
|
});
|
|
233
232
|
},
|
|
234
233
|
/**
|
|
@@ -317,9 +316,13 @@ const functions = {
|
|
|
317
316
|
isMobile() {
|
|
318
317
|
return isMobileBrowser();
|
|
319
318
|
},
|
|
320
|
-
//
|
|
319
|
+
// 根据获取组件引用对象
|
|
320
|
+
getComponentRefByProp(pageContext, prop) {
|
|
321
|
+
return getComponentRefByCode(pageContext, prop);
|
|
322
|
+
},
|
|
323
|
+
// 根据组件唯一编码获取组件引用对象
|
|
321
324
|
getComponentRefByCode(pageContext, code) {
|
|
322
|
-
return
|
|
325
|
+
return getComponentRef(pageContext, code);
|
|
323
326
|
},
|
|
324
327
|
// 获得表单数据查看信息,例如:下拉框选项名等
|
|
325
328
|
getFormViewData(pageContext) {
|
|
@@ -327,7 +330,7 @@ const functions = {
|
|
|
327
330
|
const entity = pageContext.entity ? pageContext.entity : {};
|
|
328
331
|
const viewEntity = deepCopy(entity);
|
|
329
332
|
const optionSourceMap = getOptionDatasSourceMap(pageContext);
|
|
330
|
-
for (
|
|
333
|
+
for (const uuid in optionSourceMap) {
|
|
331
334
|
const cacheOptions = getComponentOptionDatasFromPage(pageContext, uuid);
|
|
332
335
|
const componentRef = getComponentRef(pageContext, uuid);
|
|
333
336
|
if (componentRef) {
|
|
@@ -335,7 +338,7 @@ const functions = {
|
|
|
335
338
|
if (componentConfigure) {
|
|
336
339
|
if (((_b = (_a = componentConfigure.props) == null ? void 0 : _a.dataOrigin) == null ? void 0 : _b.optionValueSetType) && (((_d = (_c = componentConfigure.props) == null ? void 0 : _c.dataOrigin) == null ? void 0 : _d.optionValueSetType) === "static" || ((_f = (_e = componentConfigure.props) == null ? void 0 : _e.dataOrigin) == null ? void 0 : _f.optionValueSetType) === "optionGroup")) {
|
|
337
340
|
if (componentConfigure.name && (componentConfigure.name === "select" && ((_h = (_g = componentConfigure.props) == null ? void 0 : _g.base) == null ? void 0 : _h.multiple) || componentConfigure.name === "checkbox")) {
|
|
338
|
-
|
|
341
|
+
const dynamicFields = getFormModelFields(pageContext, componentConfigure);
|
|
339
342
|
const propValue = getVariableValue(viewEntity, dynamicFields);
|
|
340
343
|
if (propValue) {
|
|
341
344
|
const propValues = propValue.split(",");
|
|
@@ -343,7 +346,7 @@ const functions = {
|
|
|
343
346
|
setVariableValue(viewEntity, dynamicFields, label);
|
|
344
347
|
}
|
|
345
348
|
} else {
|
|
346
|
-
|
|
349
|
+
const dynamicFields = getFormModelFields(pageContext, componentConfigure);
|
|
347
350
|
const propValue = getVariableValue(viewEntity, dynamicFields);
|
|
348
351
|
const label = getSelectShowLable(propValue, cacheOptions);
|
|
349
352
|
setVariableValue(viewEntity, dynamicFields, label);
|
|
@@ -353,7 +356,7 @@ const functions = {
|
|
|
353
356
|
}
|
|
354
357
|
}
|
|
355
358
|
const listCodesMap = pageContext.listCodesMap;
|
|
356
|
-
for (
|
|
359
|
+
for (const listCode in listCodesMap) {
|
|
357
360
|
let tableUuid;
|
|
358
361
|
if (listCode.indexOf("__") > 0) {
|
|
359
362
|
tableUuid = listCode.substring(listCode.lastIndexOf("__") + "__".length);
|
|
@@ -363,7 +366,7 @@ const functions = {
|
|
|
363
366
|
if (componentRef) {
|
|
364
367
|
const componentConfigure = componentRef.getConfigure();
|
|
365
368
|
const prop = componentConfigure.code ? componentConfigure.code : listCode;
|
|
366
|
-
|
|
369
|
+
const dynamicFields = getModelFields(componentConfigure, prop);
|
|
367
370
|
const gridData = getVariableValue(viewEntity, dynamicFields);
|
|
368
371
|
const subTableOptions = componentRef.getTableSelectOptions(listCode);
|
|
369
372
|
packageSubTableShowLable(subTableOptions, gridData);
|
|
@@ -420,7 +423,7 @@ function getSingleSelectShowLable(propValue, propSelectOptions) {
|
|
|
420
423
|
for (let i = 0; i < propSelectOptions.length; i++) {
|
|
421
424
|
const optValue = propSelectOptions[i].value;
|
|
422
425
|
const optLabel = propSelectOptions[i].label ? propSelectOptions[i].label : propSelectOptions[i].name;
|
|
423
|
-
if (propValue + "" === optValue + "" &&
|
|
426
|
+
if (propValue + "" === optValue + "" && optLabel !== void 0 && optLabel !== null) {
|
|
424
427
|
showLabel = optLabel;
|
|
425
428
|
break;
|
|
426
429
|
}
|
|
@@ -210,7 +210,6 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
|
|
|
210
210
|
sortDatas(pageContext, configure, datas);
|
|
211
211
|
datas = limitDatas(pageContext, configure, datas, groupFields, limitValueFields);
|
|
212
212
|
const xValues = [];
|
|
213
|
-
console.log("accumulateFields", accumulateFields);
|
|
214
213
|
const cumulativeMap = {};
|
|
215
214
|
for (const data of datas) {
|
|
216
215
|
if (!data) {
|
|
@@ -67,6 +67,30 @@ export declare function limitDatas(pageContext: PageContext, configure: Componen
|
|
|
67
67
|
* @returns
|
|
68
68
|
*/
|
|
69
69
|
export declare function caculateFormulaValue(itemConfs: any, datas: any, accumulateFields: any): any;
|
|
70
|
+
/**
|
|
71
|
+
* 获取数据源中的最小值
|
|
72
|
+
* @param datas 数据源
|
|
73
|
+
* @param fieldName 字段名
|
|
74
|
+
*/
|
|
75
|
+
export declare function getMinValue(datas: any, fieldName: string): any;
|
|
76
|
+
/**
|
|
77
|
+
* 获取数据源中的最大值
|
|
78
|
+
* @param datas 数据源
|
|
79
|
+
* @param fieldName 字段名
|
|
80
|
+
*/
|
|
81
|
+
export declare function getMaxValue(datas: any, fieldName: string): any;
|
|
82
|
+
/**
|
|
83
|
+
* 获取数据源中的汇总值
|
|
84
|
+
* @param datas 数据源
|
|
85
|
+
* @param fieldName 字段名
|
|
86
|
+
*/
|
|
87
|
+
export declare function getSumValue(datas: any, fieldName: string): any;
|
|
88
|
+
/**
|
|
89
|
+
* 获取平均值
|
|
90
|
+
* @param datas 数据源
|
|
91
|
+
* @param fieldName 字段名
|
|
92
|
+
*/
|
|
93
|
+
export declare function getAvgValue(datas: any, fieldName: string): any;
|
|
70
94
|
/**
|
|
71
95
|
* 执行统计图的计算公式
|
|
72
96
|
* @param formulaStr 计算公式
|
|
@@ -14,7 +14,6 @@ const themeMap = {
|
|
|
14
14
|
theme3
|
|
15
15
|
};
|
|
16
16
|
function getCustomTheme(themeName) {
|
|
17
|
-
console.log("getdd", themeName);
|
|
18
17
|
return themeMap[themeName];
|
|
19
18
|
}
|
|
20
19
|
function getCustomThemeOptions() {
|
|
@@ -510,9 +509,13 @@ export {
|
|
|
510
509
|
clearChartSelected,
|
|
511
510
|
executeChartFormula,
|
|
512
511
|
exportCommonChart,
|
|
512
|
+
getAvgValue,
|
|
513
513
|
getCustomTheme,
|
|
514
514
|
getCustomThemeOptions,
|
|
515
|
+
getMaxValue,
|
|
516
|
+
getMinValue,
|
|
515
517
|
getNumFormatter,
|
|
518
|
+
getSumValue,
|
|
516
519
|
initChartOption,
|
|
517
520
|
limitDatas,
|
|
518
521
|
monitorChartClickToVariable,
|
|
@@ -133,11 +133,8 @@ function isNumber(numStr) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
function isWorkflowPage(pageContext) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
|
|
139
|
-
isWorkflow = pageContext.workflowCode ? true : false;
|
|
140
|
-
}
|
|
136
|
+
const isWorkflow = pageContext.isWorkflowEntity ? true : pageContext.workflowCode ? true : false;
|
|
137
|
+
console.log("isWorkflowPage----isWorkflow=", isWorkflow, "pageContext.isWorkflowEntity=", pageContext.isWorkflowEntity, "pageContext.workflowCode=", pageContext.workflowCode);
|
|
141
138
|
return isWorkflow;
|
|
142
139
|
}
|
|
143
140
|
function refreshMobileDialogType(jumpPageSetting, isMobile) {
|
|
@@ -25,6 +25,7 @@ export declare function appendDefaultMethods(func: any, pageContext: PageContext
|
|
|
25
25
|
export declare function removeCustomFuncFromWindow(pageDesign: PageDesign): void;
|
|
26
26
|
export declare function handleEvent($event: any, pageContext: PageContext, configure: Component, eventType: string, otherParams?: object): any;
|
|
27
27
|
export declare function handleFormEvent($event: any, pageContext: PageContext, configure: Component, eventType: string, otherParams?: object): any;
|
|
28
|
+
export declare function handleAfterInitEvent($event: any, pageContext: PageContext, configure: Component, otherParams?: object): any;
|
|
28
29
|
export declare function getHandleEvent($event: any, pageContext: PageContext, configure: Component, eventType: string, otherParams?: object): any;
|
|
29
30
|
export declare function getTableUuid(pageContext: PageContext, configure: Component): any;
|
|
30
31
|
export declare function handleEventByEventName(pageContext: PageContext, configure: Component, eventName: string, otherParams?: object): any;
|
|
@@ -109,6 +109,9 @@ function handleFormEvent($event, pageContext, configure, eventType, otherParams)
|
|
|
109
109
|
}
|
|
110
110
|
return handleEventUtil($event, pageContext, configure, eventType, true, otherParams, true);
|
|
111
111
|
}
|
|
112
|
+
function handleAfterInitEvent($event, pageContext, configure, otherParams) {
|
|
113
|
+
return handleFormEvent($event, pageContext, configure, "afterInit", otherParams);
|
|
114
|
+
}
|
|
112
115
|
function getHandleEvent($event, pageContext, configure, eventType, otherParams) {
|
|
113
116
|
return handleEventUtil($event, pageContext, configure, eventType, false, otherParams, false);
|
|
114
117
|
}
|
|
@@ -121,8 +124,8 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
|
|
|
121
124
|
const tableUuid = getTableUuid(pageContext, configure);
|
|
122
125
|
if (tableUuid) {
|
|
123
126
|
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
124
|
-
const selections = gridRef.getSelections();
|
|
125
|
-
const selectionIds = gridRef.getSelectionIds();
|
|
127
|
+
const selections = gridRef ? gridRef.getSelections() : null;
|
|
128
|
+
const selectionIds = gridRef ? gridRef.getSelectionIds() : null;
|
|
126
129
|
if (!otherParams) {
|
|
127
130
|
otherParams = {};
|
|
128
131
|
}
|
|
@@ -134,7 +137,7 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
|
|
|
134
137
|
otherParams["id"] = selectionIds && selectionIds.length > 0 ? selectionIds[0] : null;
|
|
135
138
|
otherParams["ids"] = selectionIds;
|
|
136
139
|
}
|
|
137
|
-
const tableConfigure = gridRef.getTableConfigure();
|
|
140
|
+
const tableConfigure = gridRef ? gridRef.getTableConfigure() : null;
|
|
138
141
|
otherParams["tableConfigure"] = tableConfigure;
|
|
139
142
|
}
|
|
140
143
|
const eventParams = packageEventParams(pageContext, configure, $event, otherParams);
|
|
@@ -712,6 +715,7 @@ export {
|
|
|
712
715
|
gridSelectAllRecords,
|
|
713
716
|
gridSelectRecord,
|
|
714
717
|
gridSelectionChange,
|
|
718
|
+
handleAfterInitEvent,
|
|
715
719
|
handleChartEvent,
|
|
716
720
|
handleEvent,
|
|
717
721
|
handleFormEvent,
|
|
@@ -57,7 +57,7 @@ export declare function getSaveFormRequest(pageContext: PageContext, configureOb
|
|
|
57
57
|
*/
|
|
58
58
|
export declare function dealAfterOperate(pageContext: any, configureObj: any, data: any, successTip: any, isListButton?: boolean): void;
|
|
59
59
|
export declare function updateValuesWhenCloseDialog(parentPageContext: any, parentConfigureObj: any, sourceModel: any, sourceTableName: any): void;
|
|
60
|
-
export declare function refreshFormOrListPage(pageContext: any, configureObj: any): void;
|
|
60
|
+
export declare function refreshFormOrListPage(pageContext: any, configureObj: any, isRefreshWhenClosePopup: any): void;
|
|
61
61
|
export declare function doImportFinally(params: any, fileObj: any): void;
|
|
62
62
|
export declare function judgeDataNumber(buttonConfigureObj: any, ids: any): boolean;
|
|
63
63
|
export declare function dealCompleteTaskParam(commonEntity: any, isInit: any, pageContext: any, params?: any, operationResult?: any): boolean;
|
|
@@ -9,7 +9,7 @@ import axios from "axios";
|
|
|
9
9
|
import { getTableUuid, handleEvent, doAfterClickEvent } from "./event-util.js";
|
|
10
10
|
import { setStoreInfo } from "../store-util.js";
|
|
11
11
|
import { getPermissionCodes, getDefaultValue, getModelFields } from "../page-init-util.js";
|
|
12
|
-
import { updateChartDatasources, getVariableValue, setVariableValue } from "../page-helper-util.js";
|
|
12
|
+
import { updateChartDatasources, caculateShowCondition, getVariableValue, setVariableValue } from "../page-helper-util.js";
|
|
13
13
|
import printLabelUtil from "./print-label.js";
|
|
14
14
|
import { getTableNameByTableUuid } from "../table-utils.js";
|
|
15
15
|
import { packageCustomRules, getWorkflowRules } from "./validator-util.js";
|
|
@@ -743,9 +743,14 @@ function dealAfterWithList(pageContext, configureObj, row, successTip) {
|
|
|
743
743
|
});
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
function refreshFormOrListPage(pageContext, configureObj) {
|
|
747
|
-
let successOperation = configureObj.props.base.successOperation;
|
|
748
|
-
console.log(
|
|
746
|
+
function refreshFormOrListPage(pageContext, configureObj, isRefreshWhenClosePopup) {
|
|
747
|
+
let successOperation = isRefreshWhenClosePopup ? "refresh" : configureObj.props.base.successOperation;
|
|
748
|
+
console.log(
|
|
749
|
+
"refreshFormOrListPage22=====successOperation=",
|
|
750
|
+
successOperation,
|
|
751
|
+
"isRefreshWhenClosePopup=",
|
|
752
|
+
isRefreshWhenClosePopup
|
|
753
|
+
);
|
|
749
754
|
const buttonForPageType = getPageType(pageContext, configureObj);
|
|
750
755
|
console.log("refreshFormOrListPage22=====buttonForPageType=", buttonForPageType);
|
|
751
756
|
if (buttonForPageType && buttonForPageType === "list" && !successOperation) {
|
|
@@ -948,8 +953,8 @@ function downloadTemplateFunc(params) {
|
|
|
948
953
|
let templateUUID;
|
|
949
954
|
let templateShowPath;
|
|
950
955
|
if (templateFilesResult && templateFilesResult.length > 0) {
|
|
951
|
-
templateUUID = templateFilesResult[0].
|
|
952
|
-
templateShowPath = templateFilesResult[0].
|
|
956
|
+
templateUUID = templateFilesResult[0].templateUuid;
|
|
957
|
+
templateShowPath = templateFilesResult[0].templateName;
|
|
953
958
|
}
|
|
954
959
|
const systemCode = pageContext.systemCode;
|
|
955
960
|
const backendUrl = pageContext.backendUrl;
|
|
@@ -1255,7 +1260,7 @@ function getWorkflowSaveParams(params) {
|
|
|
1255
1260
|
param["isWorkflowEntity"] = true;
|
|
1256
1261
|
return param;
|
|
1257
1262
|
}
|
|
1258
|
-
function workflowSaveFunc(params) {
|
|
1263
|
+
async function workflowSaveFunc(params) {
|
|
1259
1264
|
return new Promise((resolve, reject) => {
|
|
1260
1265
|
const pageContext = params.pageContext;
|
|
1261
1266
|
const dataModel = pageContext.entity.data;
|
|
@@ -1385,44 +1390,103 @@ function submitProcessFunc(params) {
|
|
|
1385
1390
|
}
|
|
1386
1391
|
});
|
|
1387
1392
|
}
|
|
1388
|
-
function completeTaskFunc(params, operationResult) {
|
|
1393
|
+
async function completeTaskFunc(params, operationResult) {
|
|
1394
|
+
let validateOpinionResult = await validateOpinion(params);
|
|
1389
1395
|
return new Promise((resolve, reject) => {
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1396
|
+
var _a;
|
|
1397
|
+
if (validateOpinionResult) {
|
|
1398
|
+
const pageContext = params.pageContext;
|
|
1399
|
+
const systemCode = pageContext.systemCode;
|
|
1400
|
+
const backendUrl = pageContext.backendUrl;
|
|
1401
|
+
const opinion = validateOpinionResult === true ? (_a = pageContext.completeTaskParam) == null ? void 0 : _a.opinion : validateOpinionResult;
|
|
1402
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/complete-tasks";
|
|
1403
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1404
|
+
if (!path) {
|
|
1405
|
+
ElMessage({
|
|
1406
|
+
showClose: true,
|
|
1407
|
+
type: "warning",
|
|
1408
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1409
|
+
});
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
const param = getWorkflowSaveParams(params);
|
|
1413
|
+
param["completeTaskParam"] = {
|
|
1414
|
+
operationResult,
|
|
1415
|
+
taskId: pageContext.completeTaskParam ? pageContext.completeTaskParam.taskId : null,
|
|
1416
|
+
opinion: opinion ? opinion : null
|
|
1417
|
+
};
|
|
1418
|
+
const request = http.post(path, param);
|
|
1419
|
+
request.then((commonEntity) => {
|
|
1420
|
+
let result = true;
|
|
1421
|
+
if (commonEntity) {
|
|
1422
|
+
result = dealCompleteTaskParam(
|
|
1423
|
+
commonEntity,
|
|
1424
|
+
false,
|
|
1425
|
+
pageContext,
|
|
1426
|
+
params,
|
|
1427
|
+
operationResult
|
|
1428
|
+
);
|
|
1429
|
+
}
|
|
1430
|
+
if (result === true) {
|
|
1431
|
+
ElMessage({
|
|
1432
|
+
showClose: true,
|
|
1433
|
+
type: "success",
|
|
1434
|
+
message: getI18n().t("superPageRuntimeMessage.successfulCompleteTask")
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
resolve(true);
|
|
1438
|
+
}).catch((error) => {
|
|
1439
|
+
reject(error);
|
|
1400
1440
|
});
|
|
1401
|
-
|
|
1441
|
+
} else {
|
|
1442
|
+
resolve(true);
|
|
1402
1443
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
result = dealCompleteTaskParam(commonEntity, false, pageContext, params, operationResult);
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
function validateOpinion(params) {
|
|
1447
|
+
return new Promise((resolve, reject) => {
|
|
1448
|
+
var _a, _b, _c, _d;
|
|
1449
|
+
const configureObj = params.configureObj;
|
|
1450
|
+
if (configureObj) {
|
|
1451
|
+
let isOpinionRequired = false;
|
|
1452
|
+
if ((_b = (_a = configureObj.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isMustOpinion) {
|
|
1453
|
+
isOpinionRequired = true;
|
|
1414
1454
|
}
|
|
1415
|
-
if (
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1455
|
+
if (isOpinionRequired === true) {
|
|
1456
|
+
const pageContext = params.pageContext;
|
|
1457
|
+
const mustOpinionConditions = (_d = (_c = configureObj.props) == null ? void 0 : _c.base) == null ? void 0 : _d.mustOpinionConditions;
|
|
1458
|
+
isOpinionRequired = caculateShowCondition(pageContext, configureObj, mustOpinionConditions);
|
|
1459
|
+
}
|
|
1460
|
+
if (isOpinionRequired === true) {
|
|
1461
|
+
ElMessageBox.prompt(
|
|
1462
|
+
getI18n().t("superPageRuntimeMessage.pleaseInputOpinion"),
|
|
1463
|
+
getI18n().t("superPageRuntimeMessage.opinion"),
|
|
1464
|
+
{
|
|
1465
|
+
confirmButtonText: getI18n().t("superPageRuntimeMessage.sure"),
|
|
1466
|
+
cancelButtonText: getI18n().t("superPageRuntimeMessage.cancel"),
|
|
1467
|
+
// 输入框类型
|
|
1468
|
+
inputType: "textarea",
|
|
1469
|
+
inputValue: null,
|
|
1470
|
+
closeOnClickModal: false,
|
|
1471
|
+
inputValidator: (value) => {
|
|
1472
|
+
if (value && value.trim()) {
|
|
1473
|
+
return true;
|
|
1474
|
+
} else {
|
|
1475
|
+
return getI18n().t("superPageRuntimeMessage.pleaseInputOpinion");
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
).then(({ value }) => {
|
|
1480
|
+
resolve(value);
|
|
1481
|
+
}).catch(() => {
|
|
1482
|
+
resolve(false);
|
|
1420
1483
|
});
|
|
1484
|
+
} else {
|
|
1485
|
+
resolve(true);
|
|
1421
1486
|
}
|
|
1487
|
+
} else {
|
|
1422
1488
|
resolve(true);
|
|
1423
|
-
}
|
|
1424
|
-
reject(error);
|
|
1425
|
-
});
|
|
1489
|
+
}
|
|
1426
1490
|
});
|
|
1427
1491
|
}
|
|
1428
1492
|
function assignTask(params) {
|
|
@@ -14,6 +14,6 @@ export declare function i18nValidateRulesMessage(rules: any): {};
|
|
|
14
14
|
export declare function i18nValidatePropRulesMessage(propRules: any, isResetMessage: boolean): void;
|
|
15
15
|
export declare function getWorkflowRules(pageContext: any): any;
|
|
16
16
|
export declare function updateFormItemEditState(pageContext: PageContext, customRules: any[]): void;
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function disabledAllFields(pageContext: PageContext): void;
|
|
18
18
|
export declare function dynamicControlTableEdit(pageContext: PageContext, customRules: any[]): void;
|
|
19
19
|
export declare function updateComponentDisplayState(ref: any, item: any): void;
|
|
@@ -4,6 +4,7 @@ import { getComponentRef, getComponentRefByCode, getAllComponentRefs } from "../
|
|
|
4
4
|
import { getI18n } from "agilebuilder-ui/src/utils/util";
|
|
5
5
|
import { getAdditionalParamMap } from "./standard-event.js";
|
|
6
6
|
import { isPromise } from "agilebuilder-ui/src/utils/common-util";
|
|
7
|
+
import { isWorkflowPage } from "../common-util.js";
|
|
7
8
|
function setObjectPropRule(prop, rules, leafRule) {
|
|
8
9
|
const rule = {};
|
|
9
10
|
if (!rules) {
|
|
@@ -181,7 +182,7 @@ function validateDataModelFunc(pageContext, configureObj, isEnableRequired) {
|
|
|
181
182
|
}
|
|
182
183
|
function validateDataModel(isEnableRequired, dataModel, rules, pageContext) {
|
|
183
184
|
if (isEnableRequired) {
|
|
184
|
-
const isWorkflow = pageContext
|
|
185
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
185
186
|
if (isWorkflow) {
|
|
186
187
|
return validateWorkflowFormDataModel(dataModel, pageContext, rules);
|
|
187
188
|
} else {
|
|
@@ -506,7 +507,7 @@ function updateFormItemEditState(pageContext, customRules) {
|
|
|
506
507
|
updateComponentDisplayState(ref, item);
|
|
507
508
|
});
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
+
function disabledAllFields(pageContext) {
|
|
510
511
|
getAllComponentRefs(pageContext).forEach((ref) => {
|
|
511
512
|
updateComponentDisplayState(ref, { disabled: true });
|
|
512
513
|
});
|
|
@@ -529,7 +530,7 @@ function updateComponentDisplayState(ref, item) {
|
|
|
529
530
|
}
|
|
530
531
|
}
|
|
531
532
|
export {
|
|
532
|
-
|
|
533
|
+
disabledAllFields,
|
|
533
534
|
getWorkflowRules,
|
|
534
535
|
i18nValidatePropRulesMessage,
|
|
535
536
|
i18nValidateRulesMessage,
|
|
@@ -487,7 +487,6 @@ function getValueFromSource(valueSource, paramName, paramType) {
|
|
|
487
487
|
return getValueFromSource(childValue, newParamName, paramType);
|
|
488
488
|
} else {
|
|
489
489
|
if (paramType == "context") {
|
|
490
|
-
console.log("newDate", paramName);
|
|
491
490
|
if (paramName == "currentDate" || paramName == "currentTime") {
|
|
492
491
|
return /* @__PURE__ */ new Date();
|
|
493
492
|
} else if (paramName.startsWith("currentDate") && paramName.length > 11) {
|
|
@@ -4,7 +4,7 @@ import { PageDimensions } from "./interfaces/page-design-types.js";
|
|
|
4
4
|
import { setVariableValue, formatVariableValue, getFormPropName } from "./page-helper-util.js";
|
|
5
5
|
import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
|
|
6
6
|
import { functions } from "./api/page-expose-util.js";
|
|
7
|
-
import { deepCopy } from "./common-util.js";
|
|
7
|
+
import { isWorkflowPage, deepCopy } from "./common-util.js";
|
|
8
8
|
function queryPageDesignByCode(pageCode) {
|
|
9
9
|
return http.get(
|
|
10
10
|
window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + pageCode
|
|
@@ -49,6 +49,10 @@ function convertToPageContext(pageDesign, pageRequest) {
|
|
|
49
49
|
refercePropMap: (_a = pageDesign.runtime) == null ? void 0 : _a.refercePropMap,
|
|
50
50
|
//当前表单页面中引用字段信息集合,get请求时需要使用,格式为{tableName:[字段名,.. ... ], tableName:[字段名,.. ... ]}
|
|
51
51
|
subTableWatchProps: pageDesign.subTableWatchProps,
|
|
52
|
+
dataTypeMaps: pageDesign.dataTypeMaps,
|
|
53
|
+
// 列表页面时后台会传该属性到前端
|
|
54
|
+
isWorkflowEntity: pageDesign.isWorkflowEntity,
|
|
55
|
+
// 列表页面时后台会传该属性到前端。列表删除时会用到该属性。
|
|
52
56
|
entity: {
|
|
53
57
|
data: {},
|
|
54
58
|
task: {},
|
|
@@ -279,17 +283,15 @@ function queryPageSuperGrids(pageDesign, pageContext, publishVersion) {
|
|
|
279
283
|
tableRuntimes,
|
|
280
284
|
additionalParamMapJson,
|
|
281
285
|
pageCode,
|
|
282
|
-
publishVersion
|
|
286
|
+
publishVersion,
|
|
287
|
+
pageType: pageDesign.pageType
|
|
283
288
|
}
|
|
284
289
|
);
|
|
285
290
|
}
|
|
286
291
|
function packageFormRules(pageContext, configure) {
|
|
287
|
-
var _a, _b
|
|
292
|
+
var _a, _b;
|
|
288
293
|
const prop = configure.props && configure.props.base ? configure.props.base.prop : null;
|
|
289
|
-
let isWorkflow =
|
|
290
|
-
if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
|
|
291
|
-
isWorkflow = pageContext.workflowCode ? true : false;
|
|
292
|
-
}
|
|
294
|
+
let isWorkflow = isWorkflowPage(pageContext);
|
|
293
295
|
let allFieldsDisabled = false;
|
|
294
296
|
if (isWorkflow) {
|
|
295
297
|
console.log(
|
|
@@ -300,7 +302,7 @@ function packageFormRules(pageContext, configure) {
|
|
|
300
302
|
);
|
|
301
303
|
if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
|
|
302
304
|
const allFields = pageContext.fieldPermissionMap.get("all_fields");
|
|
303
|
-
if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((
|
|
305
|
+
if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_a = configure.runtime) == null ? void 0 : _a.props)) {
|
|
304
306
|
configure.runtime.props.state = "disabled";
|
|
305
307
|
allFieldsDisabled = true;
|
|
306
308
|
}
|
|
@@ -340,7 +342,7 @@ function packageFormRules(pageContext, configure) {
|
|
|
340
342
|
configure.runtime.props.state = "";
|
|
341
343
|
}
|
|
342
344
|
}
|
|
343
|
-
if ((
|
|
345
|
+
if ((_b = configure.props) == null ? void 0 : _b.customRuleEvents) {
|
|
344
346
|
if (!pageContext.customRuleEvents) {
|
|
345
347
|
pageContext.customRuleEvents = [];
|
|
346
348
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function getDataTypeMapRequest(backendUrl: any, tableName: any, isTest?: boolean): any;
|
|
2
2
|
export declare function popupToPage(params: any): void;
|
|
3
3
|
export declare function getTableNameByTableUuid(pageContext: any, tableUuid: any): any;
|
|
4
|
+
export declare function getOperationButtons(pageContext: any, configure: any, operations: any, clickEventFunc?: Function): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import "agilebuilder-ui/src/utils/common-util";
|
|
2
|
+
import "agilebuilder-ui/src/utils/util";
|
|
3
|
+
import "agilebuilder-ui/src/utils/request";
|
|
3
4
|
import eventBus from "./eventBus.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return http.get(baseUrl + "/dsc/commons/tables/" + tableName + "/data-types");
|
|
7
|
-
}
|
|
5
|
+
import { getPermissionCodes } from "./page-init-util.js";
|
|
6
|
+
import { getEventFuncByType } from "./events/event-util.js";
|
|
8
7
|
function popupToPage(params) {
|
|
9
8
|
const pageCode = params.pageContext && params.pageContext.code;
|
|
10
9
|
console.log("弹框显示页面--popupToPage====params=", params);
|
|
@@ -21,8 +20,41 @@ function getTableNameByTableUuid(pageContext, tableUuid) {
|
|
|
21
20
|
}
|
|
22
21
|
return tableConfigure && tableConfigure.props && tableConfigure.props.dataOrigin ? tableConfigure.props.dataOrigin.tableName : null;
|
|
23
22
|
}
|
|
23
|
+
function getOperationButtons(pageContext, configure, operations, clickEventFunc) {
|
|
24
|
+
const showOperation = configure.props && configure.props.base ? configure.props.base.showOperation : false;
|
|
25
|
+
const operationButtonSettings = configure.btnList;
|
|
26
|
+
console.log("configure.btnList===", configure.btnList, "configure====", configure);
|
|
27
|
+
if (showOperation && operationButtonSettings) {
|
|
28
|
+
operationButtonSettings.forEach((buttonConfigure) => {
|
|
29
|
+
const myButtonSet = {};
|
|
30
|
+
const myButtonProps = Object.assign({}, buttonConfigure.props.base);
|
|
31
|
+
if (buttonConfigure.name === "custom") {
|
|
32
|
+
myButtonProps.customControl = myButtonProps.name;
|
|
33
|
+
} else {
|
|
34
|
+
myButtonProps.elementType = "el-button";
|
|
35
|
+
}
|
|
36
|
+
if (buttonConfigure.isPermission === void 0 || buttonConfigure.isPermission + "" === "true") {
|
|
37
|
+
const functionCodes = getPermissionCodes(buttonConfigure, pageContext);
|
|
38
|
+
if (functionCodes) {
|
|
39
|
+
myButtonProps.permission = functionCodes;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
myButtonProps.label = myButtonProps.title;
|
|
43
|
+
myButtonProps.sourceButton = { uuid: buttonConfigure.uuid };
|
|
44
|
+
myButtonSet["props"] = myButtonProps;
|
|
45
|
+
debugger;
|
|
46
|
+
if (clickEventFunc !== void 0) {
|
|
47
|
+
myButtonSet["onClick"] = clickEventFunc(buttonConfigure);
|
|
48
|
+
} else {
|
|
49
|
+
const eventFunc = getEventFuncByType(pageContext, buttonConfigure.events, "click");
|
|
50
|
+
myButtonSet["onClick"] = eventFunc;
|
|
51
|
+
}
|
|
52
|
+
operations.push(myButtonSet);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
24
56
|
export {
|
|
25
|
-
|
|
57
|
+
getOperationButtons,
|
|
26
58
|
getTableNameByTableUuid,
|
|
27
59
|
popupToPage
|
|
28
60
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, createVNode, normalizeClass, unref, normalizeStyle, withCtx, Fragment, createTextVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
|
|
1
|
+
import { defineComponent, ref, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, createVNode, normalizeClass, unref, normalizeStyle, withCtx, Fragment, createTextVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
|
|
2
2
|
import { SuperIcon } from "agilebuilder-ui";
|
|
3
|
-
import { handleEvent } from "../../../../utils/events/event-util.js";
|
|
3
|
+
import { handleAfterInitEvent, handleEvent } from "../../../../utils/events/event-util.js";
|
|
4
4
|
import { $t } from "../../../../utils/i18n-util.js";
|
|
5
5
|
const _hoisted_1 = { class: "page-runtime-header-btn" };
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -21,13 +21,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
function isButtongLoading() {
|
|
22
22
|
return props.pageContext.canClick !== void 0 && props.pageContext.clickUuid !== void 0 ? !props.pageContext.canClick && props.pageContext.clickUuid === props.configure.uuid : false;
|
|
23
23
|
}
|
|
24
|
+
const componentRef = ref(null);
|
|
24
25
|
onMounted(() => {
|
|
25
|
-
|
|
26
|
+
nextTick(() => {
|
|
27
|
+
handleAfterInitEvent(null, props.pageContext, props.configure, {
|
|
28
|
+
componentRef: componentRef.value,
|
|
29
|
+
entity: props.pageContext.entity.data,
|
|
30
|
+
pageData: props.pageContext.entity.page
|
|
31
|
+
});
|
|
32
|
+
});
|
|
26
33
|
});
|
|
27
34
|
return (_ctx, _cache) => {
|
|
28
35
|
const _component_el_button = resolveComponent("el-button");
|
|
29
36
|
return openBlock(), createElementBlock("span", _hoisted_1, [
|
|
30
37
|
createVNode(_component_el_button, {
|
|
38
|
+
ref_key: "componentRef",
|
|
39
|
+
ref: componentRef,
|
|
31
40
|
disabled: isDisable(),
|
|
32
41
|
class: normalizeClass(unref(runtimeClass)),
|
|
33
42
|
style: normalizeStyle(unref(runtimeStyle)),
|