@lcap/nasl 0.3.12-beta.3 → 0.3.13
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/service/create/index.js +2 -2
- package/out/service/create/index.js.map +1 -1
- package/out/types/app/App.js +11 -2
- package/out/types/app/App.js.map +1 -1
- package/out/types/app/Service.js +36 -1
- package/out/types/app/Service.js.map +1 -1
- package/out/types/data/Entity.d.ts +8 -0
- package/out/types/data/Entity.js +16 -0
- package/out/types/data/Entity.js.map +1 -1
- package/out/types/data/Structure.d.ts +4 -0
- package/out/types/data/Structure.js +12 -0
- package/out/types/data/Structure.js.map +1 -1
- package/out/types/data/dataTypes.d.ts +1 -1
- package/out/types/data/dataTypes.js +23 -6
- package/out/types/data/dataTypes.js.map +1 -1
- package/out/types/data/genBlock/builtInFunctions.json +15 -0
- package/out/types/data/genBlock/genTableBlock.js +1 -1
- package/out/types/data/genBlock/genTableBlock.js.map +1 -1
- package/out/types/data/genericTypes.d.ts +1 -1
- package/out/types/data/genericTypes.js +6 -2
- package/out/types/data/genericTypes.js.map +1 -1
- package/out/types/data/systemTypes.js +73 -0
- package/out/types/data/systemTypes.js.map +1 -1
- package/out/types/logic/LogicItem.js +1 -0
- package/out/types/logic/LogicItem.js.map +1 -1
- package/out/types/page/Element.js +21 -9
- package/out/types/page/Element.js.map +1 -1
- package/out/types/page/Page.js +7 -0
- package/out/types/page/Page.js.map +1 -1
- package/out/types/page/View.js +21 -0
- package/out/types/page/View.js.map +1 -1
- package/out/types/typeCheck.js +9 -2
- package/out/types/typeCheck.js.map +1 -1
- package/package.json +1 -1
- package/src/service/config/api.js +32 -0
- package/src/service/config/index.js +6 -0
- package/src/service/create/index.js +2 -2
- package/src/types/app/App.ts +13 -3
- package/src/types/app/Service.ts +36 -1
- package/src/types/data/Entity.ts +15 -0
- package/src/types/data/Structure.ts +10 -0
- package/src/types/data/dataTypes.ts +26 -6
- package/src/types/data/genBlock/builtInFunctions.json +17 -2
- package/src/types/data/genBlock/genTableBlock.ts +1 -1
- package/src/types/data/genericTypes.ts +6 -2
- package/src/types/data/systemTypes.ts +73 -0
- package/src/types/logic/LogicItem.ts +1 -0
- package/src/types/page/Element.ts +20 -9
- package/src/types/page/Page.ts +7 -0
- package/src/types/page/View.ts +22 -0
- package/src/types/typeCheck.ts +12 -5
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
loadList: {
|
|
3
|
+
url: {
|
|
4
|
+
method: 'get',
|
|
5
|
+
path: '/api/v1/property/list/{serviceId}',
|
|
6
|
+
},
|
|
7
|
+
},
|
|
8
|
+
add: {
|
|
9
|
+
url: {
|
|
10
|
+
method: 'post',
|
|
11
|
+
path: '/api/v1/property',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
delete: {
|
|
15
|
+
url: {
|
|
16
|
+
method: 'delete',
|
|
17
|
+
path: '/api/v1/property/{serviceId}/{propertyId}',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
update: {
|
|
21
|
+
url: {
|
|
22
|
+
method: 'put',
|
|
23
|
+
path: '/api/v1/property',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
check: {
|
|
27
|
+
url: {
|
|
28
|
+
method: 'get',
|
|
29
|
+
path: '/api/v1/property/fetch/{serviceId}/{key}',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -27,7 +27,7 @@ const requester = function (requestInfo) {
|
|
|
27
27
|
headers.Cookie = aslConfig.cookie;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
headers['request-lcpAppId'] = aslConfig.defaultApp?.id;
|
|
30
|
+
headers['request-lcpAppId'] = headers['request-lcpAppId'] || aslConfig.defaultApp?.id;
|
|
31
31
|
if (aslConfig.defaultApp?.baseVersion)
|
|
32
32
|
headers['request-appBaseVersion'] = aslConfig.defaultApp.baseVersion;
|
|
33
33
|
if (aslConfig.defaultApp?.versionChangedTime)
|
|
@@ -54,7 +54,7 @@ const requester = function (requestInfo) {
|
|
|
54
54
|
withCredentials: !baseURL,
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
if (aslConfig.debugRequest && requestOptions.method !== 'GET') {
|
|
57
|
+
if (aslConfig.debugRequestAll || (aslConfig.debugRequest && requestOptions.method !== 'GET')) {
|
|
58
58
|
console.debug('[Request Debug]', requestOptions);
|
|
59
59
|
}
|
|
60
60
|
const req = axios(requestOptions);
|
package/src/types/app/App.ts
CHANGED
|
@@ -160,6 +160,9 @@ export class App extends Vertex {
|
|
|
160
160
|
query: {
|
|
161
161
|
id: this.id,
|
|
162
162
|
},
|
|
163
|
+
headers: {
|
|
164
|
+
'request-lcpAppId': this.id,
|
|
165
|
+
},
|
|
163
166
|
});
|
|
164
167
|
}
|
|
165
168
|
const { envList } = appDetail.services
|
|
@@ -175,9 +178,12 @@ export class App extends Vertex {
|
|
|
175
178
|
query: {
|
|
176
179
|
id: this.id,
|
|
177
180
|
},
|
|
181
|
+
headers: {
|
|
182
|
+
'request-lcpAppId': this.id,
|
|
183
|
+
},
|
|
178
184
|
});
|
|
179
185
|
const { status } = result || {};
|
|
180
|
-
if (['PULLING', 'PUSHING'].includes(status)) {
|
|
186
|
+
if (['PULLING', 'PUSHING', 'PRE_PULLING'].includes(status)) {
|
|
181
187
|
this.emit('updateIdeStatus', status);
|
|
182
188
|
}
|
|
183
189
|
await this.loadEnvList(result);
|
|
@@ -195,6 +201,9 @@ export class App extends Vertex {
|
|
|
195
201
|
query: {
|
|
196
202
|
appId: this.id,
|
|
197
203
|
},
|
|
204
|
+
headers: {
|
|
205
|
+
'request-lcpAppId': this.id,
|
|
206
|
+
},
|
|
198
207
|
});
|
|
199
208
|
|
|
200
209
|
const services = result.map((service: Service) => {
|
|
@@ -275,7 +284,7 @@ export class App extends Vertex {
|
|
|
275
284
|
await this.load(); // 请求其它接口前,需要先查询到 app 上的 baseVersion
|
|
276
285
|
await Promise.all([
|
|
277
286
|
this.loadServices(),
|
|
278
|
-
updateGenericTypeList(),
|
|
287
|
+
updateGenericTypeList(this.id),
|
|
279
288
|
]);
|
|
280
289
|
|
|
281
290
|
if (options.asyncLoadServicesDetail)
|
|
@@ -328,7 +337,8 @@ export class App extends Vertex {
|
|
|
328
337
|
getModule(moduleName: string) {
|
|
329
338
|
const { modules } = this;
|
|
330
339
|
let module = modules.find((m) => m.name === moduleName);
|
|
331
|
-
if(module)
|
|
340
|
+
if (module)
|
|
341
|
+
return module;
|
|
332
342
|
|
|
333
343
|
module = new Module({ name: moduleName });
|
|
334
344
|
modules.push(module);
|
package/src/types/app/Service.ts
CHANGED
|
@@ -108,6 +108,9 @@ export class Service extends Vertex {
|
|
|
108
108
|
query: {
|
|
109
109
|
id: this.id,
|
|
110
110
|
},
|
|
111
|
+
headers: {
|
|
112
|
+
'request-lcpAppId': this.appId,
|
|
113
|
+
},
|
|
111
114
|
});
|
|
112
115
|
|
|
113
116
|
const structures: Array<Structure> = [];
|
|
@@ -142,6 +145,9 @@ export class Service extends Vertex {
|
|
|
142
145
|
query: {
|
|
143
146
|
id: this.id,
|
|
144
147
|
},
|
|
148
|
+
headers: {
|
|
149
|
+
'request-lcpAppId': this.appId,
|
|
150
|
+
},
|
|
145
151
|
});
|
|
146
152
|
this.globalLogic.syncStructures(newStructures);
|
|
147
153
|
|
|
@@ -183,6 +189,9 @@ export class Service extends Vertex {
|
|
|
183
189
|
query: {
|
|
184
190
|
serviceId: this.id,
|
|
185
191
|
},
|
|
192
|
+
headers: {
|
|
193
|
+
'request-lcpAppId': this.appId,
|
|
194
|
+
},
|
|
186
195
|
});
|
|
187
196
|
|
|
188
197
|
interfaces = interfaces.map((item) => {
|
|
@@ -277,6 +286,9 @@ export class WebService extends Service {
|
|
|
277
286
|
query: {
|
|
278
287
|
appId: this.id,
|
|
279
288
|
},
|
|
289
|
+
headers: {
|
|
290
|
+
'request-lcpAppId': this.appId,
|
|
291
|
+
},
|
|
280
292
|
});
|
|
281
293
|
// result.id = result.appId;
|
|
282
294
|
|
|
@@ -367,11 +379,15 @@ export class WebService extends Service {
|
|
|
367
379
|
},
|
|
368
380
|
};
|
|
369
381
|
|
|
382
|
+
// 官方扩展组件暂时不包含 dist-theme/index.css 文件
|
|
383
|
+
const officialCustomComponents = ['lcap-login', 'lcap-video'];
|
|
370
384
|
Object.keys(packageInfo.componentDependencies).forEach((name) => {
|
|
371
385
|
const version = packageInfo.componentDependencies[name].replace(/^[^0-9]+/, '');
|
|
372
386
|
|
|
373
387
|
result.custom.js.push(`${prefix}/packages/${name}@${version}/dist-theme/index.js`);
|
|
374
|
-
|
|
388
|
+
if (!officialCustomComponents.includes(name)) {
|
|
389
|
+
result.custom.css.push(`${prefix}/packages/${name}@${version}/dist-theme/index.css`);
|
|
390
|
+
}
|
|
375
391
|
result.custom.names.push(name);
|
|
376
392
|
});
|
|
377
393
|
|
|
@@ -408,6 +424,9 @@ ${Object.keys(themeVariables).map((key) => ` ${key}: ${themeVariables[key]};`
|
|
|
408
424
|
config: {
|
|
409
425
|
mock: config.mock,
|
|
410
426
|
},
|
|
427
|
+
headers: {
|
|
428
|
+
'request-lcpAppId': this.appId,
|
|
429
|
+
},
|
|
411
430
|
});
|
|
412
431
|
const pages = result.map((page) => Page.from(page, this));
|
|
413
432
|
this.assign({ pages });
|
|
@@ -543,6 +562,9 @@ export class MicroService extends Service {
|
|
|
543
562
|
query: {
|
|
544
563
|
microServiceId: this.id,
|
|
545
564
|
},
|
|
565
|
+
headers: {
|
|
566
|
+
'request-lcpAppId': this.appId,
|
|
567
|
+
},
|
|
546
568
|
});
|
|
547
569
|
entities.forEach((item, index) => {
|
|
548
570
|
convert2RefType(item);
|
|
@@ -670,6 +692,9 @@ export class MicroService extends Service {
|
|
|
670
692
|
query: {
|
|
671
693
|
microServiceId: this.id,
|
|
672
694
|
},
|
|
695
|
+
headers: {
|
|
696
|
+
'request-lcpAppId': this.appId,
|
|
697
|
+
},
|
|
673
698
|
});
|
|
674
699
|
|
|
675
700
|
enums.forEach((item, index) => {
|
|
@@ -713,6 +738,9 @@ export class MicroService extends Service {
|
|
|
713
738
|
query: {
|
|
714
739
|
serviceId: this.id,
|
|
715
740
|
},
|
|
741
|
+
headers: {
|
|
742
|
+
'request-lcpAppId': this.appId,
|
|
743
|
+
},
|
|
716
744
|
});
|
|
717
745
|
const processes = result.map((process) => Process.from(process, this));
|
|
718
746
|
this.assign({ processes });
|
|
@@ -732,6 +760,9 @@ export class MicroService extends Service {
|
|
|
732
760
|
query: {
|
|
733
761
|
microServiceId: this.id,
|
|
734
762
|
},
|
|
763
|
+
headers: {
|
|
764
|
+
'request-lcpAppId': this.appId,
|
|
765
|
+
},
|
|
735
766
|
});
|
|
736
767
|
const newEntities: Array<Entity> = [];
|
|
737
768
|
const syncEntities: Array<Entity> = [];
|
|
@@ -781,6 +812,9 @@ export class MicroService extends Service {
|
|
|
781
812
|
query: {
|
|
782
813
|
microServiceId: this.id,
|
|
783
814
|
},
|
|
815
|
+
headers: {
|
|
816
|
+
'request-lcpAppId': this.appId,
|
|
817
|
+
},
|
|
784
818
|
});
|
|
785
819
|
entities.forEach((item) => {
|
|
786
820
|
const tempEntity = <Entity>vertexsMap.get(item.id);
|
|
@@ -819,6 +853,7 @@ export class MicroService extends Service {
|
|
|
819
853
|
},
|
|
820
854
|
headers: {
|
|
821
855
|
IdeVersion: 2.3,
|
|
856
|
+
'request-lcpAppId': this.appId,
|
|
822
857
|
},
|
|
823
858
|
});
|
|
824
859
|
interfaces = interfaces.map((item) => {
|
package/src/types/data/Entity.ts
CHANGED
|
@@ -179,6 +179,19 @@ export class Entity extends Vertex implements ObjectSchema {
|
|
|
179
179
|
*/
|
|
180
180
|
@immutable()
|
|
181
181
|
public readonly entityGenSource: string = undefined;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 数据源同步状态
|
|
185
|
+
*/
|
|
186
|
+
@immutable()
|
|
187
|
+
public readonly sourceSyncState: number = undefined;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* 数据源同步状态信息
|
|
191
|
+
*/
|
|
192
|
+
@immutable()
|
|
193
|
+
public readonly sourceSyncMsgs: Array<string> = undefined;
|
|
194
|
+
|
|
182
195
|
/**
|
|
183
196
|
* 周边存在的名称
|
|
184
197
|
*/
|
|
@@ -332,6 +345,7 @@ export class Entity extends Vertex implements ObjectSchema {
|
|
|
332
345
|
updateDataTypeList();
|
|
333
346
|
this.dataNode.service.emit('dataTypesChange');
|
|
334
347
|
this.dataNode.service.emit('vertexIdToNameChange', this.id, this.name);
|
|
348
|
+
await this.load();
|
|
335
349
|
}
|
|
336
350
|
/**
|
|
337
351
|
* 设置实体表名
|
|
@@ -374,6 +388,7 @@ export class Entity extends Vertex implements ObjectSchema {
|
|
|
374
388
|
},
|
|
375
389
|
});
|
|
376
390
|
|
|
391
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this
|
|
377
392
|
const entity = this;
|
|
378
393
|
entity.assign({ resolvers: [] });
|
|
379
394
|
|
|
@@ -196,6 +196,16 @@ export class Structure extends Vertex implements ObjectSchema {
|
|
|
196
196
|
config.defaultApp?.emit('saved');
|
|
197
197
|
return this;
|
|
198
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* 删除数据类型中数据结构 兼容模块功能
|
|
201
|
+
*/
|
|
202
|
+
@action('删除数据类型中数据结构')
|
|
203
|
+
deleteType(none?: void, actionOptions?: ActionOptions) {
|
|
204
|
+
delete dataTypesMap[this.schemaRef];
|
|
205
|
+
updateDataTypeList();
|
|
206
|
+
this.destroy();
|
|
207
|
+
this.dataNode.service.emit('dataTypesChange');
|
|
208
|
+
}
|
|
199
209
|
/**
|
|
200
210
|
* 删除数据结构
|
|
201
211
|
*/
|
|
@@ -20,12 +20,32 @@ export const dataTypesMap: { [name: string]: Schema } = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export function updateDataTypeList() {
|
|
23
|
-
|
|
23
|
+
const typeMap: any = {};
|
|
24
|
+
Object.keys(dataTypesMap)
|
|
24
25
|
.filter((key) => !key.includes('#/basicTypes') && !key.includes('#/systemTypes') && !key.includes('#/genericTypes'))
|
|
25
|
-
.
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
.forEach((key) => {
|
|
27
|
+
const { level, name, createdTime }: any = dataTypesMap[key];
|
|
28
|
+
// 数据分类
|
|
29
|
+
if (!typeMap[level]) {
|
|
30
|
+
typeMap[level] = [];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
typeMap[level].push({ kind: level, text: name, value: key, createdTime });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// 实体按创建时间排序
|
|
37
|
+
if (typeMap.entity) {
|
|
38
|
+
typeMap.entity.sort((a: any, b: any) => {
|
|
39
|
+
// 刚创建的实体createdTime没有值。。。
|
|
40
|
+
if (!a.createdTime) {
|
|
41
|
+
return -1;
|
|
42
|
+
}
|
|
43
|
+
return b.createdTime - a.createdTime;
|
|
28
44
|
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const children = Object.keys(typeMap).reduce((result, type) => result.concat(typeMap[type]), []);
|
|
48
|
+
dataTypeList[1].children = children;
|
|
29
49
|
}
|
|
30
50
|
|
|
31
51
|
export function properties2PropertyList(definition: any) {
|
|
@@ -45,8 +65,8 @@ export function properties2PropertyList(definition: any) {
|
|
|
45
65
|
return definition;
|
|
46
66
|
}
|
|
47
67
|
|
|
48
|
-
export async function updateGenericTypeList() {
|
|
49
|
-
const datatypes = await getGenericList();
|
|
68
|
+
export async function updateGenericTypeList(appId: string) {
|
|
69
|
+
const datatypes = await getGenericList(appId);
|
|
50
70
|
dataTypeList[2].children = datatypes.genericTypeList.concat(systemTypeList);
|
|
51
71
|
Object.assign(dataTypesMap, datatypes.genericTypemap);
|
|
52
72
|
}
|
|
@@ -541,5 +541,20 @@
|
|
|
541
541
|
"format": "int"
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
}
|
|
545
|
-
|
|
544
|
+
},
|
|
545
|
+
"GetProperties": {
|
|
546
|
+
"params": [
|
|
547
|
+
{
|
|
548
|
+
"name": "name",
|
|
549
|
+
"schema": {
|
|
550
|
+
"type": "string"
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
],
|
|
554
|
+
"return": {
|
|
555
|
+
"schema": {
|
|
556
|
+
"type": "string"
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
@@ -38,7 +38,7 @@ export function genTableColumnTemplate(property: EntityProperty) {
|
|
|
38
38
|
if (property.typeKey === '#/basicTypes/Boolean') {
|
|
39
39
|
return `
|
|
40
40
|
<u-text v-if="${expression}" text="是"></u-text>
|
|
41
|
-
<u-text v-if="
|
|
41
|
+
<u-text v-if="${expression} == false" text="否"></u-text>
|
|
42
42
|
`;
|
|
43
43
|
} else {
|
|
44
44
|
return `<u-text :text="${expression}"></u-text>`;
|
|
@@ -6,10 +6,14 @@ export function getGenericTypeRef(typeName: string) {
|
|
|
6
6
|
return `#/genericTypes/${typeName}`;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export async function getGenericList() {
|
|
9
|
+
export async function getGenericList(appId: string) {
|
|
10
10
|
let list = [];
|
|
11
11
|
try {
|
|
12
|
-
list = await genericService.getGenericClassList(
|
|
12
|
+
list = await genericService.getGenericClassList({
|
|
13
|
+
headers: {
|
|
14
|
+
'request-lcpAppId': appId,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
13
17
|
} catch (err) { }
|
|
14
18
|
const genericTypeList: any = [];
|
|
15
19
|
const genericTypemap: any = {};
|
|
@@ -24,6 +24,7 @@ export const systemTypeList = [
|
|
|
24
24
|
{ kind: 'systemType', text: 'UploadErrorEvent', value: '#/systemTypes/UploadErrorEvent' },
|
|
25
25
|
{ kind: 'systemType', text: 'SortEvent', value: '#/systemTypes/SortEvent' },
|
|
26
26
|
{ kind: 'systemType', text: 'PoiInfo', value: '#/systemTypes/PoiInfo' },
|
|
27
|
+
{ kind: 'systemType', text: 'File', value: '#/systemTypes/File' },
|
|
27
28
|
];
|
|
28
29
|
|
|
29
30
|
export const systemTypeMap: { [name: string]: ObjectSchema } = {
|
|
@@ -417,6 +418,27 @@ export const systemTypeMap: { [name: string]: ObjectSchema } = {
|
|
|
417
418
|
description: '选择项相关对象',
|
|
418
419
|
isLeaf: true,
|
|
419
420
|
},
|
|
421
|
+
{
|
|
422
|
+
type: 'genericType',
|
|
423
|
+
typeKey: '#/genericTypes/List',
|
|
424
|
+
typeInstantiation: {
|
|
425
|
+
typeName: 'List',
|
|
426
|
+
typeParams: [
|
|
427
|
+
{
|
|
428
|
+
type: 'typeParam',
|
|
429
|
+
typeParamName: 'T',
|
|
430
|
+
typeParamValue: {
|
|
431
|
+
typeKey: '#/basicTypes/String',
|
|
432
|
+
type: 'string',
|
|
433
|
+
format: '',
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
},
|
|
438
|
+
name: 'items',
|
|
439
|
+
description: '所有选中项相关对象的数组',
|
|
440
|
+
isLeaf: true,
|
|
441
|
+
},
|
|
420
442
|
{
|
|
421
443
|
typeKey: '#/basicTypes/String',
|
|
422
444
|
type: 'string',
|
|
@@ -1311,6 +1333,27 @@ export const systemTypeMap: { [name: string]: ObjectSchema } = {
|
|
|
1311
1333
|
description: '选择项相关对象',
|
|
1312
1334
|
isLeaf: true,
|
|
1313
1335
|
},
|
|
1336
|
+
{
|
|
1337
|
+
type: 'genericType',
|
|
1338
|
+
typeKey: '#/genericTypes/List',
|
|
1339
|
+
typeInstantiation: {
|
|
1340
|
+
typeName: 'List',
|
|
1341
|
+
typeParams: [
|
|
1342
|
+
{
|
|
1343
|
+
type: 'typeParam',
|
|
1344
|
+
typeParamName: 'T',
|
|
1345
|
+
typeParamValue: {
|
|
1346
|
+
typeKey: '#/basicTypes/String',
|
|
1347
|
+
type: 'string',
|
|
1348
|
+
format: '',
|
|
1349
|
+
},
|
|
1350
|
+
},
|
|
1351
|
+
],
|
|
1352
|
+
},
|
|
1353
|
+
name: 'items',
|
|
1354
|
+
description: '所有选中项相关对象的数组',
|
|
1355
|
+
isLeaf: true,
|
|
1356
|
+
},
|
|
1314
1357
|
],
|
|
1315
1358
|
},
|
|
1316
1359
|
'#/systemTypes/UploadEvent': {
|
|
@@ -1559,4 +1602,34 @@ export const systemTypeMap: { [name: string]: ObjectSchema } = {
|
|
|
1559
1602
|
},
|
|
1560
1603
|
],
|
|
1561
1604
|
},
|
|
1605
|
+
'#/systemTypes/File': {
|
|
1606
|
+
name: 'File',
|
|
1607
|
+
type: 'object',
|
|
1608
|
+
propertyList: [
|
|
1609
|
+
{
|
|
1610
|
+
typeKey: '#/basicTypes/String',
|
|
1611
|
+
type: 'string',
|
|
1612
|
+
format: '',
|
|
1613
|
+
name: 'name',
|
|
1614
|
+
description: '文件名称',
|
|
1615
|
+
isLeaf: true,
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
typeKey: '#/basicTypes/Integer',
|
|
1619
|
+
type: 'integer',
|
|
1620
|
+
format: 'int',
|
|
1621
|
+
name: 'size',
|
|
1622
|
+
description: '文件大小',
|
|
1623
|
+
isLeaf: true,
|
|
1624
|
+
},
|
|
1625
|
+
{
|
|
1626
|
+
typeKey: '#/basicTypes/String',
|
|
1627
|
+
type: 'string',
|
|
1628
|
+
format: '',
|
|
1629
|
+
name: 'type',
|
|
1630
|
+
description: '文件类型',
|
|
1631
|
+
isLeaf: true,
|
|
1632
|
+
},
|
|
1633
|
+
],
|
|
1634
|
+
},
|
|
1562
1635
|
};
|
|
@@ -1036,15 +1036,26 @@ export class Element extends Vertex {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
} else {
|
|
1038
1038
|
const expression = <ExpressionNode> this._parseExpression(directive.value, context);
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1039
|
+
if(!expression || expression.type === 'StringLiteral') { // 处理类似情况:v-auth="''",v-tooltip="''"
|
|
1040
|
+
element.directiveList.push(Directive.from({
|
|
1041
|
+
type: 'string',
|
|
1042
|
+
name: directive.name,
|
|
1043
|
+
rawName: directive.rawName,
|
|
1044
|
+
value: directive.value && directive.value.replace(/'/g, ''),
|
|
1045
|
+
arg: directive.arg,
|
|
1046
|
+
modifiers: directive.modifiers,
|
|
1047
|
+
}, element));
|
|
1048
|
+
} else {
|
|
1049
|
+
element.directiveList.push(Directive.from({
|
|
1050
|
+
type: 'dynamic',
|
|
1051
|
+
name: directive.name,
|
|
1052
|
+
rawName: directive.rawName,
|
|
1053
|
+
value: '',
|
|
1054
|
+
expression,
|
|
1055
|
+
arg: directive.arg,
|
|
1056
|
+
modifiers: directive.modifiers,
|
|
1057
|
+
}, element));
|
|
1058
|
+
}
|
|
1048
1059
|
}
|
|
1049
1060
|
});
|
|
1050
1061
|
|
package/src/types/page/Page.ts
CHANGED
|
@@ -107,6 +107,9 @@ export class Page extends Vertex {
|
|
|
107
107
|
path: {
|
|
108
108
|
id: this.id,
|
|
109
109
|
},
|
|
110
|
+
headers: {
|
|
111
|
+
'request-lcpAppId': this.service.appId,
|
|
112
|
+
},
|
|
110
113
|
});
|
|
111
114
|
this.assign(result);
|
|
112
115
|
|
|
@@ -174,6 +177,7 @@ export class Page extends Vertex {
|
|
|
174
177
|
appId: config.defaultApp?.id,
|
|
175
178
|
operationAction: actionOptions?.actionName || 'Page.create',
|
|
176
179
|
operationDesc: actionOptions?.actionDesc || `添加页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
180
|
+
'request-lcpAppId': this.service.appId,
|
|
177
181
|
},
|
|
178
182
|
body,
|
|
179
183
|
}).catch(catchFn());
|
|
@@ -233,6 +237,7 @@ export class Page extends Vertex {
|
|
|
233
237
|
appId: config.defaultApp?.id,
|
|
234
238
|
operationAction: actionOptions?.actionName || 'Page.create',
|
|
235
239
|
operationDesc: actionOptions?.actionDesc || `添加页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
240
|
+
'request-lcpAppId': this.service.appId,
|
|
236
241
|
},
|
|
237
242
|
body,
|
|
238
243
|
});
|
|
@@ -268,6 +273,7 @@ export class Page extends Vertex {
|
|
|
268
273
|
appId: config.defaultApp?.id,
|
|
269
274
|
operationAction: actionOptions?.actionName || 'Page.delete',
|
|
270
275
|
operationDesc: actionOptions?.actionDesc || `删除页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
276
|
+
'request-lcpAppId': this.service.appId,
|
|
271
277
|
},
|
|
272
278
|
path: {
|
|
273
279
|
id: this.id,
|
|
@@ -295,6 +301,7 @@ export class Page extends Vertex {
|
|
|
295
301
|
appId: config.defaultApp?.id,
|
|
296
302
|
operationAction: actionOptions?.actionName || 'Page.delete',
|
|
297
303
|
operationDesc: actionOptions?.actionDesc || `修改页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
304
|
+
'request-lcpAppId': this.service.appId,
|
|
298
305
|
},
|
|
299
306
|
body,
|
|
300
307
|
}).catch(catchFn());
|
package/src/types/page/View.ts
CHANGED
|
@@ -189,6 +189,7 @@ export class View extends Block {
|
|
|
189
189
|
if (this.contentPromise)
|
|
190
190
|
return this.contentPromise;
|
|
191
191
|
|
|
192
|
+
|
|
192
193
|
return this.contentPromise = (async () => {
|
|
193
194
|
try {
|
|
194
195
|
const result: View = await viewService.load({
|
|
@@ -198,6 +199,9 @@ export class View extends Block {
|
|
|
198
199
|
query: {
|
|
199
200
|
enableCache,
|
|
200
201
|
},
|
|
202
|
+
headers: {
|
|
203
|
+
'request-lcpAppId': this.page.service.appId, // generator调用时需要appId headers
|
|
204
|
+
},
|
|
201
205
|
});
|
|
202
206
|
|
|
203
207
|
const $def = result.$def;
|
|
@@ -237,6 +241,9 @@ export class View extends Block {
|
|
|
237
241
|
enableCache,
|
|
238
242
|
},
|
|
239
243
|
config: { noErrorTip: true },
|
|
244
|
+
headers: {
|
|
245
|
+
'request-lcpAppId': this.page.service.appId,
|
|
246
|
+
},
|
|
240
247
|
});
|
|
241
248
|
const oldLogics = this.$def.logics;
|
|
242
249
|
Object.assign(result, {
|
|
@@ -357,6 +364,9 @@ export class View extends Block {
|
|
|
357
364
|
appId: config.defaultApp?.id,
|
|
358
365
|
operationAction: actionOptions?.actionName || 'View.create',
|
|
359
366
|
operationDesc: actionOptions?.actionDesc || `添加子页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
367
|
+
headers: {
|
|
368
|
+
'request-lcpAppId': this.page ? this.page.service.appId : this.parent.page.service.appId,
|
|
369
|
+
},
|
|
360
370
|
},
|
|
361
371
|
body,
|
|
362
372
|
}).catch(catchFn());
|
|
@@ -411,6 +421,9 @@ export class View extends Block {
|
|
|
411
421
|
appId: config.defaultApp?.id,
|
|
412
422
|
operationAction: actionOptions?.actionName || 'View.create',
|
|
413
423
|
operationDesc: actionOptions?.actionDesc || `添加子页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
424
|
+
headers: {
|
|
425
|
+
'request-lcpAppId': this.page.service.appId,
|
|
426
|
+
},
|
|
414
427
|
},
|
|
415
428
|
body,
|
|
416
429
|
});
|
|
@@ -445,6 +458,9 @@ export class View extends Block {
|
|
|
445
458
|
appId: config.defaultApp?.id,
|
|
446
459
|
operationAction: actionOptions?.actionName || 'View.delete',
|
|
447
460
|
operationDesc: actionOptions?.actionDesc || `删除子页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
461
|
+
headers: {
|
|
462
|
+
'request-lcpAppId': this.page.service.appId,
|
|
463
|
+
},
|
|
448
464
|
},
|
|
449
465
|
path: {
|
|
450
466
|
id: this.id,
|
|
@@ -479,6 +495,9 @@ export class View extends Block {
|
|
|
479
495
|
appId: config.defaultApp?.id,
|
|
480
496
|
operationAction: actionOptions?.actionName || 'View.update',
|
|
481
497
|
operationDesc: actionOptions?.actionDesc || `修改子页面"${this.name}${this.title ? `(${this.title})` : ''}"`,
|
|
498
|
+
headers: {
|
|
499
|
+
'request-lcpAppId': this.page.service.appId,
|
|
500
|
+
},
|
|
482
501
|
},
|
|
483
502
|
body,
|
|
484
503
|
}).catch(catchFn());
|
|
@@ -960,6 +979,9 @@ export class View extends Block {
|
|
|
960
979
|
appId: config.defaultApp?.id,
|
|
961
980
|
operationAction: 'View.mergeBlock',
|
|
962
981
|
operationDesc: '根据实体自动生成组件和逻辑',
|
|
982
|
+
headers: {
|
|
983
|
+
'request-lcpAppId': this.page.service.appId,
|
|
984
|
+
},
|
|
963
985
|
},
|
|
964
986
|
});
|
|
965
987
|
|