@lcap/nasl 2.22.0-beta.0 → 2.22.0-beta.1
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/operators.d.ts +9 -0
- package/out/automate/engine/viewCache.d.ts +1 -0
- package/out/automate/template/myProcess.d.ts +1 -0
- package/out/common/BaseNode.d.ts +1 -0
- package/out/common/BaseNode.js +7 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +78 -12
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +9 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +2 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -0
- package/out/concepts/CallQueryComponent__.js +76 -24
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -0
- package/out/concepts/ConfigProperty__.js +18 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +2 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +7 -2
- package/out/concepts/EntityProperty__.js +100 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -1
- package/out/concepts/Entity__.js +30 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +7 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +53 -0
- package/out/concepts/Integration__.js +143 -0
- package/out/concepts/Integration__.js.map +1 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +42 -0
- package/out/concepts/JavaLogic__.js +122 -0
- package/out/concepts/JavaLogic__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +12 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +11 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +51 -0
- package/out/concepts/MicroApp__.js +113 -0
- package/out/concepts/MicroApp__.js.map +1 -0
- package/out/concepts/Module__.d.ts +20 -9
- package/out/concepts/Module__.js +72 -14
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +1 -1
- package/out/concepts/NewComposite__.js +25 -11
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +1 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +5 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +104 -16
- package/out/concepts/QuerySelectExpression__.js +99 -9
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +2 -2
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +8 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +26 -6
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -1
- package/out/concepts/View__.js +3 -1
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +94 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/config.d.ts +1 -1
- package/out/decorators/index.d.ts +2 -2
- package/out/generator/genBundleFiles.js +20 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +2 -2
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/icestark.d.ts +2 -0
- package/out/generator/icestark.js +48 -0
- package/out/generator/icestark.js.map +1 -0
- package/out/generator/microApp.d.ts +2 -0
- package/out/generator/microApp.js +35 -0
- package/out/generator/microApp.js.map +1 -0
- package/out/generator/permission.d.ts +1 -1
- package/out/generator/permission.js +0 -13
- package/out/generator/permission.js.map +1 -1
- package/out/generator/qiankun.d.ts +2 -0
- package/out/generator/qiankun.js +52 -0
- package/out/generator/qiankun.js.map +1 -0
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/manager/stepRecorder.d.ts +20 -0
- package/out/manager/stepRecorder.js +110 -0
- package/out/manager/stepRecorder.js.map +1 -0
- package/out/sentry/index.d.ts +5 -4
- package/out/sentry/index.js +9 -2
- package/out/sentry/index.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -1
- package/out/server/formatTsUtils.js +40 -14
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +38 -6
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -4
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +3 -3
- package/out/server/getScope.d.ts +1 -1
- package/out/server/naslServer.d.ts +7 -3
- package/out/server/naslServer.js +270 -102
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +25 -7
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +3 -3
- package/out/service/storage/init.js +6 -0
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -6
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genUpdateBlock.js +7 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +16 -0
- package/out/templator/utils.js +2 -0
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.d.ts +1 -1
- package/out/translator/lsp.d.ts +3 -3
- package/out/utils/index.d.ts +4 -4
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.ui.ts +16 -11
- package/sandbox/stdlib/nasl.util.ts +4 -0
- package/sandbox/stdlib/nasl.validation.ts +2 -2
- package/src/automate/upgrader/2.17.js +1 -1
- package/src/common/BaseNode.ts +10 -2
- package/src/concepts/App__.ts +90 -46
- package/src/concepts/CallInterface__.ts +9 -1
- package/src/concepts/CallLogic__.ts +2 -1
- package/src/concepts/CallQueryComponent__.ts +73 -82
- package/src/concepts/ConfigProperty__.ts +18 -1
- package/src/concepts/Destination__.ts +2 -20
- package/src/concepts/EntityProperty__.ts +102 -8
- package/src/concepts/Entity__.ts +31 -8
- package/src/concepts/Identifier__.ts +9 -2
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Integration__.ts +162 -0
- package/src/concepts/JavaLogic__.ts +129 -0
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +12 -45
- package/src/concepts/Match__.ts +10 -5
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/MicroApp__.ts +118 -0
- package/src/concepts/Module__.ts +106 -79
- package/src/concepts/NewComposite__.ts +23 -11
- package/src/concepts/OqlQueryComponent__.ts +1 -1
- package/src/concepts/Param__.ts +3 -0
- package/src/concepts/QueryFieldExpression__.ts +0 -7
- package/src/concepts/QuerySelectExpression__.ts +206 -30
- package/src/concepts/SwitchCase__.ts +2 -2
- package/src/concepts/TypeAnnotation__.ts +8 -42
- package/src/concepts/ViewElement__.ts +24 -6
- package/src/concepts/View__.ts +3 -24
- package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
- package/src/concepts/index__.ts +3 -0
- package/src/generator/genBundleFiles.ts +22 -4
- package/src/generator/genReleaseBody.ts +2 -2
- package/src/generator/icestark.ts +45 -0
- package/src/generator/microApp.ts +32 -0
- package/src/generator/permission.ts +1 -15
- package/src/generator/qiankun.ts +49 -0
- package/src/index.ts +1 -0
- package/src/manager/stepRecorder.ts +112 -0
- package/src/sentry/index.ts +8 -2
- package/src/server/formatTsUtils.ts +42 -14
- package/src/server/getLogics.ts +41 -6
- package/src/server/getMemberIdentifier.ts +5 -4
- package/src/server/naslServer.ts +270 -101
- package/src/server/translator.ts +25 -7
- package/src/service/storage/init.ts +7 -0
- package/src/templator/genCreateBlock.ts +6 -1
- package/src/templator/genQueryComponent.ts +22 -8
- package/src/templator/genUpdateBlock.ts +7 -1
- package/src/templator/utils.ts +2 -0
- package/ts-worker/src/index.js +1 -4
- package/src/manager/history.ts +0 -0
- package/src/manager/problem.ts +0 -0
package/src/server/translator.ts
CHANGED
|
@@ -70,7 +70,7 @@ function transformType(tsType: string): string {
|
|
|
70
70
|
else if (tsType === 'Decimal')
|
|
71
71
|
return '小数';
|
|
72
72
|
else if (tsType === 'Long')
|
|
73
|
-
return '
|
|
73
|
+
return '整数';
|
|
74
74
|
else if (tsType === 'DateTime')
|
|
75
75
|
return '日期时间';
|
|
76
76
|
else if (tsType === 'Date')
|
|
@@ -177,6 +177,11 @@ const TS_RULES: Array<{
|
|
|
177
177
|
result: string;
|
|
178
178
|
transforms?: Array<(str: string) => string>;
|
|
179
179
|
}> = [
|
|
180
|
+
{
|
|
181
|
+
re: /Property '(FrontEnd|BackEnd)(.+?)' is private and only accessible within/,
|
|
182
|
+
result: '找不到配置参数$2',
|
|
183
|
+
transforms: [transformType, transformType],
|
|
184
|
+
},
|
|
180
185
|
{
|
|
181
186
|
re: /Object literal may only specify known properties, and '(.+?)' does not exist in type/,
|
|
182
187
|
result: '当前参数$1,不可用。',
|
|
@@ -394,6 +399,11 @@ const TS_RULES: Array<{
|
|
|
394
399
|
result: '$1推导不出类型!请连线或手动设置',
|
|
395
400
|
transforms: [transformType],
|
|
396
401
|
},
|
|
402
|
+
{
|
|
403
|
+
re: /'(.+?)' refers to a value, but is being used as a type here. Did you mean 'typeof (.+?)'?/,
|
|
404
|
+
result: '$1未初始化!请连线',
|
|
405
|
+
transforms: [transformType],
|
|
406
|
+
},
|
|
397
407
|
];
|
|
398
408
|
|
|
399
409
|
const POST_RULES: Array<{
|
|
@@ -411,7 +421,7 @@ const POST_RULES: Array<{
|
|
|
411
421
|
},
|
|
412
422
|
{
|
|
413
423
|
re: /Long|"Long"/g,
|
|
414
|
-
result: '
|
|
424
|
+
result: '整数',
|
|
415
425
|
},
|
|
416
426
|
{
|
|
417
427
|
re: /Double|"Double"/g,
|
|
@@ -419,7 +429,7 @@ const POST_RULES: Array<{
|
|
|
419
429
|
},
|
|
420
430
|
{
|
|
421
431
|
re: /Decimal|"Decimal"/g,
|
|
422
|
-
result: '
|
|
432
|
+
result: '小数',
|
|
423
433
|
},
|
|
424
434
|
{
|
|
425
435
|
re: /String|"String"/g,
|
|
@@ -462,8 +472,8 @@ export function translateDiagnosticMessage(message: string) {
|
|
|
462
472
|
* @returns
|
|
463
473
|
*/
|
|
464
474
|
export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diagnostic) {
|
|
465
|
-
const text = tsErrorDetail
|
|
466
|
-
let node = minRange
|
|
475
|
+
const text = tsErrorDetail?.originalDiagnostic?.text;
|
|
476
|
+
let node = minRange?.node;
|
|
467
477
|
// 有一些节点报错信息不向外暴露,缺失一些原生标签等等的展示
|
|
468
478
|
if (node instanceof View || node instanceof ViewElement) {
|
|
469
479
|
if (text.startsWith(`'nasl.ui' has no exported member named `)) {
|
|
@@ -551,7 +561,7 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
551
561
|
} else if (node.parentNode instanceof NewMap) {
|
|
552
562
|
if (text.includes(`is not assignable to parameter of type 'None'`)) {
|
|
553
563
|
const cap = /Argument of type '(.+?)' is not assignable to parameter of type '(.+?)'/.exec(text);
|
|
554
|
-
tsErrorDetail.message = tsErrorDetail.message = `参数类型不一致!传入类型:${transformType(cap[1])},接收类型:字符串
|
|
564
|
+
tsErrorDetail.message = tsErrorDetail.message = `参数类型不一致!传入类型:${transformType(cap[1])},接收类型:字符串 或 布尔值 或 整数 或 小数`;
|
|
555
565
|
} else if (text.includes(`parameter of type 'never'`)) {
|
|
556
566
|
tsErrorDetail.message = '自动推导不出类型!newMap中有未知类型';
|
|
557
567
|
}
|
|
@@ -693,6 +703,12 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
693
703
|
}
|
|
694
704
|
}
|
|
695
705
|
}
|
|
706
|
+
if (/Property '(.+?)' is missing in type '(.+?)' but required in type '(.+?)'/.exec(text)) {
|
|
707
|
+
if (node.parentNode instanceof NewComposite) {
|
|
708
|
+
tsErrorDetail.message = tsErrorDetail.message.replace('类型不一致', '接收与传入类型不一致').replace('左边类型', '左边接收类型').replace('右边类型', '右边传入类型');
|
|
709
|
+
tsErrorDetail.message = node.name + tsErrorDetail.message;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
696
712
|
// 参数类型不一致!
|
|
697
713
|
if (/^Type '(.+?)' does not satisfy the constraint '(.+?)'\./.exec(text)) {
|
|
698
714
|
// match
|
|
@@ -749,7 +765,9 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
749
765
|
});
|
|
750
766
|
}
|
|
751
767
|
}
|
|
752
|
-
node
|
|
768
|
+
if (node && tsErrorDetail) {
|
|
769
|
+
node.tsErrorDetail = tsErrorDetail;
|
|
770
|
+
}
|
|
753
771
|
|
|
754
772
|
return {
|
|
755
773
|
node,
|
|
@@ -4,6 +4,7 @@ import { config } from '../../config';
|
|
|
4
4
|
import Vue from 'vue';
|
|
5
5
|
import storageService from './service';
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
|
+
import stepRecorder from '../../manager/stepRecorder';
|
|
7
8
|
/// #if !process.env.NODE_ENV || process.env.BUILD_TARGET === 'node'
|
|
8
9
|
import * as fs from 'fs-extra';
|
|
9
10
|
import * as jsoner from './jsoner';
|
|
@@ -303,6 +304,7 @@ async function doAction(app: any, actionItem: any) {
|
|
|
303
304
|
Vue.prototype.$toast.info(msg);
|
|
304
305
|
app._historying = false;
|
|
305
306
|
}
|
|
307
|
+
stepRecorder.initialized && stepRecorder.record(actionMsg, actionItem, actionList);
|
|
306
308
|
}
|
|
307
309
|
|
|
308
310
|
type Instruct = {
|
|
@@ -618,6 +620,7 @@ export function handleApp(app: any) {
|
|
|
618
620
|
export async function loadApp(appId?: string) {
|
|
619
621
|
let app: App;
|
|
620
622
|
if (config.storage.protocol === 'http') {
|
|
623
|
+
console.time('batchQuery');
|
|
621
624
|
// 请求
|
|
622
625
|
const res = await storageService.batchQuery({
|
|
623
626
|
body: [
|
|
@@ -635,10 +638,14 @@ export async function loadApp(appId?: string) {
|
|
|
635
638
|
shortResponse: false,
|
|
636
639
|
},
|
|
637
640
|
});
|
|
641
|
+
console.timeEnd('batchQuery');
|
|
638
642
|
|
|
639
643
|
tabTimestamp = res?.headers?.tabtimestamp;
|
|
640
644
|
const data = res?.data?.result;
|
|
645
|
+
|
|
646
|
+
console.time('new App');
|
|
641
647
|
app = new App(Object.assign(data?.[0], { id: appId }));
|
|
648
|
+
console.timeEnd('new App');
|
|
642
649
|
if (!app.id) {
|
|
643
650
|
app.id = appId;
|
|
644
651
|
}
|
|
@@ -57,7 +57,12 @@ export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
57
57
|
} else
|
|
58
58
|
return '';
|
|
59
59
|
} else if (propertyTypeName === 'Boolean') {
|
|
60
|
-
formItem +=
|
|
60
|
+
formItem += `
|
|
61
|
+
<u-select clearable v-model="${vModel}" placeholder="请输入${label}">
|
|
62
|
+
<u-select-item :value="true" text="是">是</u-select-item>
|
|
63
|
+
<u-select-item :value="false" text="否">否</u-select-item>
|
|
64
|
+
</u-select>
|
|
65
|
+
`;
|
|
61
66
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
62
67
|
formItem += `<u-number-input v-model="${vModel}" placeholder="请输入${label}"></u-number-input>`;
|
|
63
68
|
} else if (propertyTypeName === 'Double') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as utils from '../utils';
|
|
2
|
-
import { App, Module, Namespace, Entity, Structure, QueryJoinExpression, CallQueryComponent, StructureProperty, DataSource, TypeAnnotation } from '../concepts';
|
|
2
|
+
import { App, Module, Namespace, Entity, Structure, QueryJoinExpression, QueryAggregateExpression, QueryFieldExpression, CallQueryComponent, StructureProperty, DataSource, TypeAnnotation } from '../concepts';
|
|
3
3
|
import { NameGroup, NaslCoreTypeAnnotation, NaslCollectionTypeAnnotation, NaslTypeAnnotation, NaslQueryExpression, NaslLogicItem, NaslNode } from './utils';
|
|
4
4
|
|
|
5
5
|
export function genQueryStructure(allEntities: Array<Entity>, nameGroup: NameGroup) {
|
|
@@ -97,6 +97,23 @@ export function genQueryAssignment(allEntities: Array<Entity>, nameGroup: NameGr
|
|
|
97
97
|
});
|
|
98
98
|
}),
|
|
99
99
|
});
|
|
100
|
+
const selectElements: Array<QueryAggregateExpression | QueryFieldExpression> = [];
|
|
101
|
+
selectElements.push(QueryFieldExpression.from({
|
|
102
|
+
entityAsName: entity.name,
|
|
103
|
+
isDotStar: true,
|
|
104
|
+
}));
|
|
105
|
+
from.joinParts.forEach((joinPart) => {
|
|
106
|
+
selectElements.push(QueryFieldExpression.from({
|
|
107
|
+
entityAsName: joinPart.entityName,
|
|
108
|
+
isDotStar: true,
|
|
109
|
+
}));
|
|
110
|
+
});
|
|
111
|
+
const select = NaslQueryExpression.QuerySelectExpression({
|
|
112
|
+
label: '查询组件Select子句',
|
|
113
|
+
distinct: false,
|
|
114
|
+
star: true,
|
|
115
|
+
selectElements,
|
|
116
|
+
});
|
|
100
117
|
const where: any = supportFilter ? genWhereExpression(entity) : undefined;
|
|
101
118
|
const aStructureProperties = [NaslNode.StructureProperty({
|
|
102
119
|
name: utils.firstLowerCase(entity.name),
|
|
@@ -117,14 +134,11 @@ export function genQueryAssignment(allEntities: Array<Entity>, nameGroup: NameGr
|
|
|
117
134
|
}),
|
|
118
135
|
right: NaslQueryExpression.CallQueryComponent({
|
|
119
136
|
label: '数据查询',
|
|
120
|
-
|
|
137
|
+
// 2.11版本的数据查询,返回类型将自动推断
|
|
138
|
+
// 2.22版本的数据查询,实体支持列筛选,(select.selectElements 会初始化实体对应的 QueryFieldExpression 节点)
|
|
139
|
+
ideVersion: '2.11', // 回滚功能
|
|
121
140
|
typeAnnotation: NaslTypeAnnotation.AnonymousStructure(aStructureProperties),
|
|
122
|
-
select
|
|
123
|
-
label: '查询组件Select子句',
|
|
124
|
-
distinct: false,
|
|
125
|
-
star: true,
|
|
126
|
-
selectElements: [],
|
|
127
|
-
}),
|
|
141
|
+
select,
|
|
128
142
|
from,
|
|
129
143
|
where,
|
|
130
144
|
groupBy: [],
|
|
@@ -57,7 +57,12 @@ export function genUpdateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
57
57
|
} else
|
|
58
58
|
return '';
|
|
59
59
|
} else if (propertyTypeName === 'Boolean') {
|
|
60
|
-
formItem +=
|
|
60
|
+
formItem += `
|
|
61
|
+
<u-select clearable v-model="${vModel}" placeholder="请输入${label}">
|
|
62
|
+
<u-select-item :value="true" text="是">是</u-select-item>
|
|
63
|
+
<u-select-item :value="false" text="否">否</u-select-item>
|
|
64
|
+
</u-select>
|
|
65
|
+
`;
|
|
61
66
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
62
67
|
formItem += `<u-number-input v-model="${vModel}" placeholder="请输入${label}"></u-number-input>`;
|
|
63
68
|
} else if (propertyTypeName === 'Double') {
|
|
@@ -260,6 +265,7 @@ function genLoadLogic(getLogic: Logic, nameGroup: NameGroup) {
|
|
|
260
265
|
});
|
|
261
266
|
}
|
|
262
267
|
|
|
268
|
+
// 生成修改区块
|
|
263
269
|
export function genUpdateBlock(entity: Entity, oldNode: ViewElement) {
|
|
264
270
|
const view = oldNode.view;
|
|
265
271
|
const dataSource = entity.parentNode as DataSource;
|
package/src/templator/utils.ts
CHANGED
|
@@ -228,6 +228,8 @@ export const NaslUITypeAnnotation = {
|
|
|
228
228
|
PoiInfo: genNaslUITypeAnnotation('PoiInfo'),
|
|
229
229
|
File: genNaslUITypeAnnotation('File'),
|
|
230
230
|
Current: genNaslUIGenericTypeAnnotation('Current'),
|
|
231
|
+
DragAndDropEvent: genNaslUIGenericTypeAnnotation('DragAndDropEvent'),
|
|
232
|
+
ExpandEvent: genNaslUIGenericTypeAnnotation('ExpandEvent'),
|
|
231
233
|
};
|
|
232
234
|
|
|
233
235
|
export const NaslTypeAnnotation = {
|
package/ts-worker/src/index.js
CHANGED
|
@@ -237,8 +237,7 @@ const context = {
|
|
|
237
237
|
publishDiagnostics(remain) {
|
|
238
238
|
webHost.diagnosticRecords = [];
|
|
239
239
|
try {
|
|
240
|
-
|
|
241
|
-
for (let i = 0; i < chunk; i++) {
|
|
240
|
+
for (let i = 0; i < remain; i++) {
|
|
242
241
|
this.system.checkTimeoutQueueLengthAndRun(1);
|
|
243
242
|
this.system.runQueuedImmediateCallbacks(1);
|
|
244
243
|
this.system.runQueuedImmediateCallbacks(1);
|
|
@@ -247,8 +246,6 @@ const context = {
|
|
|
247
246
|
event: 'publishDiagnostics',
|
|
248
247
|
records: webHost.diagnosticRecords,
|
|
249
248
|
});
|
|
250
|
-
remain -= chunk;
|
|
251
|
-
remain && setTimeout(() => this.publishDiagnostics(remain), 0);
|
|
252
249
|
} catch (e) {
|
|
253
250
|
if (e.operator === 'strictEqual')
|
|
254
251
|
console.error(e);
|
package/src/manager/history.ts
DELETED
|
File without changes
|
package/src/manager/problem.ts
DELETED
|
File without changes
|