|
|
@ -4,386 +4,195 @@ import { Processor } from '../Processor'; |
|
|
|
import { PlaceHolder } from '@/utils/PlaceHolder'; |
|
|
|
|
|
|
|
class HttpRequest extends Processor { |
|
|
|
#editorDialogWidth: number = 1280; |
|
|
|
#HttpMethodTypeEnum: any; |
|
|
|
#httpMethodTypeOptionsRef = ref(<any>[]); |
|
|
|
#parameterOptionsRef = ref(<any>[]); |
|
|
|
#sqlQueryResultFieldsRef = ref(<any>[]); |
|
|
|
#editorForm: any; |
|
|
|
#HttpAuthorizationTypeEnum: any; |
|
|
|
#httpAuthorizationTypeOptionsRef = ref(<any>[]); |
|
|
|
|
|
|
|
constructor(targetType: string, context?: any) { |
|
|
|
super(targetType, context); |
|
|
|
EnumTools.fetch(['io.sc.engine.rule.core.enums.HttpMethodType']).then((value) => { |
|
|
|
this.PROCESSOR_TYPE = 'HTTP_REQUEST'; |
|
|
|
this.EDITOR_DIALOG_WIDTH = 1024; |
|
|
|
EnumTools.fetch(['io.sc.engine.rule.core.enums.HttpMethodType', 'io.sc.engine.rule.core.enums.HttpAuthorizationType']).then((value) => { |
|
|
|
this.#HttpMethodTypeEnum = value.HttpMethodType; |
|
|
|
this.#httpMethodTypeOptionsRef = Options.enum(this.#HttpMethodTypeEnum); |
|
|
|
this.#HttpAuthorizationTypeEnum = value.HttpAuthorizationType; |
|
|
|
this.#httpAuthorizationTypeOptionsRef = Options.enum(this.#HttpAuthorizationTypeEnum); |
|
|
|
}); |
|
|
|
if (this.targetType === Processor.PARAMETER) { |
|
|
|
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + this.context.target.id)).then((response) => { |
|
|
|
this.#parameterOptionsRef.value = Tools.objects2Options(response.data, 'name', 'code'); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public getToolbarAction(): any { |
|
|
|
return { |
|
|
|
extend: 'add', |
|
|
|
name: 'http', |
|
|
|
label: $t('io.sc.engine.rule.core.enums.ProcessorType.HTTP_REQUEST'), |
|
|
|
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), |
|
|
|
icon: 'sync_alt', |
|
|
|
enableIf: (args: any) => { |
|
|
|
const type = this.context.target.type; |
|
|
|
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; |
|
|
|
}, |
|
|
|
afterClick: (args: any) => { |
|
|
|
args.grid.getEditorForm().setFieldValue('type', 'HTTP_REQUEST'); |
|
|
|
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); |
|
|
|
}, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
public format(row: any): any { |
|
|
|
return { |
|
|
|
componentType: 'w-code-mirror', |
|
|
|
attrs: { |
|
|
|
lang: 'sql', |
|
|
|
rows: 4, |
|
|
|
editable: false, |
|
|
|
modelValue: row.sql, |
|
|
|
placeholder: true, |
|
|
|
}, |
|
|
|
}; |
|
|
|
return row.httpMethod + ', ' + PlaceHolder.replace(row.httpUrl); |
|
|
|
} |
|
|
|
|
|
|
|
public getEditorFields(): any { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
colSpan: 2, |
|
|
|
colSpan: 3, |
|
|
|
name: 'httpMethod', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpMethod'), |
|
|
|
type: 'w-select', |
|
|
|
clearable: true, |
|
|
|
options: this.#httpMethodTypeOptionsRef, |
|
|
|
rows: 1, |
|
|
|
showIf: (args: any) => { |
|
|
|
return 'HTTP_REQUEST' === args.form.getFieldValue('type'); |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 5, |
|
|
|
name: 'sql', |
|
|
|
colSpan: 9, |
|
|
|
name: 'httpUrl', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpUrl'), |
|
|
|
type: 'w-text', |
|
|
|
showIf: (args: any) => { |
|
|
|
return 'HTTP_REQUEST' === args.form.getFieldValue('type'); |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 3, |
|
|
|
name: 'sqlParameterValues', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'), |
|
|
|
name: 'httpAuthType', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpAuthType'), |
|
|
|
type: 'w-select', |
|
|
|
options: this.#httpAuthorizationTypeOptionsRef, |
|
|
|
showIf: (args: any) => { |
|
|
|
return 'SQL' === args.form.getFieldValue('type'); |
|
|
|
}, |
|
|
|
type: 'w-grid', |
|
|
|
height: 150, |
|
|
|
title: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'), |
|
|
|
autoFetchData: false, |
|
|
|
dense: true, |
|
|
|
dbClickOperation: 'edit', |
|
|
|
dndMode: 'local', |
|
|
|
pageable: false, |
|
|
|
configButton: false, |
|
|
|
toolbarConfigure: { noIcon: false }, |
|
|
|
toolbarActions: [ |
|
|
|
{ |
|
|
|
name: 'analyze', |
|
|
|
label: $t('analyze'), |
|
|
|
icon: 'bi-tag', |
|
|
|
click: (args: any) => { |
|
|
|
const sql = args.grid.getEditorForm().getFieldValue('sql'); |
|
|
|
const regex = /\$\{[\u0000-\uFFFF]+?\}/g; |
|
|
|
const array: any[] = sql.match(regex); |
|
|
|
const rows: any[] = []; |
|
|
|
array.forEach((item) => { |
|
|
|
rows.push({ name: item, value: '' }); |
|
|
|
}); |
|
|
|
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues'); |
|
|
|
grid.setLocalData(rows); |
|
|
|
}, |
|
|
|
}, |
|
|
|
'separator', |
|
|
|
'add', |
|
|
|
'edit', |
|
|
|
[ |
|
|
|
{ |
|
|
|
extend: 'remove', |
|
|
|
click: (args: any) => { |
|
|
|
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues'); |
|
|
|
grid.removeRows(args.selecteds); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
extend: 'remove', |
|
|
|
name: 'removeAll', |
|
|
|
label: $t('deleteAll'), |
|
|
|
click: (args: any) => { |
|
|
|
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues'); |
|
|
|
grid.setLocalData([]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
width: '50%', |
|
|
|
name: 'name', |
|
|
|
label: $t('name'), |
|
|
|
align: 'left', |
|
|
|
sortable: false, |
|
|
|
format: (value: any) => { |
|
|
|
return PlaceHolder.replace(value); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
width: '100%', |
|
|
|
name: 'value', |
|
|
|
label: $t('value'), |
|
|
|
sortable: false, |
|
|
|
}, |
|
|
|
], |
|
|
|
editor: { |
|
|
|
dialog: { |
|
|
|
width: '600px', |
|
|
|
}, |
|
|
|
form: { |
|
|
|
colsNum: 1, |
|
|
|
fields: [ |
|
|
|
{ |
|
|
|
name: 'name', |
|
|
|
label: $t('name'), |
|
|
|
type: 'w-code-mirror', |
|
|
|
toolbar: false, |
|
|
|
lang: 'java', |
|
|
|
rows: 1, |
|
|
|
placeholder: true, |
|
|
|
autoCompletion: this.autoCompletionManager.autoCompletion(), |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: 'value', |
|
|
|
label: $t('value'), |
|
|
|
type: 'w-text', |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; |
|
|
|
}, |
|
|
|
onBeforeEditorDataSubmit: (args: any) => { |
|
|
|
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues'); |
|
|
|
const form = grid.getEditorForm(); |
|
|
|
if ('add' == form.getStatus() || 'clone' == form.getStatus()) { |
|
|
|
grid.addLocalData(args.data); |
|
|
|
args.callback(false); |
|
|
|
} else if ('edit' == form.getStatus()) { |
|
|
|
grid.updateLocalData(args.data); |
|
|
|
args.callback(false); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 3, |
|
|
|
name: 'httpAuthApikey', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpAuthApikey'), |
|
|
|
type: 'w-text', |
|
|
|
showIf: (args: any) => { |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY'; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 4, |
|
|
|
name: 'sqlQueryResult', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.sqlQueryResult'), |
|
|
|
colSpan: 6, |
|
|
|
name: 'httpAuthApiValue', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpAuthApiValue'), |
|
|
|
type: 'w-text', |
|
|
|
showIf: (args: any) => { |
|
|
|
return 'SQL' === args.form.getFieldValue('type'); |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY'; |
|
|
|
}, |
|
|
|
type: 'w-grid', |
|
|
|
height: 250, |
|
|
|
autoFetchData: false, |
|
|
|
title: $t('re.resources.designer.processor.grid.entity.sqlQueryResult'), |
|
|
|
dense: true, |
|
|
|
dndMode: 'local', |
|
|
|
pageable: false, |
|
|
|
checkboxSelection: false, |
|
|
|
configButton: false, |
|
|
|
toolbarConfigure: { noIcon: false }, |
|
|
|
toolbarActions: [ |
|
|
|
{ |
|
|
|
name: 'execute', |
|
|
|
label: $t('execute'), |
|
|
|
icon: 'bi-caret-right', |
|
|
|
click: (args: any) => { |
|
|
|
const sql = this.#editorForm.getFieldValue('sql'); |
|
|
|
const grid = this.#editorForm.getFieldComponent('sqlParameterValues'); |
|
|
|
const sqlParameterValues = grid?.getRows(); |
|
|
|
axios |
|
|
|
.post(Environment.apiContextPath('/api/re/model/parameter/processor/executeSql'), { |
|
|
|
sql: sql, |
|
|
|
sqlParameterValues: sqlParameterValues, |
|
|
|
}) |
|
|
|
.then((response) => { |
|
|
|
const fieldMetaDatas: any[] = response.data.fieldMetaDatas; |
|
|
|
fieldMetaDatas.forEach((field) => { |
|
|
|
field.value = field.name; |
|
|
|
field.label = field.name; |
|
|
|
}); |
|
|
|
const data = response.data.data; |
|
|
|
const grid = this.#editorForm.getFieldComponent('sqlQueryResult'); |
|
|
|
this.#sqlQueryResultFieldsRef.value = fieldMetaDatas; |
|
|
|
grid.setLocalData(data); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
columns: computed(() => { |
|
|
|
return this.#sqlQueryResultFieldsRef.value; |
|
|
|
}), |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 3, |
|
|
|
name: 'sqlFieldMapping', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'), |
|
|
|
name: 'httpAuthBasicUsername', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicUsername'), |
|
|
|
type: 'w-text', |
|
|
|
showIf: (args: any) => { |
|
|
|
return 'SQL' === args.form.getFieldValue('type'); |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH'; |
|
|
|
}, |
|
|
|
type: 'w-grid', |
|
|
|
height: 250, |
|
|
|
width: '100%', |
|
|
|
autoFetchData: false, |
|
|
|
title: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'), |
|
|
|
dense: true, |
|
|
|
dbClickOperation: 'edit', |
|
|
|
dndMode: 'local', |
|
|
|
pageable: false, |
|
|
|
configButton: false, |
|
|
|
toolbarConfigure: { noIcon: false }, |
|
|
|
toolbarActions: [ |
|
|
|
'add', |
|
|
|
'edit', |
|
|
|
[ |
|
|
|
{ |
|
|
|
extend: 'remove', |
|
|
|
click: (args: any) => { |
|
|
|
const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping'); |
|
|
|
grid.removeLocalData(args.selecteds); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
extend: 'remove', |
|
|
|
name: 'removeAll', |
|
|
|
label: $t('deleteAll'), |
|
|
|
click: (args: any) => { |
|
|
|
const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping'); |
|
|
|
grid.setLocalData([]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
width: '50%', |
|
|
|
name: 'parameter', |
|
|
|
label: $t('parameterName'), |
|
|
|
sortable: false, |
|
|
|
format: (value: any) => { |
|
|
|
return PlaceHolder.replace(value); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
width: '50%', |
|
|
|
name: 'field', |
|
|
|
label: $t('fieldName'), |
|
|
|
align: 'left', |
|
|
|
sortable: false, |
|
|
|
}, |
|
|
|
], |
|
|
|
editor: { |
|
|
|
dialog: { |
|
|
|
width: '600px', |
|
|
|
}, |
|
|
|
form: { |
|
|
|
colsNum: 1, |
|
|
|
fields: [ |
|
|
|
{ |
|
|
|
name: 'parameter', |
|
|
|
label: $t('parameterName'), |
|
|
|
type: 'w-select', |
|
|
|
options: this.#parameterOptionsRef.value, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: 'field', |
|
|
|
label: $t('fieldName'), |
|
|
|
type: 'w-select', |
|
|
|
options: this.#sqlQueryResultFieldsRef.value, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 6, |
|
|
|
name: 'httpAuthBasicPassword', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicPassword'), |
|
|
|
type: 'w-text', |
|
|
|
showIf: (args: any) => { |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH'; |
|
|
|
}, |
|
|
|
onBeforeEditorDataSubmit: (args: any) => { |
|
|
|
const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping'); |
|
|
|
const form = grid.getEditorForm(); |
|
|
|
if ('add' == form.getStatus() || 'clone' == form.getStatus()) { |
|
|
|
grid.addLocalData(args.data); |
|
|
|
args.callback(false); |
|
|
|
} else if ('edit' == form.getStatus()) { |
|
|
|
grid.updateLocalData(args.data); |
|
|
|
args.callback(false); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 9, |
|
|
|
name: 'httpAuthBearerToken', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpAuthBearerToken'), |
|
|
|
type: 'w-text', |
|
|
|
showIf: (args: any) => { |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BEARER'; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 12, |
|
|
|
name: 'httpRequestBody', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpRequestBody'), |
|
|
|
showIf: (args: any) => { |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; |
|
|
|
}, |
|
|
|
type: 'w-code-mirror', |
|
|
|
rows: 4, |
|
|
|
toolbar: false, |
|
|
|
lineNumber: false, |
|
|
|
lang: 'json', |
|
|
|
lineWrap: false, |
|
|
|
lineBreak: true, |
|
|
|
placeholder: true, |
|
|
|
autoCompletion: this.autoCompletionManager.autoCompletion(), |
|
|
|
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 12, |
|
|
|
name: 'httpResponseBody', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpResponseBody'), |
|
|
|
showIf: (args: any) => { |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; |
|
|
|
}, |
|
|
|
type: 'w-code-mirror', |
|
|
|
lang: 'json', |
|
|
|
rows: 5, |
|
|
|
toolbar: false, |
|
|
|
lineNumber: false, |
|
|
|
lineWrap: false, |
|
|
|
lineBreak: true, |
|
|
|
}, |
|
|
|
{ |
|
|
|
colSpan: 12, |
|
|
|
name: 'httpResponseMapping', |
|
|
|
label: $t('re.resources.designer.processor.grid.entity.httpResponseMapping'), |
|
|
|
showIf: (args: any) => { |
|
|
|
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; |
|
|
|
}, |
|
|
|
type: 'w-code-mirror', |
|
|
|
rows: 8, |
|
|
|
toolbar: false, |
|
|
|
lineNumber: false, |
|
|
|
lang: 'json', |
|
|
|
lineWrap: false, |
|
|
|
lineBreak: true, |
|
|
|
placeholder: true, |
|
|
|
autoCompletion: this.autoCompletionManager.autoCompletion(), |
|
|
|
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), |
|
|
|
}, |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
public getViewerFields(): any { |
|
|
|
return [ |
|
|
|
{ name: 'sqlDatasourceName', label: $t('re.resources.designer.processor.grid.entity.sqlDatasourceName') }, |
|
|
|
{ name: 'sql', label: $t('re.resources.designer.processor.grid.entity.sql') }, |
|
|
|
{ name: 'sqlParameterValues', label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues') }, |
|
|
|
{ name: 'sqlFieldMapping', label: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping') }, |
|
|
|
{ name: 'httpMethod', label: $t('re.resources.designer.processor.grid.entity.httpMethod') }, |
|
|
|
{ name: 'httpUrl', label: $t('re.resources.designer.processor.grid.entity.httpUrl') }, |
|
|
|
{ name: 'httpAuthType', label: $t('re.resources.designer.processor.grid.entity.httpAuthType') }, |
|
|
|
{ name: 'httpAuthApikey', label: $t('re.resources.designer.processor.grid.entity.httpAuthApikey') }, |
|
|
|
{ name: 'httpAuthApiValue', label: $t('re.resources.designer.processor.grid.entity.httpAuthApiValue') }, |
|
|
|
{ name: 'httpAuthBasicUsername', label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicUsername') }, |
|
|
|
{ name: 'httpAuthBasicPassword', label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicPassword') }, |
|
|
|
{ name: 'httpAuthBearerToken', label: $t('re.resources.designer.processor.grid.entity.httpAuthBearerToken') }, |
|
|
|
{ name: 'httpRequestBody', label: $t('re.resources.designer.processor.grid.entity.httpRequestBody') }, |
|
|
|
{ name: 'httpResponseMapping', label: $t('re.resources.designer.processor.grid.entity.httpResponseMapping') }, |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
public beforeEditorDataSubmit(args: any): void { |
|
|
|
const form = args.grid.getEditorForm(); |
|
|
|
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues'); |
|
|
|
const sqlParameterValuesLocalData: any[] = sqlParameterValuesGrid.getRows(); |
|
|
|
const sqlParameterValues: any[] = []; |
|
|
|
sqlParameterValuesLocalData.forEach((item) => { |
|
|
|
sqlParameterValues.push({ |
|
|
|
name: item.name, |
|
|
|
value: item.value, |
|
|
|
}); |
|
|
|
}); |
|
|
|
args.data.sqlParameterValues = Tools.object2Json(sqlParameterValues); |
|
|
|
|
|
|
|
const sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping'); |
|
|
|
const sqlFieldMappingLocalData: any[] = sqlFieldMappingGrid.getRows(); |
|
|
|
const sqlFieldMapping: any[] = Tools.objects2Objects(sqlFieldMappingLocalData, { field: 'field', parameter: 'parameter' }); |
|
|
|
args.data.sqlFieldMapping = Tools.object2Json(sqlFieldMapping); |
|
|
|
} |
|
|
|
public beforeEditorDataSubmit(args: any): void {} |
|
|
|
|
|
|
|
public afterEditorOpen(args: any): void { |
|
|
|
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); |
|
|
|
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH); |
|
|
|
this.initAutoCompletionManager(); |
|
|
|
this.initUserDefinedFunctionsManager(); |
|
|
|
|
|
|
|
this.#editorForm = args.grid.getEditorForm(); |
|
|
|
const form = args.grid.getEditorForm(); |
|
|
|
const row = args.data; |
|
|
|
|
|
|
|
axios.get(Environment.apiContextPath('api/re/model/parameter/findParametersByParameterId?parameterId=' + this.context.target.id)).then((response) => { |
|
|
|
this.#parameterOptionsRef.value = Tools.objects2Objects(response.data, { |
|
|
|
label: 'name', |
|
|
|
value: (parameter: any) => { |
|
|
|
return '${' + parameter.name + '}'; |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues'); |
|
|
|
const sqlParameterValuesRows = Tools.json2Object(row.sqlParameterValues); |
|
|
|
sqlParameterValuesGrid.setLocalData(sqlParameterValuesRows); |
|
|
|
|
|
|
|
const sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping'); |
|
|
|
const sqlFieldMappingRows = Tools.json2Object(row.sqlFieldMapping); |
|
|
|
sqlFieldMappingGrid.setLocalData(sqlFieldMappingRows); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|