super-page-runtime 2.1.72 → 2.1.73
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 +10 -1
- package/dist/es/components/runtime/utils/events/event-util.js +31 -2
- package/dist/es/components/runtime/utils/events/validator-util.d.ts +5 -0
- package/dist/es/components/runtime/utils/events/validator-util.js +20 -0
- package/dist/es/components/runtime/utils/page-helper-util.d.ts +1 -1
- package/dist/es/components/runtime/utils/page-helper-util.js +15 -15
- package/dist/es/components/runtime/utils/page-init-util.js +4 -0
- package/dist/es/components/runtime/utils/table-utils.d.ts +12 -0
- package/dist/es/components/runtime/utils/table-utils.js +36 -1
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +79 -0
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +11 -31
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +18 -9
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +7 -2
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +34 -8
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +7 -1
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +46 -5
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +39 -24
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +2 -2
- package/dist/es/components/runtime/views/super-page.vue.js +14 -11
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { setValueForVariableName, getOptionDatasSourceMap, getComponentOptionDat
|
|
|
2
2
|
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
|
-
import { getAdditionalParamMap, refreshPage } from "../events/standard-event.js";
|
|
5
|
+
import { getAdditionalParamMap, refreshPage, getFormData } from "../events/standard-event.js";
|
|
6
6
|
import { updateFormItemEditState, disabledAllFields, dynamicControlTableEdit } 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";
|
|
@@ -376,6 +376,15 @@ const functions = {
|
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return viewEntity.data;
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* 重新走gets请求获得表单数据
|
|
382
|
+
* @param pageContext
|
|
383
|
+
* @param id
|
|
384
|
+
* @returns commonEntity数据
|
|
385
|
+
*/
|
|
386
|
+
getFormData(pageContext, id) {
|
|
387
|
+
return getFormData(pageContext, id);
|
|
379
388
|
}
|
|
380
389
|
};
|
|
381
390
|
function packageSubTableShowLable(subTableOptions, subData) {
|
|
@@ -4,9 +4,10 @@ import { validateDataModelFunc } from "./validator-util.js";
|
|
|
4
4
|
import { getComponentRef, getComponentRefByCode } from "../global-refs.js";
|
|
5
5
|
import { ElMessage } from "element-plus";
|
|
6
6
|
import { analysisCondition } from "agilebuilder-ui/src/utils/util";
|
|
7
|
-
import { getListCode } from "../common-util.js";
|
|
7
|
+
import { getListCode, deepCopy } from "../common-util.js";
|
|
8
8
|
import eventBus from "../eventBus.js";
|
|
9
9
|
import { getValueFromSource } from "../page-helper-util.js";
|
|
10
|
+
import { expressJump } from "../table-utils.js";
|
|
10
11
|
const skipValidateEvents = [
|
|
11
12
|
"downloadTemplate",
|
|
12
13
|
"back",
|
|
@@ -378,13 +379,41 @@ function doAfterClickFunc(pageContext, configure, eventParams, isStandardEvent,
|
|
|
378
379
|
}
|
|
379
380
|
function doClickEvent(pageContext, configure, clickEventFunObj, eventParams) {
|
|
380
381
|
const linkPage = configure.props.linkPage;
|
|
381
|
-
if (linkPage && linkPage
|
|
382
|
+
if (linkPage && linkPage instanceof Array) {
|
|
383
|
+
pageContext.canClick = true;
|
|
384
|
+
const row = getRowData(eventParams);
|
|
385
|
+
const result = expressJump(pageContext, configure, linkPage, row);
|
|
386
|
+
let show = false;
|
|
387
|
+
let toLinkPage;
|
|
388
|
+
if (result) {
|
|
389
|
+
show = result.show;
|
|
390
|
+
toLinkPage = result.toPage;
|
|
391
|
+
}
|
|
392
|
+
if (show && toLinkPage) {
|
|
393
|
+
let configureObj = deepCopy(configure);
|
|
394
|
+
configureObj.props.linkPage = toLinkPage.linkPage;
|
|
395
|
+
doClickJumpPageEvent(pageContext, configureObj, eventParams);
|
|
396
|
+
} else {
|
|
397
|
+
ElMessage({
|
|
398
|
+
showClose: true,
|
|
399
|
+
type: "warning",
|
|
400
|
+
message: "没有符合条件的跳转页面"
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
} else if (linkPage && linkPage.jumpPageUrl) {
|
|
382
404
|
pageContext.canClick = true;
|
|
383
405
|
doClickJumpPageEvent(pageContext, configure, eventParams);
|
|
384
406
|
} else {
|
|
385
407
|
doClickCustomEvent(pageContext, configure, clickEventFunObj, eventParams);
|
|
386
408
|
}
|
|
387
409
|
}
|
|
410
|
+
function getRowData(eventParams) {
|
|
411
|
+
let row = eventParams ? eventParams.row : null;
|
|
412
|
+
if (!row) {
|
|
413
|
+
row = eventParams && eventParams.selections && eventParams.selections.length > 0 ? eventParams.selections[0] : null;
|
|
414
|
+
}
|
|
415
|
+
return row;
|
|
416
|
+
}
|
|
388
417
|
function getEventByEventName(pageContext, eventObj) {
|
|
389
418
|
const eventsObj = pageContext.customEvents;
|
|
390
419
|
if (eventsObj && eventObj) {
|
|
@@ -17,3 +17,8 @@ export declare function updateFormItemEditState(pageContext: PageContext, custom
|
|
|
17
17
|
export declare function disabledAllFields(pageContext: PageContext): void;
|
|
18
18
|
export declare function dynamicControlTableEdit(pageContext: PageContext, customRules: any[], tableCode?: any): void;
|
|
19
19
|
export declare function updateComponentDisplayState(ref: any, item: any): void;
|
|
20
|
+
/**
|
|
21
|
+
* 布尔型校验需要自定义,为了兼容oracle和mysql数据库
|
|
22
|
+
* @param fieldRule
|
|
23
|
+
*/
|
|
24
|
+
export declare function packageBooleanRule(fieldRule: any): void;
|
|
@@ -346,6 +346,7 @@ function packageCustomRules(orgCustomRules, orgRules) {
|
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
348
|
} else {
|
|
349
|
+
packageBooleanRule(customRules[key]);
|
|
349
350
|
orgRules[key] = customRules[key];
|
|
350
351
|
}
|
|
351
352
|
});
|
|
@@ -547,12 +548,31 @@ function updateComponentDisplayState(ref, item) {
|
|
|
547
548
|
}
|
|
548
549
|
}
|
|
549
550
|
}
|
|
551
|
+
function packageBooleanRule(fieldRule) {
|
|
552
|
+
if (fieldRule.type && fieldRule.type === "boolean") {
|
|
553
|
+
fieldRule.validator = function(rule, value, callback) {
|
|
554
|
+
if (value === void 0 || value === null) {
|
|
555
|
+
if (rule.required) {
|
|
556
|
+
return false;
|
|
557
|
+
} else {
|
|
558
|
+
return true;
|
|
559
|
+
}
|
|
560
|
+
} else if (typeof value === "number" && (value === 1 || value === 0)) {
|
|
561
|
+
return true;
|
|
562
|
+
} else if (typeof value === "boolean" && (value === true || value === false)) {
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
565
|
+
return false;
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
}
|
|
550
569
|
export {
|
|
551
570
|
disabledAllFields,
|
|
552
571
|
dynamicControlTableEdit,
|
|
553
572
|
getWorkflowRules,
|
|
554
573
|
i18nValidatePropRulesMessage,
|
|
555
574
|
i18nValidateRulesMessage,
|
|
575
|
+
packageBooleanRule,
|
|
556
576
|
packageCustomRules,
|
|
557
577
|
setObjectPropRule,
|
|
558
578
|
updateComponentDisplayState,
|
|
@@ -147,7 +147,7 @@ export declare function openLink(component: Component, pageContext: PageContext)
|
|
|
147
147
|
* @param configure 组件配置参数
|
|
148
148
|
* @param showConditions 显示条件
|
|
149
149
|
*/
|
|
150
|
-
export declare function caculateShowCondition(pageContext: PageContext,
|
|
150
|
+
export declare function caculateShowCondition(pageContext: PageContext, showConditions: Array<any>, row?: any): any;
|
|
151
151
|
/**
|
|
152
152
|
* 监控变化的字段
|
|
153
153
|
* @param pageContext
|
|
@@ -242,8 +242,8 @@ function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
|
|
|
242
242
|
});
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
function getOptionDatasFromPage(pageContext2,
|
|
246
|
-
return getComponentOptionDatasFromPage(pageContext2,
|
|
245
|
+
function getOptionDatasFromPage(pageContext2, configure) {
|
|
246
|
+
return getComponentOptionDatasFromPage(pageContext2, configure.uuid);
|
|
247
247
|
}
|
|
248
248
|
function getComponentOptionDatasFromPage(pageContext2, configureUuid) {
|
|
249
249
|
const optionSourceMap = getOptionDatasSourceMap(pageContext2);
|
|
@@ -257,11 +257,11 @@ function getOptionDatasSourceMap(pageContext2) {
|
|
|
257
257
|
const cacheOptions = pageContext2.optionSourceMap;
|
|
258
258
|
return cacheOptions ? cacheOptions : {};
|
|
259
259
|
}
|
|
260
|
-
function getChartDatasFromPage(pageContext2,
|
|
261
|
-
if (!pageContext2 || !pageContext2.chartDataSourceMap || !
|
|
260
|
+
function getChartDatasFromPage(pageContext2, configure) {
|
|
261
|
+
if (!pageContext2 || !pageContext2.chartDataSourceMap || !configure) {
|
|
262
262
|
return null;
|
|
263
263
|
}
|
|
264
|
-
const cacheDatas = pageContext2.chartDataSourceMap[
|
|
264
|
+
const cacheDatas = pageContext2.chartDataSourceMap[configure.uuid];
|
|
265
265
|
return cacheDatas;
|
|
266
266
|
}
|
|
267
267
|
function queryOptionDatasources(pageContext2, dataSourceConf, query) {
|
|
@@ -424,7 +424,7 @@ function formatValueByType(value, formatType, formatInfo) {
|
|
|
424
424
|
}
|
|
425
425
|
return value;
|
|
426
426
|
}
|
|
427
|
-
function getValueFromVariable(entity, variable,
|
|
427
|
+
function getValueFromVariable(entity, variable, row2) {
|
|
428
428
|
if (variable == null || variable == void 0) {
|
|
429
429
|
return variable;
|
|
430
430
|
}
|
|
@@ -460,7 +460,7 @@ function getValueFromVariable(entity, variable, row) {
|
|
|
460
460
|
return paramName.substring(6);
|
|
461
461
|
} else if (paramName.startsWith("row.")) {
|
|
462
462
|
paramName = paramName.substring(4);
|
|
463
|
-
valueSource =
|
|
463
|
+
valueSource = row2;
|
|
464
464
|
paramType = "row";
|
|
465
465
|
}
|
|
466
466
|
if (!paramName) {
|
|
@@ -513,7 +513,7 @@ function getValueFromSource(valueSource, paramName, paramType) {
|
|
|
513
513
|
return valueSource[paramName];
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
function caculateShowCondition(pageContext,
|
|
516
|
+
function caculateShowCondition(pageContext, showConditions, row) {
|
|
517
517
|
if (!showConditions || showConditions.length == 0 || !pageContext || !pageContext.entity) {
|
|
518
518
|
return true;
|
|
519
519
|
}
|
|
@@ -530,8 +530,8 @@ function caculateShowCondition(pageContext, configure, showConditions) {
|
|
|
530
530
|
if (!operator) {
|
|
531
531
|
operator = "EQ";
|
|
532
532
|
}
|
|
533
|
-
const leftValue = getValueFromVariable(entityData, propName);
|
|
534
|
-
let propValue = getValueFromVariable(entityData, condition.propValue);
|
|
533
|
+
const leftValue = getValueFromVariable(entityData, propName, row);
|
|
534
|
+
let propValue = getValueFromVariable(entityData, condition.propValue, row);
|
|
535
535
|
const dataType = condition.dataType;
|
|
536
536
|
if (operator == "CONTAIN" || operator == "NOT_CONTAIN") {
|
|
537
537
|
if (leftValue && !leftValue.includes) {
|
|
@@ -641,14 +641,14 @@ function getFormPropName(prop) {
|
|
|
641
641
|
return prop;
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
function getSizeConfig(pageContext2,
|
|
644
|
+
function getSizeConfig(pageContext2, configure) {
|
|
645
645
|
const pageModeType = getPageModeType(pageContext2);
|
|
646
646
|
let sizeConfig;
|
|
647
|
-
if (
|
|
648
|
-
sizeConfig =
|
|
647
|
+
if (configure.props && configure.props.size && configure.props.size[pageModeType]) {
|
|
648
|
+
sizeConfig = configure.props.size[pageModeType];
|
|
649
649
|
}
|
|
650
|
-
if (!sizeConfig &&
|
|
651
|
-
sizeConfig =
|
|
650
|
+
if (!sizeConfig && configure.props && configure.props.size) {
|
|
651
|
+
sizeConfig = configure.props.size["pc"];
|
|
652
652
|
}
|
|
653
653
|
return sizeConfig;
|
|
654
654
|
}
|
|
@@ -5,6 +5,7 @@ import { setVariableValue, formatVariableValue, getFormPropName } from "./page-h
|
|
|
5
5
|
import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
|
|
6
6
|
import { functions } from "./api/page-expose-util.js";
|
|
7
7
|
import { isWorkflowPage, deepCopy } from "./common-util.js";
|
|
8
|
+
import { packageBooleanRule } from "./events/validator-util.js";
|
|
8
9
|
function queryPageDesignByCode(pageCode) {
|
|
9
10
|
return http.get(
|
|
10
11
|
window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + pageCode
|
|
@@ -317,6 +318,9 @@ function packageFormRules(pageContext, configure) {
|
|
|
317
318
|
if (!pageContext.rules[propName]) {
|
|
318
319
|
pageContext.rules[propName] = [];
|
|
319
320
|
}
|
|
321
|
+
configure.props.rules.forEach((fieldRule) => {
|
|
322
|
+
packageBooleanRule(fieldRule);
|
|
323
|
+
});
|
|
320
324
|
pageContext.rules[propName] = configure.props.rules;
|
|
321
325
|
}
|
|
322
326
|
if (!allFieldsDisabled && configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
|
|
@@ -2,3 +2,15 @@ export declare function getDataTypeMapRequest(backendUrl: any, tableName: any, i
|
|
|
2
2
|
export declare function popupToPage(params: any): void;
|
|
3
3
|
export declare function getTableNameByTableUuid(pageContext: any, tableUuid: any): any;
|
|
4
4
|
export declare function getOperationButtons(pageContext: any, configure: any, operations: any, clickEventFunc?: Function): void;
|
|
5
|
+
/**
|
|
6
|
+
* 解析跳转条件配置
|
|
7
|
+
* @param pageContext
|
|
8
|
+
* @param configure
|
|
9
|
+
* @param linkPage
|
|
10
|
+
* @param row
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function expressJump(pageContext: any, configure: any, linkPage: any, row: any): {
|
|
14
|
+
show: any;
|
|
15
|
+
toPage: any;
|
|
16
|
+
};
|
|
@@ -3,8 +3,9 @@ import "agilebuilder-ui/src/utils/util";
|
|
|
3
3
|
import "agilebuilder-ui/src/utils/request";
|
|
4
4
|
import eventBus from "./eventBus.js";
|
|
5
5
|
import { getPermissionCodes } from "./page-init-util.js";
|
|
6
|
-
import { getEventFuncByType } from "./events/event-util.js";
|
|
6
|
+
import { getEventFuncByType, getCustomFunc } from "./events/event-util.js";
|
|
7
7
|
import { $t } from "./i18n-util.js";
|
|
8
|
+
import { ExpressionEvaluator } from "../views/assemblys/chart/table/chart-table-util.js";
|
|
8
9
|
function popupToPage(params) {
|
|
9
10
|
const pageCode = params.pageContext && params.pageContext.code;
|
|
10
11
|
console.log("弹框显示页面--popupToPage====params=", params);
|
|
@@ -53,7 +54,41 @@ function getOperationButtons(pageContext, configure, operations, clickEventFunc)
|
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
}
|
|
57
|
+
function expressJump(pageContext, configure, linkPage, row) {
|
|
58
|
+
let toPage;
|
|
59
|
+
const show = linkPage == null ? void 0 : linkPage.some((item) => {
|
|
60
|
+
let canShow = false;
|
|
61
|
+
if (item.scopeFunc) {
|
|
62
|
+
const func = getCustomFunc(pageContext, item.scopeFunc);
|
|
63
|
+
if (func) {
|
|
64
|
+
const result = func.apply(func, [
|
|
65
|
+
{
|
|
66
|
+
pageContext,
|
|
67
|
+
configureObj: configure,
|
|
68
|
+
row
|
|
69
|
+
}
|
|
70
|
+
]);
|
|
71
|
+
if (result) {
|
|
72
|
+
canShow = true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
} else if (item.showCondition && item.showCondition.length > 0) {
|
|
76
|
+
const result = ExpressionEvaluator.evaluate(pageContext, item.showCondition, row);
|
|
77
|
+
if (result) {
|
|
78
|
+
canShow = true;
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
canShow = true;
|
|
82
|
+
}
|
|
83
|
+
if (canShow) {
|
|
84
|
+
toPage = item;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return { show, toPage };
|
|
89
|
+
}
|
|
56
90
|
export {
|
|
91
|
+
expressJump,
|
|
57
92
|
getOperationButtons,
|
|
58
93
|
getTableNameByTableUuid,
|
|
59
94
|
popupToPage
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Component, PageContext } from '../../../../utils/interfaces/page-design-types';
|
|
2
|
+
|
|
3
|
+
type Condition = {
|
|
4
|
+
propValueType: string;
|
|
5
|
+
joinSign: string;
|
|
6
|
+
dataType: 'number' | 'date' | 'string';
|
|
7
|
+
rightBracket: string;
|
|
8
|
+
leftBracket: string;
|
|
9
|
+
propValue: string;
|
|
10
|
+
propName: string;
|
|
11
|
+
operator: 'GT' | 'LT' | 'GET' | 'LET' | 'NET' | 'CONTAIN' | 'NOT_CONTAIN' | 'IS_NULL' | 'IS_NOT_NULL';
|
|
12
|
+
};
|
|
13
|
+
type Data = Record<string, any>;
|
|
14
|
+
export declare class ExpressionEvaluator {
|
|
15
|
+
static evaluate(pageContext: PageContext, conditions: Condition[], data: Data): boolean;
|
|
16
|
+
private static createExpression;
|
|
17
|
+
private static getComparisonExpression;
|
|
18
|
+
private static changeDataType;
|
|
19
|
+
private static parseValue;
|
|
20
|
+
private static evaluateExpression;
|
|
21
|
+
}
|
|
22
|
+
export declare function getSummaryTitleColumn(configure: Component): any;
|
|
23
|
+
export declare function getSummaryDataColumn(configure: Component, type: string): any;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param summaryColumn configure.props.summaries.dataColumn中保存的对应属性的配置
|
|
27
|
+
* @param data 数组数据
|
|
28
|
+
* @param column el-table传递的column
|
|
29
|
+
* @param pageContext 页面上下文
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare function summaryStatistics(summaryColumn: any, data: any, prop: string, pageContext: PageContext): string;
|
|
33
|
+
export declare function replacePlaceholders(template: string, data: {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}): string;
|
|
36
|
+
export declare function getHeaderCellStyleUtil(data: any, runtimeStyle: any, props: any): any;
|
|
37
|
+
export declare function getRowStyleUtil(data: any, groupSummaryDataRowIndex: number[], props: any): any;
|
|
38
|
+
export declare function getCellStyleUtil(data: any, cellStyles: any, props: any): {};
|
|
39
|
+
export declare function rowDataToColumn(data: any, configure: Component): any;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param data 数据
|
|
43
|
+
* @param configure
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
export declare function colDataToRow(data: any, configure: Component): any;
|
|
47
|
+
export declare function getColumnToRowTableConfig(configure: Component): any;
|
|
48
|
+
export declare function getIndexColumn(): {
|
|
49
|
+
props: {
|
|
50
|
+
base: {
|
|
51
|
+
name: string;
|
|
52
|
+
prop: string;
|
|
53
|
+
columnWidth: number;
|
|
54
|
+
sortable: boolean;
|
|
55
|
+
visible: boolean;
|
|
56
|
+
displayOrder: number;
|
|
57
|
+
alignTitle: string;
|
|
58
|
+
alignContent: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
events: any[];
|
|
62
|
+
style: {
|
|
63
|
+
titleFont: {};
|
|
64
|
+
contentFont: {};
|
|
65
|
+
width: {};
|
|
66
|
+
background: {};
|
|
67
|
+
tableCell: {
|
|
68
|
+
type: string;
|
|
69
|
+
model: string;
|
|
70
|
+
}[];
|
|
71
|
+
conentPadding: {};
|
|
72
|
+
tittlePadding: {};
|
|
73
|
+
border: {};
|
|
74
|
+
shadow: {};
|
|
75
|
+
tittleClass: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare function computeFormula(itemConfs: any, datas: any): void;
|
|
79
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { defineComponent, ref, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, createTextVNode, toDisplayString, resolveDynamicComponent, createVNode, normalizeClass, createCommentVNode, createElementVNode } from "vue";
|
|
2
2
|
import { getCustomFunc } from "../../../../utils/events/event-util.js";
|
|
3
3
|
import eventBus from "../../../../utils/eventBus.js";
|
|
4
|
-
import
|
|
4
|
+
import "agilebuilder-ui/src/utils/request";
|
|
5
|
+
import "dayjs";
|
|
6
|
+
import "agilebuilder-ui/src/utils/calculator/calculator-util";
|
|
7
|
+
import "../../../../utils/global-refs.js";
|
|
8
|
+
import { expressJump } from "../../../../utils/table-utils.js";
|
|
5
9
|
const _hoisted_1 = { key: 0 };
|
|
6
10
|
const _hoisted_2 = { key: 1 };
|
|
7
11
|
const _hoisted_3 = { key: 1 };
|
|
@@ -38,36 +42,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
42
|
function formatter(row, column, cellValue, index) {
|
|
39
43
|
}
|
|
40
44
|
function showLink(row) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const result = func.apply(func, [
|
|
48
|
-
{
|
|
49
|
-
pageContext: props.pageContext,
|
|
50
|
-
configureObj: props.configure,
|
|
51
|
-
row
|
|
52
|
-
}
|
|
53
|
-
]);
|
|
54
|
-
if (result) {
|
|
55
|
-
canShow = true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
} else if (item.showCondition && item.showCondition.length > 0) {
|
|
59
|
-
const result = ExpressionEvaluator.evaluate(props.pageContext, item.showCondition, row);
|
|
60
|
-
if (result) {
|
|
61
|
-
canShow = true;
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
canShow = true;
|
|
65
|
-
}
|
|
66
|
-
if (canShow) {
|
|
67
|
-
toPage = item;
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
45
|
+
const result = expressJump(props.pageContext, props.configure, props.column.linkPage, row);
|
|
46
|
+
let show = false;
|
|
47
|
+
if (result) {
|
|
48
|
+
show = result.show;
|
|
49
|
+
toPage = result.toPage;
|
|
50
|
+
}
|
|
71
51
|
return show;
|
|
72
52
|
}
|
|
73
53
|
function clickLink(row) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, watch, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx, Fragment, renderList, createBlock, createCommentVNode, h } from "vue";
|
|
2
2
|
import _sfc_main$1 from "../common/common-chart-header.vue.js";
|
|
3
|
-
import { getChartDatasFromPage, getValueFromVariable, isPromise, setValueForVariableName, updateChartDatasourcesByComponent } from "../../../../utils/page-helper-util.js";
|
|
3
|
+
import { getChartDatasFromPage, getValueFromVariable, isPromise, setValueForVariableName, updateChartDatasourcesByComponent, caculateShowCondition } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { getCustomFunc } from "../../../../utils/events/event-util.js";
|
|
5
5
|
import _sfc_main$2 from "./group-column.vue.js";
|
|
6
6
|
import _sfc_main$3 from "./normal-column.vue.js";
|
|
@@ -43,6 +43,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
43
|
const groupSummaryDataRowIndex = [];
|
|
44
44
|
const columnStyleSourceConfig = ref({});
|
|
45
45
|
const dataFormulaMapping = ref({});
|
|
46
|
+
const gridRef = ref(null);
|
|
46
47
|
const total = ref(0);
|
|
47
48
|
let tmpTableData = [];
|
|
48
49
|
if (!props.configure.props.modelCustom) {
|
|
@@ -412,6 +413,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
412
413
|
}
|
|
413
414
|
updateChartDatasourcesByComponent(props.pageContext, props.configure.uuid);
|
|
414
415
|
}
|
|
416
|
+
function calacShowColumn(column) {
|
|
417
|
+
const showCondition = column.showCondition;
|
|
418
|
+
return caculateShowCondition(props.pageContext, showCondition);
|
|
419
|
+
}
|
|
415
420
|
function exportChart() {
|
|
416
421
|
}
|
|
417
422
|
__expose({
|
|
@@ -435,6 +440,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
435
440
|
[vShow, unref(headerInfo).showHeader]
|
|
436
441
|
]),
|
|
437
442
|
createVNode(_component_el_table, {
|
|
443
|
+
ref_key: "gridRef",
|
|
444
|
+
ref: gridRef,
|
|
438
445
|
data: tableData.value,
|
|
439
446
|
style: { "width": "100%" },
|
|
440
447
|
"header-cell-style": getHeaderCellStyle,
|
|
@@ -454,20 +461,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
454
461
|
pageContext: __props.pageContext,
|
|
455
462
|
groupColumn: item,
|
|
456
463
|
columnsConfigKeyValues: columnsConfigKeyValues.value
|
|
457
|
-
}, null, 8, ["configure", "pageContext", "groupColumn", "columnsConfigKeyValues"])) : (openBlock(), createBlock(_sfc_main$3, {
|
|
464
|
+
}, null, 8, ["configure", "pageContext", "groupColumn", "columnsConfigKeyValues"])) : calacShowColumn(columnsConfigKeyValues.value[item.columnUuid]) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
458
465
|
key: 1,
|
|
459
466
|
configure: __props.configure,
|
|
460
467
|
pageContext: __props.pageContext,
|
|
461
468
|
column: columnsConfigKeyValues.value[item.columnUuid]
|
|
462
|
-
}, null, 8, ["configure", "pageContext", "column"]))
|
|
469
|
+
}, null, 8, ["configure", "pageContext", "column"])) : createCommentVNode("", true)
|
|
463
470
|
], 64);
|
|
464
471
|
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(tableColumnsConfig.value, (column, index) => {
|
|
465
|
-
return openBlock(),
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
472
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
473
|
+
calacShowColumn(column) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
474
|
+
key: 0,
|
|
475
|
+
column,
|
|
476
|
+
configure: __props.configure,
|
|
477
|
+
pageContext: __props.pageContext
|
|
478
|
+
}, null, 8, ["column", "configure", "pageContext"])) : createCommentVNode("", true)
|
|
479
|
+
], 64);
|
|
471
480
|
}), 128))
|
|
472
481
|
]),
|
|
473
482
|
_: 1
|
|
@@ -768,10 +768,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
768
768
|
}
|
|
769
769
|
function dynamicControlTableEdit(pageContext2, customRules, listCode2) {
|
|
770
770
|
if (gridRef.value) {
|
|
771
|
-
debugger;
|
|
772
771
|
gridRef.value.dynamicControlTableEdit(pageContext2, customRules, listCode2);
|
|
773
772
|
}
|
|
774
773
|
}
|
|
774
|
+
function doLayout(hiddenColumns) {
|
|
775
|
+
if (gridRef.value) {
|
|
776
|
+
gridRef.value.doLayout(hiddenColumns);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
775
779
|
__expose({
|
|
776
780
|
refresh,
|
|
777
781
|
createRow,
|
|
@@ -783,7 +787,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
783
787
|
validatorSunTableListData,
|
|
784
788
|
showMobileSearch,
|
|
785
789
|
getTableSelectOptions,
|
|
786
|
-
dynamicControlTableEdit
|
|
790
|
+
dynamicControlTableEdit,
|
|
791
|
+
doLayout
|
|
787
792
|
});
|
|
788
793
|
return (_ctx, _cache) => {
|
|
789
794
|
const _component_super_grid = resolveComponent("super-grid");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, onUnmounted, 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
|
-
import { setVariableValue, getVariableValue, getSizeConfig } from "../../../../utils/page-helper-util.js";
|
|
3
|
+
import { caculateShowCondition, setVariableValue, getVariableValue, getSizeConfig } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { getModelFields, getDefaultValue } from "../../../../utils/page-init-util.js";
|
|
5
5
|
import eventBus from "../../../../utils/eventBus.js";
|
|
6
6
|
import { popupToPage, getOperationButtons } from "../../../../utils/table-utils.js";
|
|
@@ -250,7 +250,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
250
250
|
}
|
|
251
251
|
const subTableOperations = getOperations();
|
|
252
252
|
listViewOptions.value["operations"]["operation"] = subTableOperations;
|
|
253
|
-
listViewOptions.value["subTableCanAdd"] =
|
|
253
|
+
listViewOptions.value["subTableCanAdd"] = isShowAddWf();
|
|
254
254
|
}
|
|
255
255
|
function setGridToStore() {
|
|
256
256
|
if (!pageContext.tableUuids) {
|
|
@@ -262,7 +262,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
262
262
|
}
|
|
263
263
|
function getOperations() {
|
|
264
264
|
let operations = [];
|
|
265
|
-
|
|
265
|
+
let isShowOperation = caculateShowCondition(props.pageContext, configure.props.base.showOperationCondition);
|
|
266
|
+
if (isShowOperation && isShowAddWf()) {
|
|
266
267
|
const addButton = {
|
|
267
268
|
props: {
|
|
268
269
|
elementType: "el-button",
|
|
@@ -272,11 +273,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
272
273
|
size: "mini",
|
|
273
274
|
permission: "true"
|
|
274
275
|
},
|
|
275
|
-
onClick: addSubTableData
|
|
276
|
+
onClick: addSubTableData,
|
|
277
|
+
isShow: isShowAdd
|
|
276
278
|
};
|
|
277
279
|
operations.push(addButton);
|
|
278
280
|
}
|
|
279
|
-
if (
|
|
281
|
+
if (isShowOperation && isShowDeleteWf(null, null, null, null, null, true)) {
|
|
280
282
|
const removeButton = {
|
|
281
283
|
props: {
|
|
282
284
|
elementType: "el-button",
|
|
@@ -302,7 +304,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
302
304
|
return row.ID;
|
|
303
305
|
}
|
|
304
306
|
}
|
|
305
|
-
function
|
|
307
|
+
function isShowAddWf(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
308
|
+
const isShowOperation = caculateShowCondition(props.pageContext, configure.props.base.showOperationCondition);
|
|
309
|
+
if (!isShowOperation) {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
306
312
|
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
307
313
|
const actionPermissionMap = pageContext.actionPermissionMap;
|
|
308
314
|
let canAdd = true;
|
|
@@ -323,7 +329,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
323
329
|
}
|
|
324
330
|
return canAdd;
|
|
325
331
|
}
|
|
326
|
-
function
|
|
332
|
+
function isShowAdd(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
333
|
+
let canAdd = isShowAddWf();
|
|
334
|
+
if (canAdd === true) {
|
|
335
|
+
canAdd = caculateShowCondition(props.pageContext, configure.props.base.showAddBtnCondition, row);
|
|
336
|
+
}
|
|
337
|
+
return canAdd;
|
|
338
|
+
}
|
|
339
|
+
function isShowDeleteWf(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
327
340
|
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
328
341
|
const actionPermissionMap = pageContext.actionPermissionMap;
|
|
329
342
|
let canDelete = true;
|
|
@@ -362,6 +375,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
362
375
|
}
|
|
363
376
|
return canDelete;
|
|
364
377
|
}
|
|
378
|
+
function isShowDelete(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
|
|
379
|
+
let canDelete = isShowDeleteWf(originalValue, formatValue, row, column, rowIndex, isFormJudge);
|
|
380
|
+
if (canDelete === true) {
|
|
381
|
+
canDelete = caculateShowCondition(props.pageContext, configure.props.base.showDeleteBtnCondition, row);
|
|
382
|
+
}
|
|
383
|
+
return canDelete;
|
|
384
|
+
}
|
|
365
385
|
function addSubTableData(originalValue, formatValue, row, column, rowIndex) {
|
|
366
386
|
gridRef.value.createRow(listCode, {}, { getDefaultValueFunc: getDefaultValue });
|
|
367
387
|
}
|
|
@@ -529,6 +549,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
529
549
|
gridRef.value.dynamicControlTableEdit(pageContext2, customRules, listCode2);
|
|
530
550
|
}
|
|
531
551
|
}
|
|
552
|
+
function doLayout(hiddenColumns) {
|
|
553
|
+
if (gridRef.value) {
|
|
554
|
+
gridRef.value.doLayout(hiddenColumns);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
532
557
|
__expose({
|
|
533
558
|
createRow,
|
|
534
559
|
getSelections,
|
|
@@ -539,7 +564,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
539
564
|
getValue,
|
|
540
565
|
setValue,
|
|
541
566
|
getTableSelectOptions,
|
|
542
|
-
dynamicControlTableEdit
|
|
567
|
+
dynamicControlTableEdit,
|
|
568
|
+
doLayout
|
|
543
569
|
});
|
|
544
570
|
return (_ctx, _cache) => {
|
|
545
571
|
const _component_super_grid = resolveComponent("super-grid");
|
|
@@ -77,6 +77,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
77
|
function getTableUuid() {
|
|
78
78
|
return props.configure.uuid;
|
|
79
79
|
}
|
|
80
|
+
function doLayout(hiddenColumns) {
|
|
81
|
+
if (gridRef.value) {
|
|
82
|
+
gridRef.value.doLayout(hiddenColumns);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
80
85
|
__expose({
|
|
81
86
|
refresh,
|
|
82
87
|
createRow,
|
|
@@ -89,7 +94,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
94
|
showMobileSearch,
|
|
90
95
|
getTableSelectOptions,
|
|
91
96
|
dynamicControlTableEdit,
|
|
92
|
-
getTableUuid
|
|
97
|
+
getTableUuid,
|
|
98
|
+
doLayout
|
|
93
99
|
});
|
|
94
100
|
return (_ctx, _cache) => {
|
|
95
101
|
return openBlock(), createElementBlock("div", null, [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, normalizeStyle, withCtx, createElementVNode, createVNode, toDisplayString
|
|
1
|
+
import { defineComponent, computed, ref, onMounted, nextTick, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, createCommentVNode, normalizeStyle, withCtx, createElementVNode, createVNode, toDisplayString } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { getMenuTreeData } from "../../../../utils/tree-utils.js";
|
|
@@ -45,6 +45,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
const isShowTree = ref(false);
|
|
46
46
|
const menuData = ref(null);
|
|
47
47
|
const selectNode = ref(null);
|
|
48
|
+
const filterText = ref("");
|
|
49
|
+
const isSearch = ref(false);
|
|
48
50
|
onMounted(() => {
|
|
49
51
|
nextTick(() => {
|
|
50
52
|
const value = dynamicModelMethod.value;
|
|
@@ -64,6 +66,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
64
66
|
} else {
|
|
65
67
|
isShowTree.value = true;
|
|
66
68
|
}
|
|
69
|
+
watch(filterText, (val) => {
|
|
70
|
+
isSearch.value = true;
|
|
71
|
+
menuTree.value.filter(val);
|
|
72
|
+
});
|
|
73
|
+
const filterNode = (value, data) => {
|
|
74
|
+
if (!value)
|
|
75
|
+
return true;
|
|
76
|
+
return data.name.includes(value);
|
|
77
|
+
};
|
|
67
78
|
function handleNodeClick(data, node, nodeTree) {
|
|
68
79
|
selectNode.value = node;
|
|
69
80
|
handleFormEvent(null, props.pageContext, props.configure, "node-click", {
|
|
@@ -85,11 +96,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
85
96
|
function initLoadNode(parentNodeId, node, resolve) {
|
|
86
97
|
const param = {
|
|
87
98
|
parentNodeId,
|
|
88
|
-
data: node.data
|
|
99
|
+
data: node.data,
|
|
89
100
|
// 节点详细信息,json字符串
|
|
101
|
+
searchValue: filterText,
|
|
102
|
+
// 查询条件
|
|
103
|
+
isSearch: isSearch.value
|
|
104
|
+
// 是否是查询
|
|
90
105
|
};
|
|
91
106
|
getMenuTreeData(props.pageContext, props.configure, parentNodeId, node, param).then(
|
|
92
107
|
(treeNodes) => {
|
|
108
|
+
isSearch.value = false;
|
|
93
109
|
resolve(treeNodes);
|
|
94
110
|
if (parentNodeId === "0") {
|
|
95
111
|
const rootNodeId = treeNodes[0].nodeId;
|
|
@@ -101,10 +117,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
101
117
|
function loadRootNode(rootNodeId, node) {
|
|
102
118
|
const param = {
|
|
103
119
|
parentNodeId: rootNodeId,
|
|
104
|
-
data: node.data
|
|
120
|
+
data: node.data,
|
|
105
121
|
// 节点详细信息,json字符串
|
|
122
|
+
searchValue: filterText,
|
|
123
|
+
// 查询条件
|
|
124
|
+
isSearch: isSearch.value
|
|
125
|
+
// 是否是查询
|
|
106
126
|
};
|
|
107
127
|
getMenuTreeData(props.pageContext, props.configure, rootNodeId, node, param).then((children) => {
|
|
128
|
+
isSearch.value = false;
|
|
108
129
|
menuTree.value.updateKeyChildren(rootNodeId, children);
|
|
109
130
|
if (menuTree.value.store.nodesMap[rootNodeId]) {
|
|
110
131
|
menuTree.value.store.nodesMap[rootNodeId].expanded = true;
|
|
@@ -118,11 +139,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
118
139
|
node.loaded = false;
|
|
119
140
|
node.expand();
|
|
120
141
|
}
|
|
142
|
+
function loadTreeNodes() {
|
|
143
|
+
getMenuTreeData(props.pageContext, props.configure).then((treeNodes) => {
|
|
144
|
+
isSearch.value = false;
|
|
145
|
+
menuData.value = treeNodes;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function getNode(node) {
|
|
149
|
+
menuTree.value.getNode(node);
|
|
150
|
+
}
|
|
121
151
|
__expose({
|
|
122
152
|
getSelectNode,
|
|
123
|
-
expandNode
|
|
153
|
+
expandNode,
|
|
154
|
+
loadTreeNodes,
|
|
155
|
+
getNode
|
|
124
156
|
});
|
|
125
157
|
return (_ctx, _cache) => {
|
|
158
|
+
const _component_el_input = resolveComponent("el-input");
|
|
126
159
|
const _component_SuperIcon = resolveComponent("SuperIcon");
|
|
127
160
|
const _component_Folder = resolveComponent("Folder");
|
|
128
161
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -130,8 +163,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
130
163
|
return openBlock(), createElementBlock("div", {
|
|
131
164
|
class: normalizeClass(unref(runtimeClass))
|
|
132
165
|
}, [
|
|
133
|
-
|
|
166
|
+
designProperty.value.filter ? (openBlock(), createBlock(_component_el_input, {
|
|
134
167
|
key: 0,
|
|
168
|
+
modelValue: filterText.value,
|
|
169
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
170
|
+
style: { "width": "240px" },
|
|
171
|
+
placeholder: "请输入查询条件"
|
|
172
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
173
|
+
isShowTree.value ? (openBlock(), createBlock(_component_el_tree, {
|
|
174
|
+
key: 1,
|
|
135
175
|
ref_key: "menuTree",
|
|
136
176
|
ref: menuTree,
|
|
137
177
|
style: normalizeStyle(unref(runtimeStyle)),
|
|
@@ -146,6 +186,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
146
186
|
"highlight-current": "",
|
|
147
187
|
lazy: isLazy.value,
|
|
148
188
|
"node-key": "nodeId",
|
|
189
|
+
"filter-node-method": filterNode,
|
|
149
190
|
onNodeClick: handleNodeClick
|
|
150
191
|
}, {
|
|
151
192
|
default: withCtx(({ node, data }) => [
|
|
@@ -20,28 +20,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
const titleExceedStyle = runtimeInfo.titleExceedStyle;
|
|
21
21
|
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
22
22
|
let val = getVariableValue(entity, dynamicFields);
|
|
23
|
-
if (val !== void 0 && val !== null && (val + "" === "1" || val + "" === "0")) {
|
|
24
|
-
if (
|
|
25
|
-
designProperty.value.activeValue =
|
|
23
|
+
if (val !== void 0 && val !== null && typeof val === "number" && (val + "" === "1" || val + "" === "0")) {
|
|
24
|
+
if (!isHasActive("activeValue")) {
|
|
25
|
+
designProperty.value.activeValue = 1;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
28
|
-
designProperty.value.inactiveValue =
|
|
27
|
+
if (!isHasActive("inactiveValue")) {
|
|
28
|
+
designProperty.value.inactiveValue = 0;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
if (val !== void 0 && val !== null &&
|
|
32
|
-
if (
|
|
33
|
-
designProperty.value.activeValue =
|
|
31
|
+
if (val !== void 0 && val !== null && typeof val === "boolean") {
|
|
32
|
+
if (!isHasActive("activeValue")) {
|
|
33
|
+
designProperty.value.activeValue = true;
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
36
|
-
designProperty.value.inactiveValue =
|
|
35
|
+
if (!isHasActive("inactiveValue")) {
|
|
36
|
+
designProperty.value.inactiveValue = false;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
if (
|
|
39
|
+
if (!isHasActive("activeValue")) {
|
|
40
40
|
designProperty.value.activeValue = true;
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
42
|
+
if (!isHasActive("inactiveValue")) {
|
|
43
43
|
designProperty.value.inactiveValue = false;
|
|
44
44
|
}
|
|
45
|
+
function isHasActive(type) {
|
|
46
|
+
if (designProperty.value[type] === void 0 || designProperty.value[type] === null || designProperty.value[type] === "") {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
45
51
|
const switchStyle = runtimeInfo.switchStyle;
|
|
46
52
|
const dynamicModelMethod = computed({
|
|
47
53
|
get() {
|
|
@@ -54,6 +60,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
60
|
if (val2 + "" === "0") {
|
|
55
61
|
val2 = false;
|
|
56
62
|
}
|
|
63
|
+
} else if (designProperty.value.activeValue === 1) {
|
|
64
|
+
if (val2 + "" === "true") {
|
|
65
|
+
val2 = 1;
|
|
66
|
+
}
|
|
67
|
+
if (val2 + "" === "false") {
|
|
68
|
+
val2 = 0;
|
|
69
|
+
}
|
|
57
70
|
} else {
|
|
58
71
|
val2 = val2 + "";
|
|
59
72
|
}
|
|
@@ -69,6 +82,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
82
|
if (value + "" === "0") {
|
|
70
83
|
value = false;
|
|
71
84
|
}
|
|
85
|
+
} else if (designProperty.value.activeValue === 1) {
|
|
86
|
+
if (value + "" === "true") {
|
|
87
|
+
value = 1;
|
|
88
|
+
}
|
|
89
|
+
if (value + "" === "false") {
|
|
90
|
+
value = 0;
|
|
91
|
+
}
|
|
72
92
|
} else {
|
|
73
93
|
value = value + "";
|
|
74
94
|
}
|
|
@@ -82,19 +102,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
82
102
|
onMounted(() => {
|
|
83
103
|
nextTick(() => {
|
|
84
104
|
const value = dynamicModelMethod.value;
|
|
85
|
-
handleAfterInitEvent(
|
|
105
|
+
handleAfterInitEvent(value, props.pageContext, props.configure, {
|
|
106
|
+
formItemRef: formItemRef.value,
|
|
107
|
+
componentRef: componentRef.value,
|
|
108
|
+
titleRef: titleRef.value,
|
|
86
109
|
value,
|
|
87
|
-
props.pageContext,
|
|
88
|
-
props.
|
|
89
|
-
|
|
90
|
-
formItemRef: formItemRef.value,
|
|
91
|
-
componentRef: componentRef.value,
|
|
92
|
-
titleRef: titleRef.value,
|
|
93
|
-
value,
|
|
94
|
-
entity: props.pageContext.entity.data,
|
|
95
|
-
pageData: props.pageContext.entity.page
|
|
96
|
-
}
|
|
97
|
-
);
|
|
110
|
+
entity: props.pageContext.entity.data,
|
|
111
|
+
pageData: props.pageContext.entity.page
|
|
112
|
+
});
|
|
98
113
|
});
|
|
99
114
|
});
|
|
100
115
|
return (_ctx, _cache) => {
|
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
dynamicShowFlag = false;
|
|
43
43
|
} else {
|
|
44
44
|
if (showConditions && showConditions.length > 0) {
|
|
45
|
-
dynamicShowFlag = caculateShowCondition(props.pageContext,
|
|
45
|
+
dynamicShowFlag = caculateShowCondition(props.pageContext, showConditions);
|
|
46
46
|
} else {
|
|
47
47
|
const state = (_a2 = props.configure.props.base) == null ? void 0 : _a2.state;
|
|
48
48
|
if (state && state === "hidden") {
|
|
@@ -61,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
const property = runtime.props ? runtime.props : {};
|
|
62
62
|
property.rawSate = property.state;
|
|
63
63
|
property.state = computed(() => {
|
|
64
|
-
const canEdit = caculateShowCondition(props.pageContext,
|
|
64
|
+
const canEdit = caculateShowCondition(props.pageContext, editConditions);
|
|
65
65
|
return canEdit ? "" : "disabled";
|
|
66
66
|
});
|
|
67
67
|
}
|
|
@@ -422,17 +422,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
422
422
|
let dataId = isNeedId && eventParams ? eventParams.id : null;
|
|
423
423
|
let ids = isNeedId && eventParams ? eventParams.ids : null;
|
|
424
424
|
let selections = eventParams ? eventParams.selections : [];
|
|
425
|
-
let entity =
|
|
426
|
-
if (
|
|
427
|
-
entity =
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
425
|
+
let entity = eventParams ? eventParams.row : null;
|
|
426
|
+
if (!entity) {
|
|
427
|
+
entity = {};
|
|
428
|
+
if (selections && selections.length > 0) {
|
|
429
|
+
entity = selections[0];
|
|
430
|
+
} else {
|
|
431
|
+
const dataModel = parentPageContext.value.entity.data;
|
|
432
|
+
const pageModel = parentPageContext.value.entity.page;
|
|
433
|
+
if (pageModel) {
|
|
434
|
+
Object.assign(entity, pageModel);
|
|
435
|
+
}
|
|
436
|
+
if (dataModel) {
|
|
437
|
+
Object.assign(entity, dataModel);
|
|
438
|
+
}
|
|
436
439
|
}
|
|
437
440
|
}
|
|
438
441
|
const copyPageData = deepCopy(parentPageContext.value.entity.page);
|