@lcap/nasl-concepts 4.4.2-rc.5 → 4.5.0-beta.2
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/out/common/BaseNode.d.ts.map +1 -1
- package/out/common/BaseNode.js +14 -25
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +3 -1
- package/out/concepts/App__.d.ts.map +1 -1
- package/out/concepts/App__.js +2 -2
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts.map +1 -1
- package/out/concepts/BindAttribute__.js +7 -6
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts.map +1 -1
- package/out/concepts/BindDirective__.js +1 -0
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +8 -0
- package/out/concepts/BindEvent__.d.ts.map +1 -1
- package/out/concepts/BindEvent__.js +14 -0
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts.map +1 -1
- package/out/concepts/BindStyle__.js +1 -0
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts.map +1 -1
- package/out/concepts/CallLogic__.js +4 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts.map +1 -1
- package/out/concepts/EntityProperty__.js +2 -0
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +8 -0
- package/out/concepts/Entity__.d.ts.map +1 -1
- package/out/concepts/Entity__.js +15 -4
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Logic__.js +1 -1
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts.map +1 -1
- package/out/concepts/NewComposite__.js +16 -1
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/Param__.d.ts.map +1 -1
- package/out/concepts/Param__.js +13 -7
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessV2__.js +1 -1
- package/out/concepts/ProcessV2__.js.map +1 -1
- package/out/concepts/Role__.d.ts +8 -0
- package/out/concepts/Role__.d.ts.map +1 -1
- package/out/concepts/Role__.js +14 -0
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +8 -0
- package/out/concepts/Structure__.d.ts.map +1 -1
- package/out/concepts/Structure__.js +15 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/View__.d.ts +8 -0
- package/out/concepts/View__.d.ts.map +1 -1
- package/out/concepts/View__.js +89 -23
- package/out/concepts/View__.js.map +1 -1
- package/out/service/getProcessesV2.d.ts.map +1 -1
- package/out/service/getProcessesV2.js +2 -1
- package/out/service/getProcessesV2.js.map +1 -1
- package/out/utils/bak-translator/composition.js +10 -2
- package/out/utils/bak-translator/composition.js.map +1 -1
- package/out/utils/bak-translator/legacy.d.ts +1 -1
- package/out/utils/bak-translator/legacy.d.ts.map +1 -1
- package/out/utils/bak-translator/legacy.js +10 -2
- package/out/utils/bak-translator/legacy.js.map +1 -1
- package/package.json +4 -4
package/out/concepts/View__.js
CHANGED
|
@@ -141,6 +141,17 @@ let View = class View extends Annotatable__1.default {
|
|
|
141
141
|
...object,
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* 设置页面描述
|
|
146
|
+
*/
|
|
147
|
+
setDescription(description) {
|
|
148
|
+
const object = {
|
|
149
|
+
description,
|
|
150
|
+
};
|
|
151
|
+
this.update({
|
|
152
|
+
...object,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
144
155
|
/**
|
|
145
156
|
* 设置面包屑
|
|
146
157
|
*/
|
|
@@ -1257,10 +1268,11 @@ let View = class View extends Annotatable__1.default {
|
|
|
1257
1268
|
}
|
|
1258
1269
|
return '';
|
|
1259
1270
|
},
|
|
1260
|
-
modifyFieldTemplateByPermission(replaceTemplateList, propertyName, fieldStr, permission, tag, relationDataName) {
|
|
1271
|
+
modifyFieldTemplateByPermission(replaceTemplateList, propertyName, fieldStr, permission, tag, relationDataName, getRangeMethod) {
|
|
1261
1272
|
let startIndex = 0, endIndex = Infinity;
|
|
1262
1273
|
if (relationDataName) {
|
|
1263
|
-
const
|
|
1274
|
+
const getRange = getRangeMethod || this.getRelationDataStartAndEndIndex.bind(this);
|
|
1275
|
+
const tableIndexConfig = getRange(relationDataName)
|
|
1264
1276
|
startIndex = tableIndexConfig.tableStartIndex
|
|
1265
1277
|
endIndex = tableIndexConfig.tableEndIndex
|
|
1266
1278
|
}
|
|
@@ -1365,6 +1377,37 @@ let View = class View extends Annotatable__1.default {
|
|
|
1365
1377
|
stencilStr = this.cutStrByTag(stencilStr, 'u-table-view-column', ':subFormInitialColumn="\`action\`"' )
|
|
1366
1378
|
return stencilStr
|
|
1367
1379
|
},
|
|
1380
|
+
previewH5SubFormTemplate(stencilStr){
|
|
1381
|
+
stencilStr = this.cutStrByTag(stencilStr, 'van-button', ':subFormBtnType="\`add\`"' )
|
|
1382
|
+
stencilStr = this.cutStrByTag(stencilStr, 'van-link', ':text="\`删除\`"' )
|
|
1383
|
+
return stencilStr
|
|
1384
|
+
},
|
|
1385
|
+
getH5RelationDataStartAndEndIndex(relationDataName) {
|
|
1386
|
+
const forTag = 'van-for-components';
|
|
1387
|
+
const outerTag = 'van-field';
|
|
1388
|
+
let forStartIndex = -1;
|
|
1389
|
+
let forEndIndex = -1;
|
|
1390
|
+
let outerStartIndex = -1;
|
|
1391
|
+
let outerEndIndex = -1;
|
|
1392
|
+
const reg = new RegExp(\`dataSource(?:\\\\.sync)?="[^"]*processDetailFormData[^"]*\\\\.\${relationDataName}"\`, 'g');
|
|
1393
|
+
const match = this.formTemplate.match(reg);
|
|
1394
|
+
if (match && match.length) {
|
|
1395
|
+
const relationDataStr = match[0];
|
|
1396
|
+
const relationDataStrIndex = this.formTemplate.indexOf(relationDataStr);
|
|
1397
|
+
forEndIndex = this.formTemplate.indexOf('</' + forTag + '>', relationDataStrIndex);
|
|
1398
|
+
if (forEndIndex > -1) {
|
|
1399
|
+
forStartIndex = this.formTemplate.lastIndexOf('<' + forTag + ' ', forEndIndex);
|
|
1400
|
+
}
|
|
1401
|
+
if (forStartIndex > -1 && forEndIndex > -1) {
|
|
1402
|
+
// 继续向外找包裹的 van-field(子表单整体容器)
|
|
1403
|
+
outerEndIndex = this.formTemplate.indexOf('</' + outerTag + '>', forEndIndex);
|
|
1404
|
+
if (outerEndIndex > -1) {
|
|
1405
|
+
outerStartIndex = this.formTemplate.lastIndexOf('<' + outerTag + ' ', forStartIndex);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
return { tableStartIndex: forStartIndex, tableEndIndex: forEndIndex, outerStartIndex, outerEndIndex };
|
|
1410
|
+
},
|
|
1368
1411
|
reDynamicRenderForm(vmRoot, templateData) {
|
|
1369
1412
|
let formTemplateForRender = this.formTemplate;
|
|
1370
1413
|
const replaceFormTemplateToReplacer = (fieldReplTemplates) => {
|
|
@@ -1449,40 +1492,56 @@ let View = class View extends Annotatable__1.default {
|
|
|
1449
1492
|
const subPerms = fieldPermission?.data?.slice(1) || []
|
|
1450
1493
|
// 子字段渲染错误时的替换模版
|
|
1451
1494
|
const subReplTemplates = []
|
|
1452
|
-
if (subPerms.length
|
|
1453
|
-
|
|
1495
|
+
if (subPerms.length) {
|
|
1496
|
+
// 各端子表单处理配置
|
|
1497
|
+
const subFormConfig = ${this.frontend.type === 'pc'} ? {
|
|
1498
|
+
fieldTag: 'u-table-view-column',
|
|
1499
|
+
getSubFormRange: (propertyName) => this.getRelationDataStartAndEndIndex(propertyName),
|
|
1500
|
+
getStencilStr: ({ tableStartIndex }) => this.sliceStrByTag('u-grid-layout-column', tableStartIndex),
|
|
1501
|
+
previewSubForm: (stencilStr) => this.previewSubFormTemplate(stencilStr),
|
|
1502
|
+
} : {
|
|
1503
|
+
fieldTag: 'van-field',
|
|
1504
|
+
getSubFormRange: (propertyName) => this.getH5RelationDataStartAndEndIndex(propertyName),
|
|
1505
|
+
getStencilStr: ({ outerStartIndex, outerEndIndex }) => this.formTemplate.substring(outerStartIndex, outerEndIndex + '</van-field>'.length),
|
|
1506
|
+
previewSubForm: (stencilStr) => this.previewH5SubFormTemplate(stencilStr),
|
|
1507
|
+
};
|
|
1508
|
+
const { fieldTag, getSubFormRange, getStencilStr, previewSubForm } = subFormConfig;
|
|
1454
1509
|
// 遍历每个子表单
|
|
1455
1510
|
subPerms.forEach((relationData) => {
|
|
1456
1511
|
const { propertyName, subFieldPermissions, permission } = relationData;
|
|
1457
|
-
// step1:
|
|
1458
|
-
|
|
1512
|
+
// step1: 定位当前子表单范围,并获取整体容器字符串
|
|
1513
|
+
// PC端:通过 u-table-view 定位,再向外找 u-grid-layout-column 作为整体容器
|
|
1514
|
+
// H5端:通过 van-for-components 定位,再向外找 van-field 作为整体容器
|
|
1515
|
+
const range = getSubFormRange(propertyName);
|
|
1516
|
+
const { tableStartIndex, tableEndIndex, outerStartIndex, outerEndIndex } = range;
|
|
1459
1517
|
if (tableStartIndex === -1 || tableEndIndex === -1) return;
|
|
1460
|
-
|
|
1518
|
+
if (outerStartIndex !== undefined && outerStartIndex === -1) return;
|
|
1519
|
+
let stencilStr = getStencilStr(range);
|
|
1520
|
+
if (!stencilStr) return;
|
|
1461
1521
|
// step2: 根据子表单整体权限,控制子表单的部分节点 或 整个子表单 的隐藏
|
|
1462
|
-
if(['readOnly', 'preview'].includes(permission)){
|
|
1463
|
-
const newStencilStr =
|
|
1464
|
-
this.formTemplate = this.formTemplate.replace(stencilStr, newStencilStr)
|
|
1465
|
-
stencilStr = newStencilStr
|
|
1466
|
-
}else if(permission === 'hidden'){
|
|
1467
|
-
this.formTemplate = this.formTemplate.replace(stencilStr, '')
|
|
1522
|
+
if (['readOnly', 'preview'].includes(permission)) {
|
|
1523
|
+
const newStencilStr = previewSubForm(stencilStr);
|
|
1524
|
+
this.formTemplate = this.formTemplate.replace(stencilStr, newStencilStr);
|
|
1525
|
+
stencilStr = newStencilStr;
|
|
1526
|
+
} else if (permission === 'hidden') {
|
|
1527
|
+
this.formTemplate = this.formTemplate.replace(stencilStr, '');
|
|
1468
1528
|
return;
|
|
1469
1529
|
}
|
|
1470
1530
|
// step3: 初始化存放槽位
|
|
1471
|
-
const curReplTemplates = []
|
|
1531
|
+
const curReplTemplates = [];
|
|
1472
1532
|
subReplTemplates.push(curReplTemplates);
|
|
1473
1533
|
// step4: 遍历当前子表单的字段权限
|
|
1534
|
+
// modifyFieldTemplateByPermission 内部通过 getRangeMethod 实时重新查找范围(模板替换后位置会变)
|
|
1474
1535
|
subFieldPermissions.forEach(({ propertyName: fieldName, permission: fieldPermission }, index) => {
|
|
1475
1536
|
const fieldStr = \`"current.item.\${fieldName}"\`;
|
|
1476
|
-
|
|
1477
|
-
// step5:
|
|
1537
|
+
this.modifyFieldTemplateByPermission(curReplTemplates, fieldName, fieldStr, fieldPermission, fieldTag, propertyName, getSubFormRange);
|
|
1538
|
+
// step5: 处理完最后一个字段后,将整体容器作为首个替换项
|
|
1539
|
+
// 目的:首次渲染时先去除整个子表单,检查是否有其他因素导致渲染失败
|
|
1478
1540
|
if (index === subFieldPermissions.length - 1) {
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
origin: stencilStr,
|
|
1484
|
-
replace: replaceStencilStr
|
|
1485
|
-
})
|
|
1541
|
+
const latestRange = getSubFormRange(propertyName);
|
|
1542
|
+
stencilStr = getStencilStr(latestRange);
|
|
1543
|
+
const replaceStencilStr = \`<span text="processDetailFormData.\${propertyName}"></span>\`;
|
|
1544
|
+
curReplTemplates.unshift({ propertyName, origin: stencilStr, replace: replaceStencilStr });
|
|
1486
1545
|
}
|
|
1487
1546
|
})
|
|
1488
1547
|
})
|
|
@@ -2063,6 +2122,7 @@ let View = class View extends Annotatable__1.default {
|
|
|
2063
2122
|
'pageTemplateId',
|
|
2064
2123
|
'uuid',
|
|
2065
2124
|
'title',
|
|
2125
|
+
'description',
|
|
2066
2126
|
'crumb',
|
|
2067
2127
|
'auth',
|
|
2068
2128
|
'authDescription',
|
|
@@ -2232,6 +2292,7 @@ let View = class View extends Annotatable__1.default {
|
|
|
2232
2292
|
'pageTemplateId',
|
|
2233
2293
|
'uuid',
|
|
2234
2294
|
'title',
|
|
2295
|
+
'description',
|
|
2235
2296
|
'crumb',
|
|
2236
2297
|
'auth',
|
|
2237
2298
|
'authDescription',
|
|
@@ -2761,6 +2822,7 @@ let View = class View extends Annotatable__1.default {
|
|
|
2761
2822
|
'_events',
|
|
2762
2823
|
'_collectingList',
|
|
2763
2824
|
'_historyList',
|
|
2825
|
+
'__preInstantiatedHelper',
|
|
2764
2826
|
]);
|
|
2765
2827
|
utils.traverse(({ node }) => {
|
|
2766
2828
|
if (node?.isProcessForm?.()) {
|
|
@@ -2781,6 +2843,7 @@ let View = class View extends Annotatable__1.default {
|
|
|
2781
2843
|
'_events',
|
|
2782
2844
|
'_collectingList',
|
|
2783
2845
|
'_historyList',
|
|
2846
|
+
'__preInstantiatedHelper',
|
|
2784
2847
|
]);
|
|
2785
2848
|
utils.traverse(({ node }) => {
|
|
2786
2849
|
if (node.tag === componentName) {
|
|
@@ -2906,6 +2969,9 @@ __decorate([
|
|
|
2906
2969
|
__decorate([
|
|
2907
2970
|
(0, decorators_2.property)()
|
|
2908
2971
|
], View.prototype, "title", void 0);
|
|
2972
|
+
__decorate([
|
|
2973
|
+
(0, decorators_2.property)()
|
|
2974
|
+
], View.prototype, "description", void 0);
|
|
2909
2975
|
__decorate([
|
|
2910
2976
|
(0, decorators_2.property)({
|
|
2911
2977
|
objectRef: 'StaticString',
|