Skip to content
Merged

Dev #20

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { NodeRenderContext } from './node-render-context';
export { IsSidebarContext } from './sidebar-context';
export { NodeDisplayManager } from './node-display-manager';
export { IsSidebarContext } from './sidebar-context';

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export {useEditorProps} from './use-editor-props';
export {useIsSidebar} from './use-is-sidebar';
export {useNodeDisplayManager} from "./use-node-display-manager";
export {useIsSidebar} from './use-is-sidebar';
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ export class PromissionManager {
this.formList =[form,...(form.subForms||[])];
}

public getDatasource(code: string) {
const list = this.data.filter(item => item.formCode === code) || [];
return list.map(item => {
return {
...item,
fieldName:this.getFieldName(item.formCode,item.fieldCode)
private getFormFields(code:string){
for (const form of this.formList){
if (code === form.code){
return form.fields;
}
});
}
return [];
}


public getDatasource(code: string) {
return this.convertFieldsToColumns(code)
}

private getFieldName(formCode:string,fieldCode:string){
Expand All @@ -38,6 +42,30 @@ export class PromissionManager {
return null;
}

private convertFieldsToColumns(code:string){
const currentColumns = this.data.filter(item => item.formCode === code) || [];

return this.getFormFields(code).map(field => {
return {
id: field.id,
fieldName: field.name,
fieldCode: field.code,
formCode: code,
type: 'WRITE',
}
}).map(field => {
const currentColumnType = currentColumns.find(column => column.fieldCode === field.fieldCode);
if(currentColumnType){
return {
...field,
type:currentColumnType.type
}
}else {
return field;
}
});
}

public initFormPromission() {
if (this.data && this.data.length > 0) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export class Presenter {
nodes.push(...prevWorkflow.nodes);
}
}
console.log('update nodes:',nodes);
return {
...prevWorkflow,
...currentWorkflow,
Expand Down