|
@ -205,6 +205,33 @@ |
|
|
'edit', |
|
|
'edit', |
|
|
'remove', |
|
|
'remove', |
|
|
'separator', |
|
|
'separator', |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'enable', |
|
|
|
|
|
label: (arg) => { |
|
|
|
|
|
if (arg.selected?.enable) { |
|
|
|
|
|
return $t('disable'); |
|
|
|
|
|
} |
|
|
|
|
|
return $t('enable'); |
|
|
|
|
|
}, |
|
|
|
|
|
icon: (arg) => { |
|
|
|
|
|
if (arg.selected?.enable) { |
|
|
|
|
|
return 'x'; |
|
|
|
|
|
} |
|
|
|
|
|
return 'check'; |
|
|
|
|
|
}, |
|
|
|
|
|
enableIf: (arg) => { |
|
|
|
|
|
return arg.selected; |
|
|
|
|
|
}, |
|
|
|
|
|
click: (arg) => { |
|
|
|
|
|
const data = arg.selected; |
|
|
|
|
|
data.enable = !data.enable; |
|
|
|
|
|
console.log(data); |
|
|
|
|
|
axios.put(Environment.apiContextPath('/api/re/model/parameter/' + data.id), data).then((response) => { |
|
|
|
|
|
gridRef.replaceRow(response.data); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
'separator', |
|
|
'view', |
|
|
'view', |
|
|
'separator', |
|
|
'separator', |
|
|
'export', |
|
|
'export', |
|
@ -223,32 +250,51 @@ |
|
|
if ('OPTION_VALUE' === type) { |
|
|
if ('OPTION_VALUE' === type) { |
|
|
return row.optionCode; |
|
|
return row.optionCode; |
|
|
} else if ('ARITHMETIC' === type) { |
|
|
} else if ('ARITHMETIC' === type) { |
|
|
return row.arithmetic; |
|
|
return PlaceHolder.replace(row.arithmetic); |
|
|
} else if ('TERNARY' === type) { |
|
|
} else if ('TERNARY' === type) { |
|
|
return row.ternaryCondition + ' <b><span>?</span></b> ' + row.ternaryTrue + ' <b><span>:</span></b> ' + row.ternaryFalse; |
|
|
return row.ternaryCondition + ' <b><span>?</span></b> ' + row.ternaryTrue + ' <b><span>:</span></b> ' + row.ternaryFalse; |
|
|
} else if ('WHEN_THEN' === type) { |
|
|
} else if ('WHEN_THEN' === type) { |
|
|
var str = ''; |
|
|
let str = ''; |
|
|
if (row.isWhenThenShorted) { |
|
|
if (row.isWhenThenShorted) { |
|
|
str += '<span>' + $t('re.resources.designer.processor.grid.entity.isWhenThenShorted') + ', </span>'; |
|
|
str += '<span>' + $t('re.resources.designer.processor.grid.entity.isWhenThenShorted') + ', </span>'; |
|
|
} |
|
|
} |
|
|
if (row.when) { |
|
|
if (row.when) { |
|
|
str += '<span>When</span> ' + row.when + ' '; |
|
|
str += '<span>When</span> ' + PlaceHolder.replace(row.when) + ' '; |
|
|
} |
|
|
} |
|
|
if (row.then) { |
|
|
if (row.then) { |
|
|
str += '<span>Then</span> ' + row.then; |
|
|
str += '<span>Then</span> ' + PlaceHolder.replace(row.then); |
|
|
} |
|
|
} |
|
|
return str; |
|
|
return str; |
|
|
} else if ('NUMBER_RANGE' === type) { |
|
|
} else if ('NUMBER_RANGE' === type) { |
|
|
var objs = Tools.json2Object(row.numberRange); |
|
|
const objs = Tools.json2Object(row.numberRange); |
|
|
if (objs) { |
|
|
if (objs) { |
|
|
var str = '<div>' + row.numberRangeVar + ':</div>'; |
|
|
let str = `<div class='border border-b-0'>`; |
|
|
str += `<div class='border'>`; |
|
|
|
|
|
str += `<table width='100%'>`; |
|
|
str += `<table width='100%'>`; |
|
|
for (var i = 0; i < objs.length; i++) { |
|
|
for (let i = 0; i < objs.length; i++) { |
|
|
var obj = objs[i]; |
|
|
const obj = objs[i]; |
|
|
str += '<tr>'; |
|
|
str += '<tr>'; |
|
|
|
|
|
if (i == 0) { |
|
|
|
|
|
str += ' <td rowspan=' + objs.length + '>' + PlaceHolder.replace(row.numberRangeVar) + '</td>'; |
|
|
|
|
|
} |
|
|
str += ' <td>' + Tools.generateIntervalRange(obj.minIncluded, obj.min, obj.max, obj.maxIncluded) + '</td>'; |
|
|
str += ' <td>' + Tools.generateIntervalRange(obj.minIncluded, obj.min, obj.max, obj.maxIncluded) + '</td>'; |
|
|
str += ' <td><span>' + ('' + obj.value) + '</span></td>'; |
|
|
str += ' <td>' + ('' + PlaceHolder.replace('' + obj.value)) + '</td>'; |
|
|
|
|
|
str += '</tr>'; |
|
|
|
|
|
} |
|
|
|
|
|
str += '</table>'; |
|
|
|
|
|
str += '</div>'; |
|
|
|
|
|
return str; |
|
|
|
|
|
} |
|
|
|
|
|
return ''; |
|
|
|
|
|
} else if ('CONDITION_RANGE' === type) { |
|
|
|
|
|
const objs = Tools.json2Object(row.conditionRange); |
|
|
|
|
|
if (objs) { |
|
|
|
|
|
let str = `<div class='border border-b-0'>`; |
|
|
|
|
|
str += `<table width='100%'>`; |
|
|
|
|
|
for (let i = 0; i < objs.length; i++) { |
|
|
|
|
|
const obj = objs[i]; |
|
|
|
|
|
str += '<tr>'; |
|
|
|
|
|
str += ' <td>' + PlaceHolder.replace(obj.condition) + '</td>'; |
|
|
|
|
|
str += ' <td><span>' + ('' + PlaceHolder.replace(obj.value)) + '</span></td>'; |
|
|
str += '</tr>'; |
|
|
str += '</tr>'; |
|
|
} |
|
|
} |
|
|
str += '</table>'; |
|
|
str += '</table>'; |
|
@ -256,13 +302,21 @@ |
|
|
return str; |
|
|
return str; |
|
|
} |
|
|
} |
|
|
return ''; |
|
|
return ''; |
|
|
|
|
|
} else if ('PMML' === type) { |
|
|
|
|
|
return { |
|
|
|
|
|
componentType: 'w-code-mirror', |
|
|
|
|
|
bindModelValue: true, |
|
|
|
|
|
attrs: { |
|
|
|
|
|
rows: 3, |
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
]" |
|
|
]" |
|
|
:editor="{ |
|
|
:editor="{ |
|
|
dialog: { |
|
|
dialog: { |
|
|
width: '600px', |
|
|
width: '800px', |
|
|
}, |
|
|
}, |
|
|
form: { |
|
|
form: { |
|
|
colsNum: 1, |
|
|
colsNum: 1, |
|
@ -271,8 +325,8 @@ |
|
|
{ name: 'id', label: $t('id'), type: 'text', hidden: true }, |
|
|
{ name: 'id', label: $t('id'), type: 'text', hidden: true }, |
|
|
{ name: 'order', label: $t('order'), type: 'number', hidden: true }, |
|
|
{ name: 'order', label: $t('order'), type: 'number', hidden: true }, |
|
|
{ name: 'type', label: $t('type'), type: 'text', hidden: true }, |
|
|
{ name: 'type', label: $t('type'), type: 'text', hidden: true }, |
|
|
{ name: 'description', label: $t('description'), type: 'text' }, |
|
|
{ name: 'description', label: $t('description'), type: 'text', hidden: true }, |
|
|
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true }, |
|
|
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true, hidden: true }, |
|
|
{ |
|
|
{ |
|
|
name: 'optionCode', |
|
|
name: 'optionCode', |
|
|
label: $t('re.resources.designer.processor.grid.entity.optionCode'), |
|
|
label: $t('re.resources.designer.processor.grid.entity.optionCode'), |
|
@ -288,6 +342,8 @@ |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 5, |
|
|
rows: 5, |
|
|
|
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
@ -300,7 +356,8 @@ |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 1, |
|
|
rows: 1, |
|
|
height: '32px', |
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
@ -313,7 +370,8 @@ |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 1, |
|
|
rows: 1, |
|
|
height: '32px', |
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
@ -326,7 +384,8 @@ |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 1, |
|
|
rows: 1, |
|
|
height: '32px', |
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
@ -339,7 +398,8 @@ |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 1, |
|
|
rows: 1, |
|
|
height: '32px', |
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
@ -352,7 +412,8 @@ |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 1, |
|
|
rows: 1, |
|
|
height: '32px', |
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
@ -370,45 +431,232 @@ |
|
|
{ |
|
|
{ |
|
|
name: 'numberRangeVar', |
|
|
name: 'numberRangeVar', |
|
|
label: $t('re.resources.designer.processor.grid.entity.numberRangeVar'), |
|
|
label: $t('re.resources.designer.processor.grid.entity.numberRangeVar'), |
|
|
|
|
|
showIf: (arg) => { |
|
|
|
|
|
return 'NUMBER_RANGE' === arg.form.getFieldValue('type'); |
|
|
|
|
|
}, |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 1, |
|
|
rows: 1, |
|
|
height: '32px', |
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
showIf: (arg) => { |
|
|
|
|
|
return 'NUMBER_RANGE' === arg.form.getFieldValue('type'); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'numberRange', |
|
|
name: 'numberRange', |
|
|
label: $t('re.resources.designer.processor.grid.entity.numberRange'), |
|
|
label: $t('re.resources.designer.processor.grid.entity.numberRange'), |
|
|
|
|
|
showIf: (arg) => { |
|
|
|
|
|
return 'NUMBER_RANGE' === arg.form.getFieldValue('type'); |
|
|
|
|
|
}, |
|
|
type: 'w-grid', |
|
|
type: 'w-grid', |
|
|
height: 300, |
|
|
height: 300, |
|
|
|
|
|
denseBody: true, |
|
|
|
|
|
draggable: true, |
|
|
pageable: false, |
|
|
pageable: false, |
|
|
configButton: false, |
|
|
configButton: false, |
|
|
toolbarConfigure: { noIcon: false }, |
|
|
toolbarConfigure: { noIcon: false }, |
|
|
toolbarActions: ['add', 'clone', 'remove'], |
|
|
toolbarActions: [ |
|
|
|
|
|
'add', |
|
|
|
|
|
'clone', |
|
|
|
|
|
'edit', |
|
|
|
|
|
{ |
|
|
|
|
|
extend: 'remove', |
|
|
|
|
|
click: (arg) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('numberRange'); |
|
|
|
|
|
grid.removeRows(arg.selecteds); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
'separator', |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'example', |
|
|
|
|
|
label: $t('example'), |
|
|
|
|
|
icon: 'bi-balloon', |
|
|
|
|
|
click: (arg) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('numberRange'); |
|
|
|
|
|
const sampleData = [ |
|
|
|
|
|
{ uuid: Tools.uuid(), minIncluded: false, min: null, max: 0, maxIncluded: false, value: 1 }, |
|
|
|
|
|
{ uuid: Tools.uuid(), minIncluded: true, min: 0, max: 1, maxIncluded: false, value: 2 }, |
|
|
|
|
|
{ uuid: Tools.uuid(), minIncluded: true, min: 1, max: 2, maxIncluded: false, value: 3 }, |
|
|
|
|
|
{ uuid: Tools.uuid(), minIncluded: true, min: 2, max: 3, maxIncluded: false, value: 4 }, |
|
|
|
|
|
{ uuid: Tools.uuid(), minIncluded: true, min: 3, max: null, maxIncluded: false, value: 5 }, |
|
|
|
|
|
{ uuid: Tools.uuid(), minIncluded: false, min: null, max: null, maxIncluded: false, value: 0 }, |
|
|
|
|
|
]; |
|
|
|
|
|
grid.setLocalData(sampleData); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
primaryKey: 'uuid', |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ width: 200, name: 'uuid', label: 'uuid', hidden: true }, |
|
|
{ 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: 60, |
|
|
{ width: 100, name: 'max', label: $t('maxValue'), align: 'center' }, |
|
|
name: 'minIncluded', |
|
|
{ width: 60, name: 'maxIncluded', label: $t('include'), type: 'boolean' }, |
|
|
label: $t('include'), |
|
|
{ width: '100%', name: 'value', label: $t('value') }, |
|
|
align: 'center', |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
if (value) { |
|
|
|
|
|
return '['; |
|
|
|
|
|
} else { |
|
|
|
|
|
return '('; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ width: 100, name: 'min', label: $t('minValue'), align: 'right', sortable: false }, |
|
|
|
|
|
{ width: 100, name: 'max', label: $t('maxValue'), align: 'right', sortable: false }, |
|
|
|
|
|
{ |
|
|
|
|
|
width: 60, |
|
|
|
|
|
name: 'maxIncluded', |
|
|
|
|
|
label: $t('include'), |
|
|
|
|
|
align: 'center', |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
if (value) { |
|
|
|
|
|
return '['; |
|
|
|
|
|
} else { |
|
|
|
|
|
return ')'; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ width: '100%', name: 'value', label: $t('value'), sortable: false }, |
|
|
], |
|
|
], |
|
|
showIf: (arg) => { |
|
|
editor: { |
|
|
return 'NUMBER_RANGE' === arg.form.getFieldValue('type'); |
|
|
dialog: { |
|
|
|
|
|
width: '600px', |
|
|
|
|
|
}, |
|
|
|
|
|
form: { |
|
|
|
|
|
colsNum: 4, |
|
|
|
|
|
fields: [ |
|
|
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true, colSpan: 4 }, |
|
|
|
|
|
{ name: 'min', label: $t('minValue'), type: 'text', colSpan: 3 }, |
|
|
|
|
|
{ name: 'minIncluded', label: $t('include'), type: 'checkbox' }, |
|
|
|
|
|
{ name: 'max', label: $t('maxValue'), type: 'text', colSpan: 3 }, |
|
|
|
|
|
{ name: 'maxIncluded', label: $t('include'), type: 'checkbox' }, |
|
|
|
|
|
{ name: 'value', label: $t('value'), type: 'number', colSpan: 3 }, |
|
|
|
|
|
], |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
onBeforeEditorDataSubmit: (data, callback) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('numberRange'); |
|
|
|
|
|
const form = grid.getEditorForm(); |
|
|
|
|
|
if ('add' == form.getStatus() || 'clone' == form.getStatus()) { |
|
|
|
|
|
data.uuid = Tools.uuid(); |
|
|
|
|
|
grid.addRow(data); |
|
|
|
|
|
callback(false); |
|
|
|
|
|
} else if ('edit' == form.getStatus()) { |
|
|
|
|
|
grid.replaceRow(data); |
|
|
|
|
|
callback(false); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'conditionRange', |
|
|
name: 'conditionRange', |
|
|
label: $t('re.resources.designer.processor.grid.entity.conditionRange'), |
|
|
label: $t('re.resources.designer.processor.grid.entity.conditionRange'), |
|
|
type: 'code-mirror', |
|
|
|
|
|
rows: 1, |
|
|
|
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
|
return 'CONDITION_RANGE' === arg.form.getFieldValue('type'); |
|
|
return 'CONDITION_RANGE' === arg.form.getFieldValue('type'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
type: 'w-grid', |
|
|
|
|
|
height: 300, |
|
|
|
|
|
denseBody: true, |
|
|
|
|
|
draggable: true, |
|
|
|
|
|
pageable: false, |
|
|
|
|
|
configButton: false, |
|
|
|
|
|
toolbarConfigure: { noIcon: false }, |
|
|
|
|
|
toolbarActions: [ |
|
|
|
|
|
'add', |
|
|
|
|
|
'clone', |
|
|
|
|
|
'edit', |
|
|
|
|
|
{ |
|
|
|
|
|
extend: 'remove', |
|
|
|
|
|
click: (arg) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('conditionRange'); |
|
|
|
|
|
grid.removeRows(arg.selecteds); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
'separator', |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'example', |
|
|
|
|
|
label: $t('example'), |
|
|
|
|
|
icon: 'bi-balloon', |
|
|
|
|
|
click: (arg) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('conditionRange'); |
|
|
|
|
|
const sampleData = [ |
|
|
|
|
|
{ uuid: Tools.uuid(), condition: '${变量名}<=0', value: '0' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), condition: '${变量名}>0 && ${变量名}<=50', value: '50' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), condition: '${变量名}>50 && ${变量名}<=80', value: '80' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), condition: '${变量名}>80 && ${变量名}<=100', value: '100' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), condition: '${变量名}>100', value: '60' }, |
|
|
|
|
|
]; |
|
|
|
|
|
grid.setLocalData(sampleData); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
primaryKey: 'uuid', |
|
|
|
|
|
columns: [ |
|
|
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'condition', |
|
|
|
|
|
label: $t('condition'), |
|
|
|
|
|
align: 'left', |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'value', |
|
|
|
|
|
label: $t('value'), |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
editor: { |
|
|
|
|
|
dialog: { |
|
|
|
|
|
width: '600px', |
|
|
|
|
|
}, |
|
|
|
|
|
form: { |
|
|
|
|
|
colsNum: 1, |
|
|
|
|
|
fields: [ |
|
|
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'condition', |
|
|
|
|
|
label: $t('condition'), |
|
|
|
|
|
type: 'code-mirror', |
|
|
|
|
|
lang: 'java', |
|
|
|
|
|
rows: 1, |
|
|
|
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
|
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'value', |
|
|
|
|
|
label: $t('value'), |
|
|
|
|
|
type: 'code-mirror', |
|
|
|
|
|
lang: 'java', |
|
|
|
|
|
rows: 1, |
|
|
|
|
|
placeholder: true, |
|
|
|
|
|
autoCompletion: true, |
|
|
|
|
|
autoCompletionOptions: autoCompletionOptionsRef, |
|
|
|
|
|
extAutoCompletionOptions: GroovyFunctions, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
onBeforeEditorDataSubmit: (data, callback) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('conditionRange'); |
|
|
|
|
|
const form = grid.getEditorForm(); |
|
|
|
|
|
if ('add' == form.getStatus() || 'clone' == form.getStatus()) { |
|
|
|
|
|
data.uuid = Tools.uuid(); |
|
|
|
|
|
grid.addRow(data); |
|
|
|
|
|
callback(false); |
|
|
|
|
|
} else if ('edit' == form.getStatus()) { |
|
|
|
|
|
grid.replaceRow(data); |
|
|
|
|
|
callback(false); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'decisionTable2C', |
|
|
name: 'decisionTable2C', |
|
@ -450,7 +698,9 @@ |
|
|
name: 'pmml', |
|
|
name: 'pmml', |
|
|
label: $t('re.resources.designer.processor.grid.entity.pmml'), |
|
|
label: $t('re.resources.designer.processor.grid.entity.pmml'), |
|
|
type: 'code-mirror', |
|
|
type: 'code-mirror', |
|
|
rows: 1, |
|
|
rows: 10, |
|
|
|
|
|
lineNumber: true, |
|
|
|
|
|
lang: 'xml', |
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
|
return 'PMML' === arg.form.getFieldValue('type'); |
|
|
return 'PMML' === arg.form.getFieldValue('type'); |
|
|
}, |
|
|
}, |
|
@ -544,6 +794,39 @@ |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
}" |
|
|
}" |
|
|
|
|
|
@before-editor-data-submit=" |
|
|
|
|
|
(data, callback) => { |
|
|
|
|
|
const form = gridRef.getEditorForm(); |
|
|
|
|
|
if ('NUMBER_RANGE' === data.type) { |
|
|
|
|
|
const grid = form.getFieldComponent('numberRange'); |
|
|
|
|
|
const localData = grid.getLocalData(); |
|
|
|
|
|
const ranges = []; |
|
|
|
|
|
for (const item of localData) { |
|
|
|
|
|
ranges.push({ |
|
|
|
|
|
uuid: item.uuid, |
|
|
|
|
|
minIncluded: item.minIncluded, |
|
|
|
|
|
min: item.min, |
|
|
|
|
|
max: item.max, |
|
|
|
|
|
maxIncluded: item.maxIncluded, |
|
|
|
|
|
value: item.value, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
data.numberRange = Tools.object2Json(ranges); |
|
|
|
|
|
} else if ('CONDITION_RANGE' === data.type) { |
|
|
|
|
|
const grid = form.getFieldComponent('conditionRange'); |
|
|
|
|
|
const localData = grid.getLocalData(); |
|
|
|
|
|
const ranges = []; |
|
|
|
|
|
for (const item of localData) { |
|
|
|
|
|
ranges.push({ |
|
|
|
|
|
uuid: item.uuid, |
|
|
|
|
|
condition: item.condition, |
|
|
|
|
|
value: item.value, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
data.conditionRange = Tools.object2Json(ranges); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
" |
|
|
@after-editor-open=" |
|
|
@after-editor-open=" |
|
|
(row) => { |
|
|
(row) => { |
|
|
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemterHintsByParameterId/' + parameter.id)).then((response) => { |
|
|
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemterHintsByParameterId/' + parameter.id)).then((response) => { |
|
@ -572,9 +855,13 @@ |
|
|
optionOptionsRef = parameters; |
|
|
optionOptionsRef = parameters; |
|
|
}); |
|
|
}); |
|
|
if ('NUMBER_RANGE' === row.type) { |
|
|
if ('NUMBER_RANGE' === row.type) { |
|
|
const fields = gridRef.getEditorForm().getFields(); |
|
|
const grid = gridRef.getEditorForm().getFieldComponent('numberRange'); |
|
|
console.log(fields); |
|
|
const rows = Tools.json2Object(row.numberRange); |
|
|
numberRangeGridRef.setLocalData(Tools.json2Object(row.numberRange)); |
|
|
grid.setLocalData(rows); |
|
|
|
|
|
} else if ('CONDITION_RANGE' === row.type) { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('conditionRange'); |
|
|
|
|
|
const rows = Tools.json2Object(row.conditionRange); |
|
|
|
|
|
grid.setLocalData(rows); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
" |
|
|
" |
|
@ -583,6 +870,7 @@ |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { ref, onMounted } from 'vue'; |
|
|
import { ref, onMounted } from 'vue'; |
|
|
import { axios, Environment, Formater, Tools, EnumTools, Options } from 'platform-core'; |
|
|
import { axios, Environment, Formater, Tools, EnumTools, Options } from 'platform-core'; |
|
|
|
|
|
import { PlaceHolder } from '@/utils/PlaceHolder'; |
|
|
import GroovyFunctions from './GroovyFunctions'; |
|
|
import GroovyFunctions from './GroovyFunctions'; |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
@ -599,7 +887,6 @@ const emit = defineEmits<{ |
|
|
const gridRef = ref(); |
|
|
const gridRef = ref(); |
|
|
const autoCompletionOptionsRef = ref([]); |
|
|
const autoCompletionOptionsRef = ref([]); |
|
|
const optionOptionsRef = ref([]); |
|
|
const optionOptionsRef = ref([]); |
|
|
const numberRangeGridRef = ref(); |
|
|
|
|
|
|
|
|
|
|
|
const refresh = () => { |
|
|
const refresh = () => { |
|
|
gridRef.value.refresh(); |
|
|
gridRef.value.refresh(); |
|
|