@lcap/nasl 2.22.1 → 2.22.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/breakpoint/generator/AfterStartNode.d.ts +7 -0
- package/out/breakpoint/generator/AfterStartNode.js +27 -0
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
- package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
- package/out/breakpoint/generator/BeforeEndNode.js +27 -0
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
- package/out/breakpoint/generator/BreakpointNode.d.ts +14 -0
- package/out/breakpoint/generator/BreakpointNode.js +200 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
- package/out/breakpoint/generator/index.d.ts +4 -0
- package/out/breakpoint/generator/index.js +98 -0
- package/out/breakpoint/generator/index.js.map +1 -0
- package/out/breakpoint/index.d.ts +3 -0
- package/out/breakpoint/index.js +20 -0
- package/out/breakpoint/index.js.map +1 -0
- package/out/breakpoint/shared/constants.d.ts +31 -0
- package/out/breakpoint/shared/constants.js +89 -0
- package/out/breakpoint/shared/constants.js.map +1 -0
- package/out/breakpoint/shared/index.d.ts +3 -0
- package/out/breakpoint/shared/index.js +33 -0
- package/out/breakpoint/shared/index.js.map +1 -0
- package/out/breakpoint/shared/operations.d.ts +10 -0
- package/out/breakpoint/shared/operations.js +25 -0
- package/out/breakpoint/shared/operations.js.map +1 -0
- package/out/breakpoint/shared/socket.d.ts +47 -0
- package/out/breakpoint/shared/socket.js +210 -0
- package/out/breakpoint/shared/socket.js.map +1 -0
- package/out/breakpoint/shared/utils.d.ts +23 -0
- package/out/breakpoint/shared/utils.js +165 -0
- package/out/breakpoint/shared/utils.js.map +1 -0
- package/out/breakpoint/store/core.d.ts +32 -0
- package/out/breakpoint/store/core.js +388 -0
- package/out/breakpoint/store/core.js.map +1 -0
- package/out/breakpoint/store/dock.d.ts +1 -0
- package/out/breakpoint/store/dock.js +127 -0
- package/out/breakpoint/store/dock.js.map +1 -0
- package/out/breakpoint/store/index.d.ts +2 -0
- package/out/breakpoint/store/index.js +19 -0
- package/out/breakpoint/store/index.js.map +1 -0
- package/out/common/asyncFuncMap.d.ts +2 -0
- package/out/common/asyncFuncMap.js +16 -0
- package/out/common/asyncFuncMap.js.map +1 -0
- package/out/concepts/AnonymousFunction__.js +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +37 -0
- package/out/concepts/AuthInterface__.js +141 -0
- package/out/concepts/AuthInterface__.js.map +1 -0
- package/out/concepts/AuthLogicForCallInterface__.d.ts +138 -0
- package/out/concepts/AuthLogicForCallInterface__.js +493 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
- package/out/concepts/AuthLogic__.d.ts +66 -0
- package/out/concepts/AuthLogic__.js +206 -0
- package/out/concepts/AuthLogic__.js.map +1 -0
- package/out/concepts/BackendVariable__.d.ts +137 -0
- package/out/concepts/BackendVariable__.js +422 -0
- package/out/concepts/BackendVariable__.js.map +1 -0
- package/out/concepts/Backend__.d.ts +134 -0
- package/out/concepts/Backend__.js +274 -0
- package/out/concepts/Backend__.js.map +1 -0
- package/out/concepts/CallAuthInterface__.d.ts +126 -0
- package/out/concepts/CallAuthInterface__.js +408 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -0
- package/out/concepts/Destination__.js +6 -4
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/FrontendVariable__.d.ts +21 -0
- package/out/concepts/FrontendVariable__.js +64 -0
- package/out/concepts/FrontendVariable__.js.map +1 -0
- package/out/concepts/Match__.js +25 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +643 -0
- package/out/concepts/OverriddenLogic__.js +1602 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -0
- package/out/concepts/Param__.js +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -0
- package/out/concepts/basics/stdlib/nasl.http.js +167 -0
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
- package/out/server/naslServer.js +4 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/templator/genCreateBlock.js +2 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -2
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -1
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/package.json +2 -2
- package/src/concepts/AnonymousFunction__.ts +1 -1
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/Match__.ts +24 -6
- package/src/concepts/Param__.ts +1 -1
- package/src/concepts/dist/App__.js +2204 -0
- package/src/concepts/dist/CallLogic__.js +1149 -0
- package/src/concepts/dist/Destination__.js +756 -0
- package/src/concepts/dist/Logic__.js +1612 -0
- package/src/concepts/dist/Match__.js +768 -0
- package/src/concepts/dist/MsgTriggerEvent__.js +245 -0
- package/src/concepts/dist/OqlQueryComponent__.js +377 -0
- package/src/concepts/dist/Param__.js +1 -1
- package/src/generator/dist/genBundleFiles.js +15 -4
- package/src/generator/dist/genReleaseBody.js +501 -0
- package/src/server/dist/naslServer.js +25 -6
- package/src/server/naslServer.ts +4 -0
- package/src/service/creator/errHandles.js +8 -3
- package/src/service/storage/dist/init.js +34 -32
- package/src/templator/genCreateBlock.ts +2 -1
- package/src/templator/genCurdEditMultipleKeyBlock.ts +6 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -2
- package/src/templator/genEditTableBlock.ts +2 -1
- package/src/templator/genUpdateBlock.ts +2 -1
- package/test/examples/qzbusiness.json +1 -98265
package/src/server/naslServer.ts
CHANGED
|
@@ -231,6 +231,8 @@ export class NaslServer {
|
|
|
231
231
|
const records = await this._resolveDiagnosticRecords(data.records);
|
|
232
232
|
this.diagnosticManager.pushAll(records);
|
|
233
233
|
try {
|
|
234
|
+
// 结束诊断和标注
|
|
235
|
+
invokeCommand('naslServer:endWork');
|
|
234
236
|
invokeCommand('naslServer:nodeChange');
|
|
235
237
|
} catch (e) { console.log('no "naslServer:nodeChange" event received'); }
|
|
236
238
|
}
|
|
@@ -872,6 +874,8 @@ export class NaslServer {
|
|
|
872
874
|
}
|
|
873
875
|
|
|
874
876
|
async getDiagnosticRecordsAndPushAll(fileNames?: Array<string>) {
|
|
877
|
+
// 开始诊断和标注
|
|
878
|
+
invokeCommand('naslServer:startWork');
|
|
875
879
|
const records = await this.getDiagnosticRecords(fileNames);
|
|
876
880
|
// diagnosticManager.pushAll(records);
|
|
877
881
|
}
|
|
@@ -21,19 +21,24 @@ const versionStatus = {
|
|
|
21
21
|
401013: 'version_inconsistent',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
const FRONT_HANDLE_ERROR_MSG_CODE_LIST = [402201, 401356];
|
|
25
|
+
|
|
24
26
|
export default {
|
|
25
27
|
defaults({ config }, err = {}) {
|
|
26
28
|
if (config.noErrorTip)
|
|
27
29
|
return;
|
|
28
|
-
|
|
30
|
+
// 检测到数组内错误码的情况下,由前端处理返回错误信息,不反显后端错误信息
|
|
31
|
+
if (FRONT_HANDLE_ERROR_MSG_CODE_LIST.includes(err.code)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
29
34
|
// 检测到当前应用拉取操作已被强制结束
|
|
30
|
-
if(err.code === 401650) {
|
|
35
|
+
if (err.code === 401650) {
|
|
31
36
|
eventBus.emit('forceCancelPull');
|
|
32
37
|
return;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
// 检测到当前应用已在新 tab 页打开
|
|
36
|
-
if(err.code === 500502) {
|
|
41
|
+
if (err.code === 500502) {
|
|
37
42
|
eventBus.emit('multiTabOpened');
|
|
38
43
|
return;
|
|
39
44
|
}
|
|
@@ -250,24 +250,25 @@ function doAction(app, actionItem) {
|
|
|
250
250
|
if (getMiniAppChange(emitTarget, (_c = event === null || event === void 0 ? void 0 : event.originEvent) === null || _c === void 0 ? void 0 : _c.object, (_d = event === null || event === void 0 ? void 0 : event.originEvent) === null || _d === void 0 ? void 0 : _d.action)) {
|
|
251
251
|
hasBackEnd = true;
|
|
252
252
|
}
|
|
253
|
-
var
|
|
253
|
+
var isDelete = ((_e = event === null || event === void 0 ? void 0 : event.originEvent) === null || _e === void 0 ? void 0 : _e.action) === 'delete';
|
|
254
254
|
var isUpdateAuth = ((_f = event === null || event === void 0 ? void 0 : event.originEvent) === null || _f === void 0 ? void 0 : _f.action) === 'update' && ((_g = event === null || event === void 0 ? void 0 : event.originEvent) === null || _g === void 0 ? void 0 : _g.object) && 'auth' in ((_h = event === null || event === void 0 ? void 0 : event.originEvent) === null || _h === void 0 ? void 0 : _h.object);
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
emitTarget.
|
|
255
|
+
if (isDelete || isUpdateAuth) {
|
|
256
|
+
hasBackEnd = true;
|
|
257
|
+
// const app = emitTarget.app;
|
|
258
|
+
// const diffArr: string[] = [];
|
|
259
|
+
// emitTarget.logics.forEach((logic: Logic) => {
|
|
260
|
+
// if (logic.body.length > 2) {
|
|
261
|
+
// logic.body.forEach((it: LogicItem) => {
|
|
262
|
+
// itemloop(it, app, diffArr);
|
|
263
|
+
// });
|
|
264
|
+
// }
|
|
265
|
+
// });
|
|
266
|
+
// const result = diffArr.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
267
|
+
// if (result.length) {
|
|
268
|
+
// hasBackEnd = true;
|
|
269
|
+
// }
|
|
270
|
+
// emitTarget.children.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
271
|
+
// emitTarget.elements.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
271
272
|
}
|
|
272
273
|
hasFrontEnd = true;
|
|
273
274
|
}
|
|
@@ -623,9 +624,8 @@ function handleApp(app) {
|
|
|
623
624
|
*/
|
|
624
625
|
app.on('collect:end', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
625
626
|
var collectingList, actionMsg, action;
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
switch (_c.label) {
|
|
627
|
+
return __generator(this, function (_a) {
|
|
628
|
+
switch (_a.label) {
|
|
629
629
|
case 0:
|
|
630
630
|
app._isCollectingCount--;
|
|
631
631
|
if (!(app._isCollectingCount === 0)) return [3 /*break*/, 3];
|
|
@@ -641,24 +641,27 @@ function handleApp(app) {
|
|
|
641
641
|
app._noTimer = undefined;
|
|
642
642
|
if (!(Array.isArray(collectingList) && collectingList.length)) return [3 /*break*/, 2];
|
|
643
643
|
mountDatabaseTypes(app);
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
});
|
|
644
|
+
//app.naslServer?.embeddedTSEmitter?.emit('change', {
|
|
645
|
+
// value: collectingList,
|
|
646
|
+
//});
|
|
647
647
|
return [4 /*yield*/, doAction(app, {
|
|
648
648
|
list: collectingList,
|
|
649
649
|
actionMsg: actionMsg,
|
|
650
650
|
action: action
|
|
651
651
|
})];
|
|
652
652
|
case 1:
|
|
653
|
-
|
|
654
|
-
|
|
653
|
+
//app.naslServer?.embeddedTSEmitter?.emit('change', {
|
|
654
|
+
// value: collectingList,
|
|
655
|
+
//});
|
|
656
|
+
_a.sent();
|
|
657
|
+
_a.label = 2;
|
|
655
658
|
case 2: return [3 /*break*/, 4];
|
|
656
659
|
case 3:
|
|
657
660
|
if (app._isCollectingCount < 0) {
|
|
658
661
|
app._isCollectingCount = 0;
|
|
659
662
|
throw Error('关闭收集有问题,请排查');
|
|
660
663
|
}
|
|
661
|
-
|
|
664
|
+
_a.label = 4;
|
|
662
665
|
case 4: return [2 /*return*/];
|
|
663
666
|
}
|
|
664
667
|
});
|
|
@@ -667,15 +670,14 @@ function handleApp(app) {
|
|
|
667
670
|
* 有变更
|
|
668
671
|
*/
|
|
669
672
|
app.on('storage', function (event) {
|
|
670
|
-
var _a, _b;
|
|
671
673
|
// 是否正在收集
|
|
672
674
|
if (app._isCollectingCount === 0) {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
});
|
|
675
|
+
//app.naslServer?.embeddedTSEmitter?.emit('change', {
|
|
676
|
+
// value: [event],
|
|
677
|
+
//});
|
|
676
678
|
var actionMsg = '';
|
|
677
|
-
var
|
|
678
|
-
var
|
|
679
|
+
var _a = event.originEvent || {}, action = _a.action, target = _a.target;
|
|
680
|
+
var _b = target || {}, concept = _b.concept, name = _b.name;
|
|
679
681
|
switch (action) {
|
|
680
682
|
case 'create':
|
|
681
683
|
actionMsg = '添加';
|
|
@@ -36,6 +36,7 @@ export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
36
36
|
|
|
37
37
|
const { typeAnnotation } = property || {};
|
|
38
38
|
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
39
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
39
40
|
if (property.relationEntity) {
|
|
40
41
|
// 有外键关联
|
|
41
42
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -69,7 +70,7 @@ export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
69
70
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
70
71
|
} else if (propertyTypeName === 'Decimal') {
|
|
71
72
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
72
|
-
} else if (propertyTypeName === '
|
|
73
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
73
74
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
74
75
|
} else if (propertyTypeName === 'Date') {
|
|
75
76
|
formItem += `<u-date-picker clearable :date.sync="${vModel}" placeholder="请输入${label}"></u-date-picker>`;
|
|
@@ -40,6 +40,7 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
40
40
|
|
|
41
41
|
const { typeAnnotation } = property || {};
|
|
42
42
|
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
43
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
43
44
|
if (property.relationEntity) {
|
|
44
45
|
// 有外键关联
|
|
45
46
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -73,7 +74,7 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
73
74
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
74
75
|
} else if (propertyTypeName === 'Decimal') {
|
|
75
76
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
76
|
-
} else if (propertyTypeName === '
|
|
77
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
77
78
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
78
79
|
} else if (propertyTypeName === 'Date') {
|
|
79
80
|
formItem += `<u-date-picker clearable :date.sync="${vModel}" placeholder="请输入${label}"></u-date-picker>`;
|
|
@@ -139,6 +140,7 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
139
140
|
|
|
140
141
|
const { typeAnnotation } = property || {};
|
|
141
142
|
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
143
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
142
144
|
if (property.relationEntity) {
|
|
143
145
|
// 有外键关联
|
|
144
146
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -171,7 +173,7 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
171
173
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
172
174
|
} else if (propertyTypeName === 'Decimal') {
|
|
173
175
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
174
|
-
} else if (propertyTypeName === '
|
|
176
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
175
177
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
176
178
|
} else if (propertyTypeName === 'Date') {
|
|
177
179
|
formItem += `<u-date-picker clearable :date.sync="${vModel}" placeholder="请输入${label}"></u-date-picker>`;
|
|
@@ -393,6 +395,7 @@ export function genEditTableColumnComponent(app:App, entity: Entity, property: E
|
|
|
393
395
|
|
|
394
396
|
const propertyTypeName = property.typeAnnotation.typeName;
|
|
395
397
|
const propertyTypeNamespace = property.typeAnnotation.typeNamespace;
|
|
398
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
396
399
|
if (property.relationEntity) {
|
|
397
400
|
// 有外键关联
|
|
398
401
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -435,7 +438,7 @@ export function genEditTableColumnComponent(app:App, entity: Entity, property: E
|
|
|
435
438
|
formItem = `<u-number-input :value.sync="${valueExpression}" :precision="0" :step="0" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
436
439
|
} else if (propertyTypeName === 'Decimal') {
|
|
437
440
|
formItem = `<u-number-input :value.sync="${valueExpression}" :precision="0" :step="0" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
438
|
-
} else if (propertyTypeName === '
|
|
441
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
439
442
|
formItem = `<u-validator placement="bottom" display="appear" @blur-valid="${nameGroup.viewLogicBlurUpdate}" style="width:100%">
|
|
440
443
|
<u-textarea :value.sync="${valueExpression}" placeholder="请输入${label}" :autofocus="true" size="full"></u-textarea>
|
|
441
444
|
</u-validator>`;
|
|
@@ -34,6 +34,7 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
34
34
|
typeName: propertyTypeName,
|
|
35
35
|
typeNamespace: propertyTypeNamespace,
|
|
36
36
|
} = typeAnnotation || {};
|
|
37
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
37
38
|
if (property.relationEntity) {
|
|
38
39
|
// 有外键关联
|
|
39
40
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -67,7 +68,7 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
67
68
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
68
69
|
} else if (propertyTypeName === 'Decimal') {
|
|
69
70
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
70
|
-
} else if (propertyTypeName === '
|
|
71
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
71
72
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
72
73
|
} else if (propertyTypeName === 'Date') {
|
|
73
74
|
formItem += `<u-date-picker clearable :date.sync="${vModel}" placeholder="请输入${label}"></u-date-picker>`;
|
|
@@ -132,6 +133,7 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
132
133
|
typeName: propertyTypeName,
|
|
133
134
|
typeNamespace: propertyTypeNamespace,
|
|
134
135
|
} = typeAnnotation || {};
|
|
136
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
135
137
|
if (property.relationEntity) {
|
|
136
138
|
// 有外键关联
|
|
137
139
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -172,7 +174,7 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
172
174
|
} else if (propertyTypeName === 'Decimal') {
|
|
173
175
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}" ${property.primaryKey ? `:disabled="${nameGroup.viewVariableIsUpdate}"` : ''
|
|
174
176
|
}></u-number-input>`;
|
|
175
|
-
} else if (propertyTypeName === '
|
|
177
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
176
178
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}" ${property.primaryKey ? `:disabled="${nameGroup.viewVariableIsUpdate}"` : ''}></u-textarea>`;
|
|
177
179
|
} else if (propertyTypeName === 'Date') {
|
|
178
180
|
formItem += `<u-date-picker clearable :date.sync="${vModel}" placeholder="请输入${label}" ${property.primaryKey ? `:disabled="${nameGroup.viewVariableIsUpdate}"` : ''}></u-date-picker>`;
|
|
@@ -36,6 +36,7 @@ export function genEditTableColumnTemplate(entity: Entity, property: EntityPrope
|
|
|
36
36
|
|
|
37
37
|
const propertyTypeName = property.typeAnnotation.typeName;
|
|
38
38
|
const propertyTypeNamespace = property.typeAnnotation.typeNamespace;
|
|
39
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
39
40
|
if (property.relationEntity && selectNameGroupMap) {
|
|
40
41
|
// 有外键关联
|
|
41
42
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -69,7 +70,7 @@ export function genEditTableColumnTemplate(entity: Entity, property: EntityPrope
|
|
|
69
70
|
formItem = `<u-number-input :value.sync="${valueExpression}" :precision="0" :step="0" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
70
71
|
} else if (propertyTypeName === 'Decimal') {
|
|
71
72
|
formItem = `<u-number-input :value.sync="${valueExpression}" :precision="0" :step="0" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
72
|
-
} else if (propertyTypeName === '
|
|
73
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
73
74
|
formItem = `<u-validator placement="bottom" display="appear" @blur-valid="${nameGroup.viewLogicBlurUpdate}" style="width:100%">
|
|
74
75
|
<u-textarea :value.sync="${valueExpression}" placeholder="请输入${label}" :autofocus="true" size="full"></u-textarea>
|
|
75
76
|
</u-validator>`;
|
|
@@ -36,6 +36,7 @@ export function genUpdateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
36
36
|
|
|
37
37
|
const { typeAnnotation } = property || {};
|
|
38
38
|
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
39
|
+
const propertyTypeMaxLength:number = Number(property.rules.find((item) => item.indexOf('max') > -1)?.split('(')[1].slice(0, -1)) || 0;
|
|
39
40
|
if (property.relationEntity) {
|
|
40
41
|
// 有外键关联
|
|
41
42
|
const relationEntity = dataSource?.findEntityByName(property.relationEntity);
|
|
@@ -69,7 +70,7 @@ export function genUpdateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
69
70
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
70
71
|
} else if (propertyTypeName === 'Decimal') {
|
|
71
72
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
72
|
-
} else if (propertyTypeName === '
|
|
73
|
+
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 255) {
|
|
73
74
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
74
75
|
} else if (propertyTypeName === 'Date') {
|
|
75
76
|
formItem += `<u-date-picker clearable :date.sync="${vModel}" placeholder="请输入${label}"></u-date-picker>`;
|