@lcap/nasl 3.8.0-beta.3 → 3.8.0-beta.5
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/automate/engine/utils.js +1 -2
- package/out/automate/engine/utils.js.map +1 -1
- package/out/bak/translator.js +1 -1
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.js +7 -2
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.js +6 -1
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +11 -5
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +3 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +49 -2
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +4 -3
- package/out/concepts/BindAttribute__.js +121 -42
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindEvent__.js +5 -42
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +1 -0
- package/out/concepts/BusinessComponent__.js +16 -0
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +3 -0
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallConnector__.js +1 -1
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.js +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +6 -1
- package/out/concepts/CallLogic__.js +58 -17
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +4 -0
- package/out/concepts/Connection__.js +15 -0
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +2 -0
- package/out/concepts/DatabaseTypeAnnotation__.js +20 -0
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/End__.js +5 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +2 -0
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -0
- package/out/concepts/Entity__.js +24 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +12 -0
- package/out/concepts/EnumItem__.js +49 -5
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +4 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +46 -46
- package/out/concepts/FrontendLibrary__.js +34 -36
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +1 -0
- package/out/concepts/I18nInfo__.js +7 -0
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Interface__.js +4 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +2 -3
- package/out/concepts/Logic__.js +33 -8
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +7 -7
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/NewComposite__.js +2 -1
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +2 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +2 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +3 -11
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +7 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +2 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElementV2__.d.ts +4 -5
- package/out/concepts/ProcessElementV2__.js +12 -17
- package/out/concepts/ProcessElementV2__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +3 -4
- package/out/concepts/ProcessElement__.js +44 -46
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessV2__.d.ts +5 -0
- package/out/concepts/ProcessV2__.js +30 -2
- package/out/concepts/ProcessV2__.js.map +1 -1
- package/out/concepts/Process__.d.ts +5 -0
- package/out/concepts/Process__.js +28 -0
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +2 -2
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +2 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +4 -0
- package/out/concepts/StaticString__.js +11 -0
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +5 -2
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +9 -3
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SubLogic__.d.ts +1 -3
- package/out/concepts/SubLogic__.js +14 -8
- package/out/concepts/SubLogic__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +1 -0
- package/out/concepts/Transactional__.js +7 -0
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +4 -0
- package/out/concepts/TypeParam__.js +3 -0
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +1 -6
- package/out/concepts/ValidationRule__.js +9 -6
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -1
- package/out/concepts/Variable__.js +7 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +2 -0
- package/out/concepts/ViewElement__.js +130 -47
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +8 -0
- package/out/concepts/View__.js +123 -7
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.processV2.js +2 -2
- package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.js +110 -4
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +2 -0
- package/out/generator/genBundleFiles.js +51 -37
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +20 -26
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/release-body/body.js +8 -6
- package/out/generator/release-body/body.js.map +1 -1
- package/out/generator/release-body/index.d.ts +1 -0
- package/out/generator/release-body/index.js +1 -0
- package/out/generator/release-body/index.js.map +1 -1
- package/out/generator/release-body/utils.js +1 -1
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +56 -24
- package/out/natural/genNaturalTS.js +182 -112
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/getUILib.js +4 -2
- package/out/natural/getContext/getUILib.js.map +1 -1
- package/out/natural/getContext/index.d.ts +34 -25
- package/out/natural/getContext/index.js +304 -157
- package/out/natural/getContext/index.js.map +1 -1
- package/out/natural/index.d.ts +1 -0
- package/out/natural/index.js +1 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/tools.d.ts +11 -0
- package/out/natural/tools.js +155 -0
- package/out/natural/tools.js.map +1 -0
- package/out/natural/transformTS2UI.js +84 -22
- package/out/natural/transformTS2UI.js.map +1 -1
- package/out/natural/transformTSCode.js +83 -22
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/formatTsUtils.js +17 -1
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +1 -4
- package/out/server/getLogics.js.map +1 -1
- package/out/server/naslServer.js +285 -32
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +5 -1
- package/out/server/translator.js.map +1 -1
- package/out/templator/genCreateBlock.js +5 -18
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +11 -32
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -2
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +6 -4
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +82 -59
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +4 -4
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -15
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +1 -1
- package/out/templator/utils.js +1 -1
- package/out/templator/utils.js.map +1 -1
- package/out/translator/types.d.ts +4 -0
- package/out/translator/utils.d.ts +1 -0
- package/out/translator/utils.js +6 -1
- package/out/translator/utils.js.map +1 -1
- package/out/utils/env.d.ts +4 -0
- package/out/utils/env.js +6 -3
- package/out/utils/env.js.map +1 -1
- package/out/utils/index.d.ts +19 -0
- package/out/utils/index.js +61 -1
- package/out/utils/index.js.map +1 -1
- package/out/utils/language-cache/constant.d.ts +18 -0
- package/out/utils/language-cache/constant.js +35 -0
- package/out/utils/language-cache/constant.js.map +1 -0
- package/out/utils/language-cache/index.d.ts +2 -0
- package/out/utils/language-cache/index.js +19 -0
- package/out/utils/language-cache/index.js.map +1 -0
- package/out/utils/language-cache/nasl.d.ts +10 -0
- package/out/utils/language-cache/nasl.js +98 -0
- package/out/utils/language-cache/nasl.js.map +1 -0
- package/out/utils/language-cache/types.d.ts +44 -0
- package/out/utils/language-cache/types.js +4 -0
- package/out/utils/language-cache/types.js.map +1 -0
- package/out/utils/time-slicing/controller.js.map +1 -1
- package/out/utils/types.d.ts +17 -0
- package/package.json +3 -2
- package/sandbox/stdlib/nasl.core.ts +15 -11
- package/sandbox/stdlib/nasl.oql.ts +5 -1
- package/sandbox/stdlib/nasl.processV2.ts +5 -4
- package/sandbox/stdlib/nasl.ui.components.pc.ts +225 -225
- package/sandbox/stdlib/nasl.ui.ts +10 -0
- package/sandbox/stdlib/nasl.util.ts +11 -0
- package/sandbox/stdlib/nasl.validation.ts +3 -2
- package/sandbox-natural/stdlib/nasl.ui.pre.d.ts +1 -1
- package/sandbox-natural/stdlib/nasl.ui.ts +2 -2
- package/sandbox-natural/stdlib/nasl.util.ts +2 -2
- package/src/automate/engine/utils.js +1 -2
- package/src/bak/translator.js +1 -1
- package/src/common/BaseNode.ts +7 -3
- package/src/concepts/App__.ts +9 -1
- package/src/concepts/Argument__.ts +10 -5
- package/src/concepts/AuthLogicForCallInterface__.ts +3 -0
- package/src/concepts/BinaryExpression__.ts +46 -2
- package/src/concepts/BindAttribute__.ts +144 -46
- package/src/concepts/BindEvent__.ts +8 -47
- package/src/concepts/BusinessComponent__.ts +17 -0
- package/src/concepts/BusinessLogic__.ts +3 -0
- package/src/concepts/CallConnector__.ts +1 -1
- package/src/concepts/CallFunction__.ts +1 -1
- package/src/concepts/CallLogic__.ts +63 -17
- package/src/concepts/Connection__.ts +16 -0
- package/src/concepts/DatabaseTypeAnnotation__.ts +11 -0
- package/src/concepts/End__.ts +5 -1
- package/src/concepts/EntityProperty__.ts +5 -0
- package/src/concepts/Entity__.ts +29 -1
- package/src/concepts/EnumItem__.ts +64 -1
- package/src/concepts/Enum__.ts +6 -1
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/FrontendLibrary__.ts +78 -80
- package/src/concepts/I18nInfo__.ts +5 -0
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Interface__.ts +6 -1
- package/src/concepts/Logic__.ts +39 -10
- package/src/concepts/MatchCase__.ts +8 -9
- package/src/concepts/NewComposite__.ts +2 -1
- package/src/concepts/NewList__.ts +2 -1
- package/src/concepts/NewMap__.ts +2 -1
- package/src/concepts/OqlQueryComponent__.ts +3 -11
- package/src/concepts/OverriddenLogic__.ts +7 -0
- package/src/concepts/Param__.ts +1 -0
- package/src/concepts/ProcessElementV2__.ts +14 -16
- package/src/concepts/ProcessElement__.ts +16 -16
- package/src/concepts/ProcessV2__.ts +39 -3
- package/src/concepts/Process__.ts +36 -0
- package/src/concepts/QueryFromExpression__.ts +2 -2
- package/src/concepts/QueryJoinExpression__.ts +2 -2
- package/src/concepts/Return__.ts +2 -1
- package/src/concepts/StaticString__.ts +12 -0
- package/src/concepts/StructureProperty__.ts +7 -2
- package/src/concepts/Structure__.ts +11 -3
- package/src/concepts/SubLogic__.ts +15 -9
- package/src/concepts/Transactional__.ts +5 -0
- package/src/concepts/TypeParam__.ts +6 -0
- package/src/concepts/ValidationRule__.ts +7 -6
- package/src/concepts/Variable__.ts +7 -2
- package/src/concepts/ViewElement__.ts +130 -47
- package/src/concepts/View__.ts +157 -8
- package/src/concepts/basics/stdlib/nasl.processV2.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.ui.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.validation.ts +111 -4
- package/src/generator/genBundleFiles.ts +53 -39
- package/src/generator/genMetaData.ts +21 -26
- package/src/generator/release-body/body.ts +9 -6
- package/src/generator/release-body/index.ts +1 -0
- package/src/generator/release-body/utils.ts +4 -2
- package/src/natural/genNaturalTS.ts +327 -141
- package/src/natural/getContext/getUILib.ts +4 -2
- package/src/natural/getContext/index.ts +348 -171
- package/src/natural/index.ts +1 -0
- package/src/natural/tools.ts +130 -0
- package/src/natural/transformTS2UI.ts +84 -22
- package/src/natural/transformTSCode.ts +83 -22
- package/src/server/formatTsUtils.ts +21 -1
- package/src/server/getLogics.ts +1 -4
- package/src/server/naslServer.ts +302 -33
- package/src/server/translator.ts +5 -1
- package/src/templator/genCreateBlock.ts +5 -18
- package/src/templator/genCurdMultipleKeyBlock.ts +14 -32
- package/src/templator/genGetBlock.ts +2 -4
- package/src/templator/genListViewBlock.ts +6 -4
- package/src/templator/genSelectBlock.ts +88 -61
- package/src/templator/genTableBlock.ts +4 -4
- package/src/templator/genUpdateBlock.ts +2 -15
- package/src/templator/utils.ts +1 -1
- package/src/translator/types.ts +4 -0
- package/src/translator/utils.ts +6 -0
- package/src/utils/env.ts +5 -4
- package/src/utils/index.ts +50 -1
- package/src/utils/language-cache/constant.ts +37 -0
- package/src/utils/language-cache/index.ts +2 -0
- package/src/utils/language-cache/nasl.ts +83 -0
- package/src/utils/language-cache/types.ts +48 -0
- package/src/utils/time-slicing/controller.ts +0 -1
- package/src/utils/types.ts +20 -0
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +13 -13
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +12 -12
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -2
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +221 -217
- package/ts-worker/bundle.js +1 -1
- package/ts-worker/src/index.js +0 -1
- package/out/utils/delay/index.d.ts +0 -0
- package/out/utils/delay/index.js +0 -1
- package/out/utils/delay/index.js.map +0 -1
- package/src/utils/delay/index.ts +0 -0
|
@@ -81,6 +81,7 @@ function genArgumentMemberExpression(arr: string[]) {
|
|
|
81
81
|
export interface ElementToVueOptions {
|
|
82
82
|
filterAttr?: Array<string>;
|
|
83
83
|
isExport?: boolean;
|
|
84
|
+
isRelease?: boolean;
|
|
84
85
|
isRoot?: boolean;
|
|
85
86
|
asCompontent?: boolean;
|
|
86
87
|
indentStyle?: 'space' | 'tab';
|
|
@@ -1633,31 +1634,44 @@ export class ViewElement extends Annotatable {
|
|
|
1633
1634
|
let levelIndex = parentLevel || 0;
|
|
1634
1635
|
code += `${self.name}: () => {\n`;
|
|
1635
1636
|
|
|
1636
|
-
const
|
|
1637
|
-
let
|
|
1637
|
+
const getMultipleDefaultValue = (name: string) => {
|
|
1638
|
+
let v = 'new nasl.core.BooleanFalse()';
|
|
1638
1639
|
const attr = self.bindAttrs?.find((attr) => attr.name === name);
|
|
1639
1640
|
if (['static', 'string'].includes(attr?.type)) {
|
|
1640
|
-
|
|
1641
|
-
} else if (['dynamic'].includes(attr?.type)) {
|
|
1642
|
-
t = 'nasl.core.Boolean';
|
|
1643
|
-
} else {
|
|
1644
|
-
t = false;
|
|
1641
|
+
v = attr.value ? 'new nasl.core.BooleanTrue()' : 'new nasl.core.BooleanFalse()';
|
|
1645
1642
|
}
|
|
1646
1643
|
|
|
1647
|
-
return
|
|
1644
|
+
return v;
|
|
1648
1645
|
};
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1651
|
-
|
|
1646
|
+
const getConverterDefaultValue = (name: string) => {
|
|
1647
|
+
let v = 'new nasl.core.StringLiteral<\`\`>()';
|
|
1648
|
+
const attr = self.bindAttrs?.find((attr) => attr.name === name);
|
|
1649
|
+
if (['static', 'string'].includes(attr?.type)) {
|
|
1650
|
+
if ([true, 'true'].includes(attr.value)) {
|
|
1651
|
+
v = 'new nasl.core.BooleanTrue()';
|
|
1652
|
+
} else if ([false, 'false'].includes(attr.value)) {
|
|
1653
|
+
v = 'new nasl.core.BooleanFalse()';
|
|
1654
|
+
} else {
|
|
1655
|
+
v = `new nasl.core.StringLiteral<\`${attr.value}\`>()`;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
return v;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
const hasDataSource = config?.allNodesAPI?.[self.tag]?.props?.findIndex((prop) => ['dataSource', 'data-source'].includes(prop.name)) > -1;
|
|
1663
|
+
let dataSourceSetted = false;
|
|
1664
|
+
let staticItem = '';
|
|
1652
1665
|
// 有数据源属性的组件 才需要生成 item
|
|
1653
1666
|
if (hasDataSource && T) {
|
|
1654
1667
|
const key = T1 ? '__columnItem' : '__item';
|
|
1655
1668
|
const dataSourceAttr = self.bindAttrs?.find((attr) => attr.name === 'dataSource');
|
|
1656
1669
|
if (dataSourceAttr?.expression) {
|
|
1670
|
+
dataSourceSetted = true;
|
|
1657
1671
|
if (
|
|
1658
1672
|
asserts.isMemberExpression(dataSourceAttr.expression) ||
|
|
1659
1673
|
asserts.isIdentifier(dataSourceAttr.expression) ||
|
|
1660
|
-
asserts.isCallLogic(dataSourceAttr.expression)
|
|
1674
|
+
(asserts.isCallLogic(dataSourceAttr.expression) && !dataSourceAttr.expression?.calleeNamespace?.startsWith('extensions'))
|
|
1661
1675
|
) {
|
|
1662
1676
|
const value = yield* dataSourceAttr.expression.toEmbeddedTS(
|
|
1663
1677
|
shiftState(
|
|
@@ -1711,40 +1725,80 @@ export class ViewElement extends Annotatable {
|
|
|
1711
1725
|
code += `let ${key}: nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof _load>>;\n`;
|
|
1712
1726
|
}
|
|
1713
1727
|
} else {
|
|
1714
|
-
|
|
1728
|
+
// 根据静态子节点生成类型
|
|
1729
|
+
const attrs: Record<string, string> = {
|
|
1730
|
+
'u-checkbox': 'label',
|
|
1731
|
+
'u-radio': 'label',
|
|
1732
|
+
'van-radio': 'name',
|
|
1733
|
+
'van-checkbox': 'label',
|
|
1734
|
+
}
|
|
1735
|
+
const child = self.children?.filter((item) => item.tag !== 'template')[0];
|
|
1736
|
+
if (child as ViewElement) {
|
|
1737
|
+
const valueAttr = child.bindAttrs?.find((attr) => attr.name === (attrs[child.tag] || 'value'));
|
|
1738
|
+
if (valueAttr) {
|
|
1739
|
+
// 开启了绑定
|
|
1740
|
+
if (valueAttr.expression) {
|
|
1741
|
+
const attrCode = yield* valueAttr.expression.toEmbeddedTS(shiftState(state, '', { tabSize: 0 }));
|
|
1742
|
+
staticItem = `${attrCode}`;
|
|
1743
|
+
} else {
|
|
1744
|
+
try {
|
|
1745
|
+
if (valueAttr.type === 'static') {
|
|
1746
|
+
const value = json5.parse(valueAttr.value);
|
|
1747
|
+
const map: Record<string, string> = {
|
|
1748
|
+
'string': 'new nasl.core.String("")',
|
|
1749
|
+
'number': 'new nasl.core.Long(1)',
|
|
1750
|
+
'boolean': 'new nasl.core.Boolean(false)',
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
staticItem = map[typeof value] || 'new nasl.core.String("")';
|
|
1754
|
+
} else {
|
|
1755
|
+
staticItem = 'new nasl.core.String("")';
|
|
1756
|
+
}
|
|
1757
|
+
} catch (error) {
|
|
1758
|
+
// @ts-ignore
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
} else {
|
|
1762
|
+
staticItem = 'new nasl.core.String("")';
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
code += `let __staticItem = ${staticItem};\n`;
|
|
1766
|
+
code += `let ${key}: typeof __staticItem;\n`;
|
|
1715
1767
|
}
|
|
1716
1768
|
}
|
|
1717
1769
|
// 值
|
|
1718
1770
|
let valueType: string;
|
|
1719
1771
|
if (hasDataSource && V && !T1) {
|
|
1720
1772
|
const valueFieldAttr = self.bindAttrs?.find((attr) => attr.name === 'valueField');
|
|
1721
|
-
if (['static', 'string'].includes(valueFieldAttr?.type)) {
|
|
1773
|
+
if (dataSourceSetted && ['static', 'string'].includes(valueFieldAttr?.type)) {
|
|
1722
1774
|
valueType = `typeof __item.${valueFieldAttr.value}`;
|
|
1723
1775
|
} else {
|
|
1724
|
-
valueType =
|
|
1776
|
+
valueType = `typeof __staticItem`;
|
|
1725
1777
|
}
|
|
1726
1778
|
}
|
|
1727
1779
|
// 分页
|
|
1728
|
-
let
|
|
1780
|
+
let pageableDefaultValue: string;
|
|
1729
1781
|
if (hasDataSource && P && !T1) {
|
|
1730
|
-
|
|
1731
|
-
code += `let __pageable
|
|
1782
|
+
pageableDefaultValue = getMultipleDefaultValue('pageable');
|
|
1783
|
+
code += `let __pageable = ${pageableDefaultValue};\n`;
|
|
1732
1784
|
}
|
|
1733
1785
|
// 多选
|
|
1734
|
-
let
|
|
1786
|
+
let multipleDefaultValue: string;
|
|
1735
1787
|
if (hasDataSource && M && !T1) {
|
|
1736
|
-
|
|
1737
|
-
code += `let __multiple
|
|
1788
|
+
multipleDefaultValue = getMultipleDefaultValue('multiple');
|
|
1789
|
+
code += `let __multiple = ${multipleDefaultValue};\n`;
|
|
1738
1790
|
}
|
|
1739
1791
|
if (hasDataSource && V && !T1) {
|
|
1740
1792
|
code += `// @ts-ignore
|
|
1741
|
-
let __value:
|
|
1793
|
+
let __value: typeof __multiple extends nasl.core.BooleanTrue ? ${valueType}[] : ${valueType};\n`;
|
|
1742
1794
|
code += `// @ts-ignore
|
|
1743
1795
|
let __V: ${valueType};\n`;
|
|
1744
1796
|
}
|
|
1797
|
+
|
|
1798
|
+
let converterDefaultValue: string;
|
|
1745
1799
|
if (C) {
|
|
1746
|
-
|
|
1747
|
-
code += `let __converter
|
|
1800
|
+
converterDefaultValue = getConverterDefaultValue('converter');
|
|
1801
|
+
code += `let __converter = ${converterDefaultValue};\n`;
|
|
1748
1802
|
}
|
|
1749
1803
|
|
|
1750
1804
|
if (self.tag === 'template' && self.haveScope() && asserts.isViewElement(self.parentNode)) {
|
|
@@ -2055,12 +2109,10 @@ export class ViewElement extends Annotatable {
|
|
|
2055
2109
|
return;
|
|
2056
2110
|
}
|
|
2057
2111
|
|
|
2058
|
-
let attrCode = yield* attr.toEmbeddedTS(shiftState(state, code, { tabSize: 1 }));
|
|
2112
|
+
let attrCode = yield* attr.toEmbeddedTS(shiftState(state, code, { tabSize: 1 }), { carryName: true });
|
|
2059
2113
|
|
|
2060
2114
|
if (attrCode.trim()) {
|
|
2061
|
-
|
|
2062
|
-
code += `${humpName}: `;
|
|
2063
|
-
attrCode = yield* attr.toEmbeddedTS(shiftState(state, code, { tabSize: 1 }));
|
|
2115
|
+
attrCode = yield* attr.toEmbeddedTS(shiftState(state, code, { tabSize: 1 }), { carryName: true });
|
|
2064
2116
|
code += attrCode;
|
|
2065
2117
|
code += `,\n`;
|
|
2066
2118
|
}
|
|
@@ -2149,7 +2201,8 @@ export class ViewElement extends Annotatable {
|
|
|
2149
2201
|
const param = hasScope ? `current${levelIndex === 0 ? '' : levelIndex}` : '';
|
|
2150
2202
|
const levelIndexDelta = Number(hasScope);
|
|
2151
2203
|
code += `slotDefault: (${param}) => [\n`;
|
|
2152
|
-
|
|
2204
|
+
const defaultArr = self.shouldHandleChildren(self) ? children : [];
|
|
2205
|
+
yield* wrapForEach(defaultArr, function* warpForEachGenerator(element) {
|
|
2153
2206
|
code += yield* element.toEmbeddedTS(
|
|
2154
2207
|
shiftState(state, code, {
|
|
2155
2208
|
tabSize: (state?.tabSize || 0) + 2,
|
|
@@ -2173,6 +2226,29 @@ export class ViewElement extends Annotatable {
|
|
|
2173
2226
|
return code;
|
|
2174
2227
|
}
|
|
2175
2228
|
|
|
2229
|
+
shouldHandleChildren(element: ViewElement) {
|
|
2230
|
+
// 数据源与静态子节点不共存的组件
|
|
2231
|
+
const tags = [
|
|
2232
|
+
'u-tabs',
|
|
2233
|
+
'u-selectable-steps',
|
|
2234
|
+
'van-swipe',
|
|
2235
|
+
'van-steps',
|
|
2236
|
+
]; // 数据源与静态子节点不共存的组件
|
|
2237
|
+
|
|
2238
|
+
// 判断当前是否配置了数据源
|
|
2239
|
+
const isDataSourceConfigured = () => element.bindAttrs.some((attr) => {
|
|
2240
|
+
if (['data-source', 'dataSource'].includes(attr.name)) {
|
|
2241
|
+
if (attr.type === 'dynamic' && attr.expression) {
|
|
2242
|
+
return true;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
return false;
|
|
2247
|
+
})
|
|
2248
|
+
|
|
2249
|
+
return !tags.includes(element.tag) || !isDataSourceConfigured();
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2176
2252
|
@withSourceMap()
|
|
2177
2253
|
toNaturalTS(state = createCompilerState(), parentLevel?: number): string {
|
|
2178
2254
|
let code = '';
|
|
@@ -2306,6 +2382,7 @@ export class ViewElement extends Annotatable {
|
|
|
2306
2382
|
}),
|
|
2307
2383
|
// levelIndex,
|
|
2308
2384
|
);
|
|
2385
|
+
code += ',\n';
|
|
2309
2386
|
});
|
|
2310
2387
|
|
|
2311
2388
|
code += `${indent(state.tabSize + 1)}] },\n`;
|
|
@@ -2315,15 +2392,16 @@ export class ViewElement extends Annotatable {
|
|
|
2315
2392
|
});
|
|
2316
2393
|
// 翻译其余的子集
|
|
2317
2394
|
if (defaultArr.length) {
|
|
2318
|
-
throw new Error('多个插槽必须都在 template 内');
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2395
|
+
// throw new Error('多个插槽必须都在 template 内');
|
|
2396
|
+
defaultArr.forEach((element) => {
|
|
2397
|
+
code += element.toTextualNASL(
|
|
2398
|
+
shiftState(state, code, {
|
|
2399
|
+
tabSize: state.tabSize,
|
|
2400
|
+
}),
|
|
2401
|
+
// levelIndex,
|
|
2402
|
+
);
|
|
2403
|
+
code += ',\n';
|
|
2404
|
+
});
|
|
2327
2405
|
}
|
|
2328
2406
|
} else {
|
|
2329
2407
|
if (this.children.length) {
|
|
@@ -3079,7 +3157,7 @@ export class ViewElement extends Annotatable {
|
|
|
3079
3157
|
})
|
|
3080
3158
|
}
|
|
3081
3159
|
if (
|
|
3082
|
-
options?.isExport &&
|
|
3160
|
+
(options?.isExport || options?.isRelease )&&
|
|
3083
3161
|
attr?.concept === 'BindAttribute' &&
|
|
3084
3162
|
attr?.name === 'src' &&
|
|
3085
3163
|
/^\/assets\/(.*?)$/.test(attr?.value) &&
|
|
@@ -3119,7 +3197,6 @@ export class ViewElement extends Annotatable {
|
|
|
3119
3197
|
argsList,
|
|
3120
3198
|
dataRefList,
|
|
3121
3199
|
};
|
|
3122
|
-
// debugger
|
|
3123
3200
|
// 所有参数序列化之后当字符串传进指令参数 (目前不支持<div v-demo="{ color: 'white', text: 'hello!' }"></div>
|
|
3124
3201
|
let expression = StringLiteral.from({
|
|
3125
3202
|
concept: 'StringLiteral',
|
|
@@ -3150,22 +3227,24 @@ export class ViewElement extends Annotatable {
|
|
|
3150
3227
|
ve?.bindAttrs?.find((attr: any) => {
|
|
3151
3228
|
let type = attr?.expression?.object?.__TypeAnnotation;
|
|
3152
3229
|
if (type) {
|
|
3153
|
-
console.log('type: ', type);
|
|
3154
3230
|
let { typeKind, typeName, typeNamespace } = type || {};
|
|
3155
|
-
|
|
3156
|
-
if (typeKind === 'anonymousStructure') {
|
|
3231
|
+
if (typeKind === 'anonymousStructure') {
|
|
3157
3232
|
let parent: any =
|
|
3158
3233
|
this.getAncestorByTag('ViewElement', 'u-table-view') ||
|
|
3159
3234
|
this.getAncestorByTag('ViewElement', 'u-list-view') ||
|
|
3160
3235
|
this.getAncestorByTag('ViewElement', 'u-grid-view') ||
|
|
3161
3236
|
this.getAncestorByTag('ViewElement', 'van-grid-view') ||
|
|
3162
3237
|
this.getAncestorByTag('ViewElement', 'van-list-view');
|
|
3163
|
-
|
|
3238
|
+
let canAdd = parent?.tag
|
|
3239
|
+
if(isGridViewLayout ||isListViewLayout){
|
|
3240
|
+
let nestLinearLayout = this.children.find(c=>c.tag ==='u-linear-layout')
|
|
3241
|
+
canAdd = canAdd && !nestLinearLayout
|
|
3242
|
+
}
|
|
3243
|
+
if (canAdd) {
|
|
3164
3244
|
let dataSourceAttr = parent?.bindAttrs?.find((it: any) => it?.name === 'dataSource');
|
|
3165
3245
|
if (dataSourceAttr?.expression?.concept === 'CallLogic') {
|
|
3166
3246
|
if (dataSourceAttr?.expression?.calleeNamespace === 'app.logics') {
|
|
3167
3247
|
logicName = dataSourceAttr?.expression?.calleeName;
|
|
3168
|
-
// debugger
|
|
3169
3248
|
let ref = {
|
|
3170
3249
|
typeNamespace: 'app.logics',
|
|
3171
3250
|
typeName: logicName,
|
|
@@ -3202,11 +3281,15 @@ export class ViewElement extends Annotatable {
|
|
|
3202
3281
|
const addDataRefDriective = (ve: ViewElement) => {
|
|
3203
3282
|
ve?.bindAttrs?.find((attr: any) => {
|
|
3204
3283
|
let type = attr?.expression?.object?.__TypeAnnotation;
|
|
3205
|
-
|
|
3284
|
+
let canAdd = type
|
|
3285
|
+
if(isGridViewLayout || isListViewLayout){
|
|
3286
|
+
let nestLinearLayout = this.children.find(c=>c.tag ==='u-linear-layout')
|
|
3287
|
+
canAdd = canAdd && !nestLinearLayout
|
|
3288
|
+
}
|
|
3289
|
+
if (canAdd) {
|
|
3206
3290
|
let { typeKind, typeName, typeNamespace } = type || {};
|
|
3207
3291
|
if (typeKind === 'reference' && typeNamespace) {
|
|
3208
3292
|
let entityPropName = attr?.expression?.property?.name;
|
|
3209
|
-
// debugger;
|
|
3210
3293
|
let ref = {
|
|
3211
3294
|
typeNamespace,
|
|
3212
3295
|
typeName,
|
package/src/concepts/View__.ts
CHANGED
|
@@ -31,6 +31,8 @@ import type Interface from './Interface__'; // 临时记录删除的页面元素
|
|
|
31
31
|
import { getNodeByNodeCallee } from '../automate/engine/utils.js'; // 临时记录删除的页面元素计数的最大值
|
|
32
32
|
import type LogicItem from './LogicItem__';
|
|
33
33
|
import type CallFunction from './CallFunction__';
|
|
34
|
+
import type BaseNode from '../common/BaseNode';
|
|
35
|
+
import type SubLogic from './SubLogic__';
|
|
34
36
|
|
|
35
37
|
import App from './App__';
|
|
36
38
|
import Module from './Module__';
|
|
@@ -1661,6 +1663,93 @@ export class View extends Annotatable {
|
|
|
1661
1663
|
}
|
|
1662
1664
|
}
|
|
1663
1665
|
|
|
1666
|
+
mergeDefinitions2(code: string) {
|
|
1667
|
+
const Logic = getConceptConstructor('Logic');
|
|
1668
|
+
const Param = getConceptConstructor('Param');
|
|
1669
|
+
const Variable = getConceptConstructor('Variable');
|
|
1670
|
+
const BindEvent = getConceptConstructor('BindEvent');
|
|
1671
|
+
const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
|
|
1672
|
+
const definition: any = JSON.parse(definitionStr);
|
|
1673
|
+
// 服务端逻辑
|
|
1674
|
+
if (Array.isArray(definition.logics)) {
|
|
1675
|
+
definition.logics.forEach((logicOption: any) => {
|
|
1676
|
+
const logic = Logic.from(
|
|
1677
|
+
{
|
|
1678
|
+
...logicOption,
|
|
1679
|
+
},
|
|
1680
|
+
this.rootNode,
|
|
1681
|
+
'logics',
|
|
1682
|
+
);
|
|
1683
|
+
(this.rootNode as App).addLogic(logic);
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
// 全局结构体
|
|
1688
|
+
if (Array.isArray(definition.structures)) {
|
|
1689
|
+
definition.structures.forEach((structureOption: any) => {
|
|
1690
|
+
const structure = Structure.from(
|
|
1691
|
+
{
|
|
1692
|
+
...structureOption,
|
|
1693
|
+
},
|
|
1694
|
+
this.rootNode,
|
|
1695
|
+
'structures',
|
|
1696
|
+
);
|
|
1697
|
+
(this.rootNode as App).addStructure(structure);
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
// 页面入参
|
|
1702
|
+
if (Array.isArray(definition.viewParams)) {
|
|
1703
|
+
definition.viewParams.forEach((paramsOption: any) => {
|
|
1704
|
+
const param = Param.from(
|
|
1705
|
+
{
|
|
1706
|
+
...paramsOption,
|
|
1707
|
+
},
|
|
1708
|
+
this,
|
|
1709
|
+
'params',
|
|
1710
|
+
);
|
|
1711
|
+
this.addParam(param);
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
// 页面变量
|
|
1715
|
+
if (Array.isArray(definition.viewVariables)) {
|
|
1716
|
+
definition.viewVariables.forEach((variableOption: any) => {
|
|
1717
|
+
const variable = Variable.from(
|
|
1718
|
+
{
|
|
1719
|
+
...variableOption,
|
|
1720
|
+
},
|
|
1721
|
+
this,
|
|
1722
|
+
'variables',
|
|
1723
|
+
);
|
|
1724
|
+
this.addVariable(variable);
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
// 页面事件
|
|
1729
|
+
if (Array.isArray(definition.viewBindEvents)) {
|
|
1730
|
+
definition.viewBindEvents.forEach((eventOption: any) => {
|
|
1731
|
+
const newLogic = definition.viewLogics.find((logic: Logic) => eventOption.calleeName === logic.name);
|
|
1732
|
+
const bindEvent = this.bindEvents.find((currentEventItem) => currentEventItem.name === eventOption.name);
|
|
1733
|
+
|
|
1734
|
+
// 如果没有event对象就先新增一个,如果已经有了就在内部添加logic
|
|
1735
|
+
if (!bindEvent) {
|
|
1736
|
+
const event = BindEvent.from(
|
|
1737
|
+
{
|
|
1738
|
+
...eventOption,
|
|
1739
|
+
calleeName: '',
|
|
1740
|
+
logics: [newLogic],
|
|
1741
|
+
},
|
|
1742
|
+
this,
|
|
1743
|
+
'bindEvents',
|
|
1744
|
+
);
|
|
1745
|
+
this.addBindEvent(event);
|
|
1746
|
+
} else {
|
|
1747
|
+
bindEvent.addLogic(newLogic);
|
|
1748
|
+
}
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1664
1753
|
onChange($event?: EventPayload): void {
|
|
1665
1754
|
this.emit('change', $event);
|
|
1666
1755
|
}
|
|
@@ -1788,7 +1877,8 @@ export class View extends Annotatable {
|
|
|
1788
1877
|
};\n`;
|
|
1789
1878
|
code += keyboardEventMixinCode;
|
|
1790
1879
|
const processDetailFrom: ViewElement = this.getViewProcessForm(),
|
|
1791
|
-
hasProcessDetailFrom = !!processDetailFrom,
|
|
1880
|
+
hasProcessDetailFrom = !!processDetailFrom,
|
|
1881
|
+
processV2 = this.getDestinationProcessV2();
|
|
1792
1882
|
if (hasProcessDetailFrom) {
|
|
1793
1883
|
const processDetailFromMixinCode = `const processDetailFromMixin = {
|
|
1794
1884
|
data() {
|
|
@@ -1874,13 +1964,7 @@ export class View extends Annotatable {
|
|
|
1874
1964
|
}
|
|
1875
1965
|
},
|
|
1876
1966
|
methods:{
|
|
1877
|
-
|
|
1878
|
-
...Object.keys(vmRoot).reduce((acc, cur) => {
|
|
1879
|
-
if (cur.includes('handleDataSourceLoad')) {
|
|
1880
|
-
acc[cur] = vmRoot[cur]
|
|
1881
|
-
}
|
|
1882
|
-
return acc
|
|
1883
|
-
}, {}),
|
|
1967
|
+
..._self.$options.methods
|
|
1884
1968
|
}
|
|
1885
1969
|
}).$mount()
|
|
1886
1970
|
var parentElement = container.parentNode
|
|
@@ -2095,6 +2179,8 @@ export class View extends Annotatable {
|
|
|
2095
2179
|
@withSourceMapGenerator
|
|
2096
2180
|
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
2097
2181
|
const self = this;
|
|
2182
|
+
// 获取所有子节点用于树上填充
|
|
2183
|
+
self.getSubLogics();
|
|
2098
2184
|
function chineseTsName(name: string) {
|
|
2099
2185
|
let tsName = name;
|
|
2100
2186
|
// 匹配所有特殊字符都转为_
|
|
@@ -2131,6 +2217,9 @@ export class View extends Annotatable {
|
|
|
2131
2217
|
// 内置函数对集合类型的推导
|
|
2132
2218
|
(asserts.isCallFunction(el) && el.derivablecollection?.name))
|
|
2133
2219
|
) {
|
|
2220
|
+
if (el?.getAncestor('SubLogic')) {
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2134
2223
|
// 子页面内部逻辑过滤
|
|
2135
2224
|
if (el.view !== self) return;
|
|
2136
2225
|
if (asserts.isAssignment(el)) {
|
|
@@ -2789,6 +2878,10 @@ export class View extends Annotatable {
|
|
|
2789
2878
|
const calleeLogic = this.app.logics.find((l) => l.name === calleeName);
|
|
2790
2879
|
return calleeLogic ? `app.logics.${calleeName}(${calleeLogic.params.map(() => 'null').join(',')})` : null;
|
|
2791
2880
|
}
|
|
2881
|
+
// 调用依赖库逻辑可能会有子逻辑,子逻辑拼接可能有ts忽略先去掉
|
|
2882
|
+
if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace?.startsWith('extensions.')) {
|
|
2883
|
+
code = code.replaceAll('// @ts-ignore', '');
|
|
2884
|
+
}
|
|
2792
2885
|
|
|
2793
2886
|
// view 局部变量,申明提升前增加判断,使用 logic 内的 result 直接替换成对应 logic,logic 内部变量替换成 null
|
|
2794
2887
|
if (logicRtn && code.includes(logicRtn.name)) {
|
|
@@ -2965,6 +3058,54 @@ export class View extends Annotatable {
|
|
|
2965
3058
|
};
|
|
2966
3059
|
}
|
|
2967
3060
|
|
|
3061
|
+
subLogics: Array<SubLogic> = [];
|
|
3062
|
+
|
|
3063
|
+
getSubLogics() {
|
|
3064
|
+
const subLogics = this.findNaslNodeByBFS((node: BaseNode) => {
|
|
3065
|
+
if (asserts.isSubLogic(node)) {
|
|
3066
|
+
// 仅仅是为了处理数据源中的子逻辑,Logic 下面的,交由Logic 自己处理
|
|
3067
|
+
if (node?.getAncestor('Logic')) {
|
|
3068
|
+
return false;
|
|
3069
|
+
}
|
|
3070
|
+
return true;
|
|
3071
|
+
}
|
|
3072
|
+
});
|
|
3073
|
+
this.subLogics = subLogics as Array<SubLogic>;
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
existingSubLogic: Set<string> = new Set<string>();
|
|
3077
|
+
|
|
3078
|
+
collectExistSubLogic() {
|
|
3079
|
+
const existSubLogics: SubLogic[] = [];
|
|
3080
|
+
this.findNaslNodeByBFS((node: BaseNode) => {
|
|
3081
|
+
if (asserts.isSubLogic(node)) {
|
|
3082
|
+
existSubLogics.push(node);
|
|
3083
|
+
}
|
|
3084
|
+
return false;
|
|
3085
|
+
});
|
|
3086
|
+
return existSubLogics;
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
// 获取当前逻辑中已经存在的子逻辑名称
|
|
3090
|
+
getSubLogicExistingNames(excludedList: Array<SubLogic> = []) {
|
|
3091
|
+
if (!this.existingSubLogic.size) {
|
|
3092
|
+
const subLogics = this.collectExistSubLogic();
|
|
3093
|
+
subLogics.forEach((subLogic) => {
|
|
3094
|
+
if (!excludedList.includes(subLogic)) {
|
|
3095
|
+
this.existingSubLogic.add(subLogic.name);
|
|
3096
|
+
}
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
return Array.from(this.existingSubLogic);
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
getSubLogicUniqueName(name = 'subLogic1', excludedNames: Array<string> = []) {
|
|
3103
|
+
const existingNames = this.getSubLogicExistingNames();
|
|
3104
|
+
const uniqueName = utils.unique(name, existingNames.concat(excludedNames), undefined, false);
|
|
3105
|
+
this.existingSubLogic.add(uniqueName);
|
|
3106
|
+
return uniqueName;
|
|
3107
|
+
}
|
|
3108
|
+
|
|
2968
3109
|
//================================================================================
|
|
2969
3110
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
2970
3111
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -3485,6 +3626,14 @@ export const ComponentCompletionPropertyMap: Record<string, any> = {
|
|
|
3485
3626
|
state: 'currentData',
|
|
3486
3627
|
label: '数据',
|
|
3487
3628
|
},
|
|
3629
|
+
order: {
|
|
3630
|
+
prop: 'sorting',
|
|
3631
|
+
label: '排序方式',
|
|
3632
|
+
},
|
|
3633
|
+
filter:{
|
|
3634
|
+
prop:'filter',
|
|
3635
|
+
label:'筛选条件'
|
|
3636
|
+
},
|
|
3488
3637
|
},
|
|
3489
3638
|
List: {
|
|
3490
3639
|
current: {
|
|
@@ -205,7 +205,7 @@ export function initialize() {
|
|
|
205
205
|
}),
|
|
206
206
|
new StructureProperty({
|
|
207
207
|
name: 'procInstStatus',
|
|
208
|
-
typeAnnotation: TypeAnnotation.createReference('ProcInstStatusEnum', { typeNamespace: 'nasl.processV2' }),
|
|
208
|
+
typeAnnotation: TypeAnnotation.createReference('ProcInstStatusEnum', { typeNamespace: 'nasl.processV2.enums' }),
|
|
209
209
|
}),
|
|
210
210
|
new StructureProperty({
|
|
211
211
|
name: 'procInstCurrNodes',
|
|
@@ -220,7 +220,7 @@ export function initialize() {
|
|
|
220
220
|
],
|
|
221
221
|
}),
|
|
222
222
|
new Structure({
|
|
223
|
-
name: '
|
|
223
|
+
name: 'TaskOperationPermission',
|
|
224
224
|
properties: [
|
|
225
225
|
new StructureProperty({
|
|
226
226
|
name: 'name',
|