|
|
|
<template>
|
|
|
|
<w-grid
|
|
|
|
ref="gridRef"
|
|
|
|
:title="$t('re.resources.designer.processor.grid.title')"
|
|
|
|
dense-body
|
|
|
|
class="px-1"
|
|
|
|
hide-bottom
|
|
|
|
:config-button="false"
|
|
|
|
selection="multiple"
|
|
|
|
:checkbox-selection="false"
|
|
|
|
:tree="false"
|
|
|
|
:fetch-data-url="Environment.apiContextPath('/api/re/model/parameter/processor/findByParameterId?parameterId=' + parameter.id)"
|
|
|
|
:data-url="Environment.apiContextPath('/api/re/model/parameter/processor')"
|
|
|
|
:pageable="false"
|
|
|
|
:toolbar-configure="{ noIcon: false }"
|
|
|
|
:toolbar-actions="[
|
|
|
|
'refresh',
|
|
|
|
'separator',
|
|
|
|
[
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
click: undefined,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'optionValue',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('OPTION_VALUE'),
|
|
|
|
icon: 'bi-card-list',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'OPTION_VALUE');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'arithmetic',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('ARITHMETIC'),
|
|
|
|
icon: 'bi-calculator',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'ARITHMETIC');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'ternary',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('TERNARY'),
|
|
|
|
icon: 'bi-question',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'TERNARY');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'whenThen',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('WHEN_THEN'),
|
|
|
|
icon: 'bi-sliders',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'WHEN_THEN');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'numberRange',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('NUMBER_RANGE'),
|
|
|
|
icon: 'bi-justify',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'NUMBER_RANGE');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'conditionRange',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('CONDITION_RANGE'),
|
|
|
|
icon: 'bi-rainbow',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'CONDITION_RANGE');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'decisionTable2c',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('DECISION_TABLE_2C'),
|
|
|
|
icon: 'bi-grid-3x2',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'DECISION_TABLE_2C');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'decisionTable',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('DECISION_TABLE'),
|
|
|
|
icon: 'bi-grid-3x3',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'DECISION_TABLE');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'decisionTree',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('DECISION_TREE'),
|
|
|
|
icon: 'bi-tree',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'DECISION_TREE');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'executionFlow',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('EXECUTION_FLOW'),
|
|
|
|
icon: 'bi-bounding-box-circles',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'EXECUTION_FLOW');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'pmml',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('PMML'),
|
|
|
|
icon: 'bi-filetype-xml',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'PMML');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'groovyScript',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('GROOVY_SCRIPT'),
|
|
|
|
icon: 'bi-code',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'GROOVY_SCRIPT');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'sql',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('SQL'),
|
|
|
|
icon: 'bi-filetype-sql',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'SQL');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'rule',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('RULE'),
|
|
|
|
icon: 'bi-shadows',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'RULE');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'add',
|
|
|
|
name: 'singleRule',
|
|
|
|
label: Formater.enum(Enums.ProcessorType)('SINGLE_RULE'),
|
|
|
|
icon: 'bi-noise-reduction',
|
|
|
|
enableIf: (arg) => {
|
|
|
|
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
|
|
|
|
},
|
|
|
|
afterClick: (arg) => {
|
|
|
|
arg.grid.getEditorForm().setFieldValue('type', 'SINGLE_RULE');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'edit',
|
|
|
|
'remove',
|
|
|
|
'separator',
|
|
|
|
'view',
|
|
|
|
'separator',
|
|
|
|
'export',
|
|
|
|
]"
|
|
|
|
:columns="[
|
|
|
|
{ width: 80, name: 'enable', label: $t('isEnable'), align: 'center', sortable: false, format: Formater.enableTag() },
|
|
|
|
{ width: 60, name: 'order', label: $t('order'), sortable: false, align: 'right' },
|
|
|
|
{ width: 150, name: 'type', label: $t('type'), sortable: false, format: Formater.enum(Enums.ProcessorType) },
|
|
|
|
{
|
|
|
|
width: '100%',
|
|
|
|
name: 'content',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.content'),
|
|
|
|
sortable: false,
|
|
|
|
format: (value, row) => {
|
|
|
|
const type = row.type;
|
|
|
|
if ('OPTION_VALUE' === type) {
|
|
|
|
return row.optionCode;
|
|
|
|
} else if ('ARITHMETIC' === type) {
|
|
|
|
return row.arithmetic;
|
|
|
|
} else if ('TERNARY' === type) {
|
|
|
|
return row.ternaryCondition + ' <b><span>?</span></b> ' + row.ternaryTrue + ' <b><span>:</span></b> ' + row.ternaryFalse;
|
|
|
|
} else if ('WHEN_THEN' === type) {
|
|
|
|
var str = '';
|
|
|
|
if (row.isWhenThenShorted) {
|
|
|
|
str += '<span>' + $t('re.resources.designer.processor.grid.entity.isWhenThenShorted') + ', </span>';
|
|
|
|
}
|
|
|
|
if (row.when) {
|
|
|
|
str += '<span>When</span> ' + row.when + ' ';
|
|
|
|
}
|
|
|
|
if (row.then) {
|
|
|
|
str += '<span>Then</span> ' + row.then;
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
} else if ('NUMBER_RANGE' === type) {
|
|
|
|
var objs = Tools.json2Object(row.numberRange);
|
|
|
|
if (objs) {
|
|
|
|
var str = '<div>' + row.numberRangeVar + ':</div>';
|
|
|
|
str += `<div class='border'>`;
|
|
|
|
str += `<table width='100%'>`;
|
|
|
|
for (var i = 0; i < objs.length; i++) {
|
|
|
|
var obj = objs[i];
|
|
|
|
str += '<tr>';
|
|
|
|
str += ' <td>' + Tools.generateIntervalRange(obj.minIncluded, obj.min, obj.max, obj.maxIncluded) + '</td>';
|
|
|
|
str += ' <td><span>' + ('' + obj.value) + '</span></td>';
|
|
|
|
str += '</tr>';
|
|
|
|
}
|
|
|
|
str += '</table>';
|
|
|
|
str += `</div>`;
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]"
|
|
|
|
:editor="{
|
|
|
|
dialog: {
|
|
|
|
width: '600px',
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
colsNum: 1,
|
|
|
|
fields: [
|
|
|
|
{ name: 'parameter', label: 'parameter', type: 'text', defaultValue: parameter.id, hidden: true },
|
|
|
|
{ name: 'id', label: $t('id'), type: 'text', hidden: true },
|
|
|
|
{ name: 'order', label: $t('order'), type: 'number', hidden: true },
|
|
|
|
{ name: 'type', label: $t('type'), type: 'text', hidden: true },
|
|
|
|
{ name: 'description', label: $t('description'), type: 'text' },
|
|
|
|
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true },
|
|
|
|
{
|
|
|
|
name: 'optionCode',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.optionCode'),
|
|
|
|
type: 'select',
|
|
|
|
options: optionOptionsRef,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'OPTION_VALUE' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'arithmetic',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.arithmetic'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
lang: 'java',
|
|
|
|
rows: 5,
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef,
|
|
|
|
extAutoCompletionOptions: GroovyFunctions,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'ARITHMETIC' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'ternaryCondition',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.ternaryCondition'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
lang: 'java',
|
|
|
|
rows: 1,
|
|
|
|
height: '32px',
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef,
|
|
|
|
extAutoCompletionOptions: GroovyFunctions,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'TERNARY' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'ternaryTrue',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.ternaryTrue'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
lang: 'java',
|
|
|
|
rows: 1,
|
|
|
|
height: '32px',
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef,
|
|
|
|
extAutoCompletionOptions: GroovyFunctions,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'TERNARY' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'ternaryFalse',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.ternaryFalse'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
lang: 'java',
|
|
|
|
rows: 1,
|
|
|
|
height: '32px',
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef,
|
|
|
|
extAutoCompletionOptions: GroovyFunctions,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'TERNARY' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'when',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.when'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
lang: 'java',
|
|
|
|
rows: 1,
|
|
|
|
height: '32px',
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef,
|
|
|
|
extAutoCompletionOptions: GroovyFunctions,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'WHEN_THEN' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'then',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.then'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
lang: 'java',
|
|
|
|
rows: 1,
|
|
|
|
height: '32px',
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef,
|
|
|
|
extAutoCompletionOptions: GroovyFunctions,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'WHEN_THEN' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'isWhenThenShorted',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.isWhenThenShorted'),
|
|
|
|
type: 'checkbox',
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'WHEN_THEN' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'numberRangeVar',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.numberRangeVar'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
lang: 'java',
|
|
|
|
rows: 1,
|
|
|
|
height: '32px',
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef,
|
|
|
|
extAutoCompletionOptions: GroovyFunctions,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'NUMBER_RANGE' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'numberRange',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.numberRange'),
|
|
|
|
type: 'w-grid',
|
|
|
|
height: 300,
|
|
|
|
pageable: false,
|
|
|
|
configButton: false,
|
|
|
|
toolbarConfigure: { noIcon: false },
|
|
|
|
toolbarActions: ['add', 'clone', 'remove'],
|
|
|
|
columns: [
|
|
|
|
{ width: 200, name: 'uuid', label: 'uuid', hidden: true },
|
|
|
|
{ width: 60, name: 'minIncluded', label: $t('include') },
|
|
|
|
{ width: 100, name: 'min', label: $t('minValue'), align: 'center' },
|
|
|
|
{ width: 100, name: 'max', label: $t('maxValue'), align: 'center' },
|
|
|
|
{ width: 60, name: 'maxIncluded', label: $t('include'), type: 'boolean' },
|
|
|
|
{ width: '100%', name: 'value', label: $t('value') },
|
|
|
|
],
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'NUMBER_RANGE' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'conditionRange',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.conditionRange'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'CONDITION_RANGE' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'decisionTable2C',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.decisionTable2C'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'DECISION_TABLE_2C' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'decisionTable',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.decisionTable'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'DECISION_TABLE' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'decisionTree',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.decisionTree'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'DECISION_TREE' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'executionFlow',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.executionFlow'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'EXECUTION_FLOW' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'pmml',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.pmml'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'PMML' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'groovyScript',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.groovyScript'),
|
|
|
|
type: 'code-mirror',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'GROOVY_SCRIPT' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sqlDatasourceName',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.sqlDatasourceName'),
|
|
|
|
type: 'select',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'SQL' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sql',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.sql'),
|
|
|
|
type: 'select',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'SQL' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sqlParameterValues',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'),
|
|
|
|
type: 'select',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'SQL' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sqlFieldMapping',
|
|
|
|
label: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'),
|
|
|
|
type: 'select',
|
|
|
|
rows: 1,
|
|
|
|
showIf: (arg) => {
|
|
|
|
return 'SQL' === arg.form.getFieldValue('type');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}"
|
|
|
|
:viewer="{
|
|
|
|
panel: {
|
|
|
|
columnNum: 1,
|
|
|
|
fields: [
|
|
|
|
{ name: 'id', label: $t(''), primaryKey: true },
|
|
|
|
{ name: 'parameter', label: $t('') },
|
|
|
|
{ name: 'description', label: $t('') },
|
|
|
|
{ name: 'order', label: $t('') },
|
|
|
|
{ name: 'enable', label: $t('') },
|
|
|
|
{ name: 'type', label: $t('') },
|
|
|
|
|
|
|
|
{ name: 'optionCode', label: $t('re.resources.designer.processor.grid.entity.optionCode') },
|
|
|
|
{ name: 'arithmetic', label: $t('re.resources.designer.processor.grid.entity.arithmetic') },
|
|
|
|
{ name: 'ternaryCondition', label: $t('re.resources.designer.processor.grid.entity.ternaryCondition') },
|
|
|
|
{ name: 'ternaryTrue', label: $t('re.resources.designer.processor.grid.entity.ternaryTrue') },
|
|
|
|
{ name: 'ternaryFalse', label: $t('re.resources.designer.processor.grid.entity.ternaryFalse') },
|
|
|
|
{ name: 'when', label: $t('re.resources.designer.processor.grid.entity.when') },
|
|
|
|
{ name: 'then', label: $t('re.resources.designer.processor.grid.entity.then') },
|
|
|
|
{ name: 'isWhenThenShorted', label: $t('re.resources.designer.processor.grid.entity.isWhenThenShorted') },
|
|
|
|
{ name: 'rule', label: $t('re.resources.designer.processor.grid.entity.rule') },
|
|
|
|
{ name: 'singleRule', label: $t('re.resources.designer.processor.grid.entity.singleRule') },
|
|
|
|
{ name: 'numberRange', label: $t('re.resources.designer.processor.grid.entity.numberRange') },
|
|
|
|
{ name: 'conditionRange', label: $t('re.resources.designer.processor.grid.entity.conditionRange') },
|
|
|
|
{ name: 'decisionTable2C', label: $t('re.resources.designer.processor.grid.entity.decisionTable2C') },
|
|
|
|
{ name: 'decisionTable', label: $t('re.resources.designer.processor.grid.entity.decisionTable') },
|
|
|
|
{ name: 'groovyScript', label: $t('re.resources.designer.processor.grid.entity.groovyScript') },
|
|
|
|
|
|
|
|
{ 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: 'dataComeFrom', label: $t('dataComeFrom') },
|
|
|
|
{ name: 'creator', label: $t('creator') },
|
|
|
|
{ name: 'createDate', label: $t('createDate') },
|
|
|
|
{ name: 'lastModifier', label: $t('lastModifier') },
|
|
|
|
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
|
|
|
|
{ name: 'corporationCode', label: $t('corporationCode') },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}"
|
|
|
|
@after-editor-open="
|
|
|
|
(row) => {
|
|
|
|
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemterHintsByParameterId/' + parameter.id)).then((response) => {
|
|
|
|
const names = [];
|
|
|
|
if (response.data?.parentParameterNames && response.data?.parentParameterNames.length > 0) {
|
|
|
|
for (const item of response.data?.parentParameterNames) {
|
|
|
|
names.push({ label: item, type: 'variable', apply: '${' + item + '}' });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (response.data?.parameterNames && response.data?.parameterNames.length > 0) {
|
|
|
|
for (const item of response.data?.parameterNames) {
|
|
|
|
names.push({ label: item, type: 'variable', apply: '${' + item + '}' });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
autoCompletionOptionsRef = names;
|
|
|
|
});
|
|
|
|
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + parameter.id)).then((response) => {
|
|
|
|
const parameters = [];
|
|
|
|
if (response.data) {
|
|
|
|
for (const parameter of response.data) {
|
|
|
|
if ('IN_OPTION' === parameter.type) {
|
|
|
|
parameters.push({ label: parameter.name, value: parameter.code });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
optionOptionsRef = parameters;
|
|
|
|
});
|
|
|
|
if ('NUMBER_RANGE' === row.type) {
|
|
|
|
const fields = gridRef.getEditorForm().getFields();
|
|
|
|
console.log(fields);
|
|
|
|
numberRangeGridRef.setLocalData(Tools.json2Object(row.numberRange));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
"
|
|
|
|
></w-grid>
|
|
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
import { axios, Environment, Formater, Tools, EnumTools, Options } from 'platform-core';
|
|
|
|
import GroovyFunctions from './GroovyFunctions';
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
fetchDataUrl: { type: String, default: '' },
|
|
|
|
dataUrl: { type: String, default: '' },
|
|
|
|
parameter: { type: Object, default: undefined },
|
|
|
|
});
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(e: 'rowClick', evt: Event, row: any, index: number): void;
|
|
|
|
(e: 'beforeRequestData', requestParams: URLSearchParams | any, callback: any): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const gridRef = ref();
|
|
|
|
const autoCompletionOptionsRef = ref([]);
|
|
|
|
const optionOptionsRef = ref([]);
|
|
|
|
const numberRangeGridRef = ref();
|
|
|
|
|
|
|
|
const refresh = () => {
|
|
|
|
gridRef.value.refresh();
|
|
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
gridRef.value.refresh();
|
|
|
|
});
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
refresh,
|
|
|
|
});
|
|
|
|
|
|
|
|
const Enums = await EnumTools.fetch(['io.sc.engine.rule.core.enums.ProcessorType']);
|
|
|
|
</script>
|