Comparing version 0.1.10 to 0.1.11
@@ -1,2 +0,2 @@ | ||
import { Vertex } from '..'; | ||
import { Vertex, Enum } from '..'; | ||
/** | ||
@@ -19,2 +19,6 @@ * 枚举项 | ||
/** | ||
* 父级引用 | ||
*/ | ||
root: Enum; | ||
/** | ||
* @param source 需要合并的部分参数 | ||
@@ -21,0 +25,0 @@ */ |
@@ -22,2 +22,6 @@ "use strict"; | ||
super(); | ||
/** | ||
* 父级引用 | ||
*/ | ||
this.root = undefined; | ||
source && this.assign(source); | ||
@@ -30,2 +34,4 @@ } | ||
this.assign({ id: result.id }); | ||
this.root.dataNode.service.emit('dataTypesChange'); | ||
this.root.dataNode.service.emit('enumsChange'); | ||
} | ||
@@ -37,2 +43,4 @@ async update() { | ||
}); | ||
this.root.dataNode.service.emit('dataTypesChange'); | ||
this.root.dataNode.service.emit('enumsChange'); | ||
} | ||
@@ -45,2 +53,4 @@ async delete() { | ||
}); | ||
this.root.dataNode.service.emit('dataTypesChange'); | ||
this.root.dataNode.service.emit('enumsChange'); | ||
} | ||
@@ -65,4 +75,8 @@ async setValue(value) { | ||
], EnumItem.prototype, "label", void 0); | ||
__decorate([ | ||
decorators_1.circular(), | ||
decorators_1.immutable() | ||
], EnumItem.prototype, "root", void 0); | ||
exports.EnumItem = EnumItem; | ||
exports.default = EnumItem; | ||
//# sourceMappingURL=EnumItem.js.map |
@@ -308,2 +308,3 @@ "use strict"; | ||
} | ||
this.logic && this.logic.emit('change'); | ||
} | ||
@@ -384,2 +385,3 @@ /** | ||
!cache && this.remove(); | ||
this.logic && this.logic.emit('change'); | ||
__1.history.push(`删除逻辑节点"${this.label}"`); | ||
@@ -405,2 +407,3 @@ } | ||
console.log('logicItemData', this); | ||
this.logic && this.logic.emit('change'); | ||
return this; | ||
@@ -425,2 +428,3 @@ } | ||
} | ||
this.logic && this.logic.emit('change'); | ||
return this; | ||
@@ -427,0 +431,0 @@ } |
@@ -9,7 +9,7 @@ "use strict"; | ||
function getNormalResponse(responses) { | ||
return Object.entries(responses).sort((a, b) => a[0] - b[0])?.[0]?.[1]; | ||
return Object.entries(responses).sort((a, b) => a[0] - b[0])[0][1]; | ||
} | ||
const response = getNormalResponse(JSON.parse(inter.responses)); | ||
// numims 服务: {"description":"响应类型200,新建200响应状态码会覆盖响应信息\n","headers":{},"schema":{"$ref":"#/flowfront0928/structures/ApiReturnOfGetUserList1"}} | ||
const schema = response?.content?.['application/json']?.schema || response?.schema; | ||
const schema = response.content['application/json'].schema || response.schema; | ||
return schema; | ||
@@ -33,4 +33,4 @@ } | ||
schema = dataTypesMap[schema.$ref]; | ||
const propertyList = schema?.propertyList; | ||
const item = propertyList?.find((item) => item.name === key); | ||
const propertyList = schema.propertyList; | ||
const item = propertyList.find((item) => item.name === key); | ||
return getChildSchema(item, arr.join('.'), dataTypesMap); | ||
@@ -37,0 +37,0 @@ } |
@@ -104,2 +104,3 @@ "use strict"; | ||
this.deepPick(result, ['id']); | ||
__1.config.webFileCache && __1.generator.saveViewCache(this.rootView); | ||
__1.history.push(`添加页面"${this.name}${this.title ? `(${this.title})` : ''}"`); | ||
@@ -106,0 +107,0 @@ this.assign(Page.from(this, this.service)); |
@@ -82,2 +82,3 @@ import { LEVEL_ENUM, Page, Element } from '..'; | ||
constructor(source?: Partial<View>); | ||
private _onChange; | ||
load(): Promise<this>; | ||
@@ -84,0 +85,0 @@ /** |
@@ -21,2 +21,3 @@ "use strict"; | ||
const translator_1 = __importDefault(require("../logic/translator")); | ||
const lodash_1 = require("lodash"); | ||
/** | ||
@@ -105,3 +106,12 @@ * 子页面类,前端路由控制 | ||
source && this.assign(source); | ||
this.on('change', lodash_1.throttle(this._onChange.bind(this), __1.config.throttleWait, { leading: true, trailing: true })); | ||
} | ||
async _onChange() { | ||
// 在子页面修改时生成缓存,注意不需要 await | ||
if (__1.config.webFileCache) { | ||
if (!this.$html) | ||
await this.load(); | ||
__1.generator.saveViewCache(this); | ||
} | ||
} | ||
async load() { | ||
@@ -166,2 +176,4 @@ const result = await page_1.viewService.load({ | ||
}); | ||
// 在子页面修改时生成缓存,注意不需要 await | ||
__1.config.webFileCache && __1.generator.saveViewCache(this); | ||
__1.history.push(`添加子页面"${this.name}${this.title ? `(${this.title})` : ''}"`); | ||
@@ -342,4 +354,4 @@ return this; | ||
const parentNode = this.findElement(nodePath); | ||
const viewId = parentNode?.view?.id; | ||
const parentId = parentNode?.id; | ||
const viewId = parentNode.view.id; | ||
const parentId = parentNode.id; | ||
if (template) { | ||
@@ -346,0 +358,0 @@ const newNode = __1.Element.parse(template); |
{ | ||
"name": "@lcap/asl", | ||
"description": "Lowcode Application Specific Language", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"author": "Forrest <rainforest92@126.com>", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -1,3 +0,3 @@ | ||
import { immutable } from '../decorators'; | ||
import { Vertex } from '..'; | ||
import { circular, immutable } from '../decorators'; | ||
import { Vertex, Enum } from '..'; | ||
import { enumPropertyService } from '../../service/data'; | ||
@@ -25,2 +25,8 @@ | ||
/** | ||
* 父级引用 | ||
*/ | ||
@circular() | ||
@immutable() | ||
public root: Enum = undefined; | ||
/** | ||
* @param source 需要合并的部分参数 | ||
@@ -38,2 +44,4 @@ */ | ||
this.assign({ id: result.id }); | ||
this.root.dataNode.service.emit('dataTypesChange'); | ||
this.root.dataNode.service.emit('enumsChange'); | ||
} | ||
@@ -45,2 +53,4 @@ async update() { | ||
}); | ||
this.root.dataNode.service.emit('dataTypesChange'); | ||
this.root.dataNode.service.emit('enumsChange'); | ||
} | ||
@@ -53,2 +63,4 @@ async delete() { | ||
}); | ||
this.root.dataNode.service.emit('dataTypesChange'); | ||
this.root.dataNode.service.emit('enumsChange'); | ||
} | ||
@@ -55,0 +67,0 @@ async setValue(value: string) { |
@@ -339,2 +339,4 @@ import { immutable, excludedInJSON, circular, action } from '../decorators'; | ||
} | ||
this.logic && this.logic.emit('change'); | ||
} | ||
@@ -418,2 +420,3 @@ /** | ||
this.logic && this.logic.emit('change'); | ||
history.push(`删除逻辑节点"${this.label}"`); | ||
@@ -440,2 +443,3 @@ } | ||
console.log('logicItemData',this); | ||
this.logic && this.logic.emit('change'); | ||
return this; | ||
@@ -462,2 +466,3 @@ } | ||
this.logic && this.logic.emit('change'); | ||
return this; | ||
@@ -464,0 +469,0 @@ } |
@@ -8,3 +8,3 @@ // Node.js 需要使用,临时拷一下 | ||
function getNormalResponse(responses) { | ||
return Object.entries(responses).sort((a, b) => a[0] - b[0])?.[0]?.[1]; | ||
return Object.entries(responses).sort((a, b) => a[0] - b[0])[0][1]; | ||
} | ||
@@ -14,3 +14,3 @@ | ||
// numims 服务: {"description":"响应类型200,新建200响应状态码会覆盖响应信息\n","headers":{},"schema":{"$ref":"#/flowfront0928/structures/ApiReturnOfGetUserList1"}} | ||
const schema = response?.content?.['application/json']?.schema || response?.schema; | ||
const schema = response.content['application/json'].schema || response.schema; | ||
return schema; | ||
@@ -37,4 +37,4 @@ } | ||
schema = dataTypesMap[schema.$ref]; | ||
const propertyList = schema?.propertyList; | ||
const item = propertyList?.find((item) => item.name === key); | ||
const propertyList = schema.propertyList; | ||
const item = propertyList.find((item) => item.name === key); | ||
return getChildSchema(item, arr.join('.'), dataTypesMap); | ||
@@ -41,0 +41,0 @@ } |
import { immutable, circular, action, excludedInJSON } from '../decorators'; | ||
import { config, history, LEVEL_ENUM, Vertex, PackageJSON, App, WebService, View, utils } from '..'; | ||
import { config, history, LEVEL_ENUM, Vertex, PackageJSON, App, WebService, View, utils, generator } from '..'; | ||
import pageService from '../../service/page'; | ||
@@ -96,3 +96,3 @@ import { traverse } from '../common/utils'; | ||
rootView.assign({ page: this }); | ||
this.assign({ rootView }); | ||
@@ -112,2 +112,3 @@ } | ||
config.webFileCache && generator.saveViewCache(this.rootView); | ||
history.push(`添加页面"${this.name}${this.title ? `(${this.title})` : ''}"`); | ||
@@ -114,0 +115,0 @@ this.assign(Page.from(this, this.service)); |
import { immutable, circular, action } from '../decorators'; | ||
import { config, history, LEVEL_ENUM, Vertex, PackageJSON, App, WebService, Page, Element, utils, ViewParam, ViewVariable, Lifecycle, genFinalCode } from '..'; | ||
import { config, history, LEVEL_ENUM, Vertex, PackageJSON, App, WebService, Page, Element, utils, ViewParam, ViewVariable, Lifecycle, genFinalCode, generator } from '..'; | ||
import Block from './Block'; | ||
@@ -12,2 +12,3 @@ import { viewService } from '../../service/page'; | ||
import translator from '../logic/translator'; | ||
import { throttle } from 'lodash'; | ||
@@ -114,4 +115,19 @@ /** | ||
source && this.assign(source); | ||
this.on('change', throttle( | ||
this._onChange.bind(this), | ||
config.throttleWait, | ||
{ leading: true, trailing: true }, | ||
)) | ||
} | ||
private async _onChange() { | ||
// 在子页面修改时生成缓存,注意不需要 await | ||
if (config.webFileCache) { | ||
if (!this.$html) | ||
await this.load(); | ||
generator.saveViewCache(this); | ||
} | ||
} | ||
async load() { | ||
@@ -181,2 +197,4 @@ const result: View = await viewService.load({ | ||
// 在子页面修改时生成缓存,注意不需要 await | ||
config.webFileCache && generator.saveViewCache(this); | ||
history.push(`添加子页面"${this.name}${this.title ? `(${this.title})` : ''}"`); | ||
@@ -381,4 +399,4 @@ return this; | ||
const parentNode = this.findElement(nodePath); | ||
const viewId = parentNode?.view?.id; | ||
const parentId = parentNode?.id; | ||
const viewId = parentNode.view.id; | ||
const parentId = parentNode.id; | ||
if (template) { | ||
@@ -385,0 +403,0 @@ const newNode = Element.parse(template); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1686928
37218