|
@ -402,6 +402,44 @@ |
|
|
return str; |
|
|
return str; |
|
|
} |
|
|
} |
|
|
return ''; |
|
|
return ''; |
|
|
|
|
|
} else if ('DECISION_TABLE_2C' === type) { |
|
|
|
|
|
const objs = Tools.json2Object(row.decisionTable2C); |
|
|
|
|
|
if (objs) { |
|
|
|
|
|
let str = `<div class='border border-b-0 overflow-auto' style='max-height:100px'>`; |
|
|
|
|
|
str += `<table width='100%' height='100%'>`; |
|
|
|
|
|
objs.forEach((obj) => { |
|
|
|
|
|
str += '<tr>'; |
|
|
|
|
|
Object.keys(obj).forEach((key) => { |
|
|
|
|
|
if (key !== 'uuid' && typeof obj[key] === 'string') { |
|
|
|
|
|
str += ' <td>' + PlaceHolder.replace(obj[key]) + '</td>'; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
str += '</tr>'; |
|
|
|
|
|
}); |
|
|
|
|
|
str += '</table>'; |
|
|
|
|
|
str += `</div>`; |
|
|
|
|
|
return str; |
|
|
|
|
|
} |
|
|
|
|
|
return ''; |
|
|
|
|
|
} else if ('DECISION_TABLE' === type) { |
|
|
|
|
|
const objs = Tools.json2Object(row.decisionTable); |
|
|
|
|
|
if (objs) { |
|
|
|
|
|
let str = `<div class='border border-b-0 overflow-auto' style='max-height:100px'>`; |
|
|
|
|
|
str += `<table width='100%' height='100%'>`; |
|
|
|
|
|
objs.forEach((obj) => { |
|
|
|
|
|
str += '<tr>'; |
|
|
|
|
|
Object.keys(obj).forEach((key) => { |
|
|
|
|
|
if (key !== 'uuid' && typeof obj[key] === 'string') { |
|
|
|
|
|
str += ' <td>' + PlaceHolder.replace(obj[key]) + '</td>'; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
str += '</tr>'; |
|
|
|
|
|
}); |
|
|
|
|
|
str += '</table>'; |
|
|
|
|
|
str += `</div>`; |
|
|
|
|
|
return str; |
|
|
|
|
|
} |
|
|
|
|
|
return ''; |
|
|
} else if ('PMML' === type) { |
|
|
} else if ('PMML' === type) { |
|
|
return transfromContent(row.pmml); |
|
|
return transfromContent(row.pmml); |
|
|
} else if ('GROOVY_SCRIPT' === type) { |
|
|
} else if ('GROOVY_SCRIPT' === type) { |
|
@ -523,7 +561,7 @@ |
|
|
], |
|
|
], |
|
|
primaryKey: 'code', |
|
|
primaryKey: 'code', |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ name: 'code', label: 'code', showIf: false }, |
|
|
{ name: 'code', label: 'code', hidden: true }, |
|
|
{ |
|
|
{ |
|
|
width: 300, |
|
|
width: 300, |
|
|
name: 'name', |
|
|
name: 'name', |
|
@ -771,7 +809,7 @@ |
|
|
], |
|
|
], |
|
|
primaryKey: 'uuid', |
|
|
primaryKey: 'uuid', |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ width: 200, name: 'uuid', label: 'uuid', showIf: false }, |
|
|
{ width: 200, name: 'uuid', label: 'uuid', hidden: true }, |
|
|
{ |
|
|
{ |
|
|
width: 60, |
|
|
width: 60, |
|
|
name: 'minIncluded', |
|
|
name: 'minIncluded', |
|
@ -880,7 +918,7 @@ |
|
|
], |
|
|
], |
|
|
primaryKey: 'uuid', |
|
|
primaryKey: 'uuid', |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
{ |
|
|
{ |
|
|
name: 'condition', |
|
|
name: 'condition', |
|
|
label: $t('condition'), |
|
|
label: $t('condition'), |
|
@ -951,21 +989,231 @@ |
|
|
colSpan: 5, |
|
|
colSpan: 5, |
|
|
name: 'decisionTable2C', |
|
|
name: 'decisionTable2C', |
|
|
label: $t('re.resources.designer.processor.grid.entity.decisionTable2C'), |
|
|
label: $t('re.resources.designer.processor.grid.entity.decisionTable2C'), |
|
|
type: 'w-code-mirror', |
|
|
|
|
|
rows: 1, |
|
|
|
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
|
return 'DECISION_TABLE_2C' === arg.form.getFieldValue('type'); |
|
|
return 'DECISION_TABLE_2C' === arg.form.getFieldValue('type'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
type: 'w-grid', |
|
|
|
|
|
height: 300, |
|
|
|
|
|
dbClickOperation: 'edit', |
|
|
|
|
|
autoFetchData: false, |
|
|
|
|
|
denseBody: true, |
|
|
|
|
|
draggable: true, |
|
|
|
|
|
pageable: false, |
|
|
|
|
|
configButton: false, |
|
|
|
|
|
toolbarConfigure: { noIcon: false }, |
|
|
|
|
|
toolbarActions: [ |
|
|
|
|
|
[ |
|
|
|
|
|
{ |
|
|
|
|
|
extend: 'add', |
|
|
|
|
|
click: undefined, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'addCol2Left', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.addCol2Left'), |
|
|
|
|
|
enableIf: (args) => { |
|
|
|
|
|
return true; |
|
|
|
|
|
}, |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'addCol2Right', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.addCol2Right'), |
|
|
|
|
|
enableIf: (args) => { |
|
|
|
|
|
return true; |
|
|
|
|
|
}, |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
'separator', |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'addRow', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.addRow'), |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
{ |
|
|
|
|
|
extend: 'remove', |
|
|
|
|
|
click: undefined, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'removeCol', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.removeCol'), |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'removeRow', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.removeRow'), |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
'separator', |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'example', |
|
|
|
|
|
label: $t('example'), |
|
|
|
|
|
icon: 'bi-balloon', |
|
|
|
|
|
click: (arg) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('decisionTable2C'); |
|
|
|
|
|
const sampleData = [ |
|
|
|
|
|
{ uuid: Tools.uuid(), C0: '', C1: '${客户类型}==\'普通客户\'', C2: '${客户类型}==\'VIP客户\'', C3: '${客户类型}==\'临时客户\'' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), C0: '${评分结果}<60', C1: '1', C2: '3', C3: '5' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), C0: '${评分结果}>=60', C1: '2', C2: '4', C3: '6' }, |
|
|
|
|
|
]; |
|
|
|
|
|
grid.setLocalData(sampleData); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
primaryKey: 'uuid', |
|
|
|
|
|
columns: [ |
|
|
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C0', |
|
|
|
|
|
label: $t('C0'), |
|
|
|
|
|
align: 'left', |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C1', |
|
|
|
|
|
label: $t('C1'), |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C2', |
|
|
|
|
|
label: $t('C2'), |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C3', |
|
|
|
|
|
label: $t('C3'), |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
colSpan: 5, |
|
|
colSpan: 5, |
|
|
name: 'decisionTable', |
|
|
name: 'decisionTable', |
|
|
label: $t('re.resources.designer.processor.grid.entity.decisionTable'), |
|
|
label: $t('re.resources.designer.processor.grid.entity.decisionTable'), |
|
|
type: 'w-code-mirror', |
|
|
|
|
|
rows: 1, |
|
|
|
|
|
showIf: (arg) => { |
|
|
showIf: (arg) => { |
|
|
return 'DECISION_TABLE' === arg.form.getFieldValue('type'); |
|
|
return 'DECISION_TABLE' === arg.form.getFieldValue('type'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
type: 'w-grid', |
|
|
|
|
|
height: 300, |
|
|
|
|
|
dbClickOperation: 'edit', |
|
|
|
|
|
autoFetchData: false, |
|
|
|
|
|
denseBody: true, |
|
|
|
|
|
draggable: true, |
|
|
|
|
|
pageable: false, |
|
|
|
|
|
configButton: false, |
|
|
|
|
|
toolbarConfigure: { noIcon: false }, |
|
|
|
|
|
toolbarActions: [ |
|
|
|
|
|
[ |
|
|
|
|
|
{ |
|
|
|
|
|
extend: 'add', |
|
|
|
|
|
click: undefined, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'addCol2Left', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.addCol2Left'), |
|
|
|
|
|
enableIf: (args) => { |
|
|
|
|
|
return true; |
|
|
|
|
|
}, |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'addCol2Right', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.addCol2Right'), |
|
|
|
|
|
enableIf: (args) => { |
|
|
|
|
|
return true; |
|
|
|
|
|
}, |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
'separator', |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'addRow', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.addRow'), |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
{ |
|
|
|
|
|
extend: 'remove', |
|
|
|
|
|
click: undefined, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'removeCol', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.removeCol'), |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'removeRow', |
|
|
|
|
|
label: $t('re.resources.designer.processor.decisionTable.toolbar.removeRow'), |
|
|
|
|
|
click: () => {}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
'separator', |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'example', |
|
|
|
|
|
label: $t('example'), |
|
|
|
|
|
icon: 'bi-balloon', |
|
|
|
|
|
click: (arg) => { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('decisionTable2C'); |
|
|
|
|
|
const sampleData = [ |
|
|
|
|
|
{ uuid: Tools.uuid(), C0: '', C1: '${客户类型}==\'普通客户\'', C2: '${客户类型}==\'VIP客户\'', C3: '${客户类型}==\'临时客户\'' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), C0: '${评分结果}<60', C1: '1', C2: '3', C3: '5' }, |
|
|
|
|
|
{ uuid: Tools.uuid(), C0: '${评分结果}>=60', C1: '2', C2: '4', C3: '6' }, |
|
|
|
|
|
]; |
|
|
|
|
|
grid.setLocalData(sampleData); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
primaryKey: 'uuid', |
|
|
|
|
|
columns: [ |
|
|
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C0', |
|
|
|
|
|
label: $t('C0'), |
|
|
|
|
|
align: 'left', |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C1', |
|
|
|
|
|
label: $t('C1'), |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C2', |
|
|
|
|
|
label: $t('C2'), |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'C3', |
|
|
|
|
|
label: $t('C3'), |
|
|
|
|
|
sortable: false, |
|
|
|
|
|
format: (value) => { |
|
|
|
|
|
return PlaceHolder.replace(value); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
colSpan: 5, |
|
|
colSpan: 5, |
|
@ -1105,7 +1353,7 @@ |
|
|
], |
|
|
], |
|
|
primaryKey: 'uuid', |
|
|
primaryKey: 'uuid', |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
{ |
|
|
{ |
|
|
width: '50%', |
|
|
width: '50%', |
|
|
name: 'name', |
|
|
name: 'name', |
|
@ -1251,7 +1499,7 @@ |
|
|
], |
|
|
], |
|
|
primaryKey: 'uuid', |
|
|
primaryKey: 'uuid', |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
{ |
|
|
{ |
|
|
width: '50%', |
|
|
width: '50%', |
|
|
name: 'field', |
|
|
name: 'field', |
|
@ -1389,6 +1637,30 @@ |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
data.conditionRange = Tools.object2Json(ranges); |
|
|
data.conditionRange = Tools.object2Json(ranges); |
|
|
|
|
|
} else if ('DECISION_TABLE_2C' === data.type) { |
|
|
|
|
|
const grid = form.getFieldComponent('decisionTable2C'); |
|
|
|
|
|
const localData = grid.getLocalData(); |
|
|
|
|
|
const ranges = []; |
|
|
|
|
|
localData.forEach((item) => { |
|
|
|
|
|
ranges.push({ |
|
|
|
|
|
uuid: item.uuid, |
|
|
|
|
|
condition: item.condition, |
|
|
|
|
|
value: item.value, |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
data.conditionRange = Tools.object2Json(ranges); |
|
|
|
|
|
} else if ('DECISION_TABLE' === data.type) { |
|
|
|
|
|
const grid = form.getFieldComponent('decisionTable'); |
|
|
|
|
|
const localData = grid.getLocalData(); |
|
|
|
|
|
const ranges = []; |
|
|
|
|
|
localData.forEach((item) => { |
|
|
|
|
|
ranges.push({ |
|
|
|
|
|
uuid: item.uuid, |
|
|
|
|
|
condition: item.condition, |
|
|
|
|
|
value: item.value, |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
data.conditionRange = Tools.object2Json(ranges); |
|
|
} else if ('SQL' === data.type) { |
|
|
} else if ('SQL' === data.type) { |
|
|
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues'); |
|
|
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues'); |
|
|
const sqlParameterValuesLocalData = sqlParameterValuesGrid.getLocalData(); |
|
|
const sqlParameterValuesLocalData = sqlParameterValuesGrid.getLocalData(); |
|
@ -1485,6 +1757,10 @@ |
|
|
const grid = gridRef.getEditorForm().getFieldComponent('decisionTable2C'); |
|
|
const grid = gridRef.getEditorForm().getFieldComponent('decisionTable2C'); |
|
|
const rows = Tools.json2Object(row.decisionTable2C); |
|
|
const rows = Tools.json2Object(row.decisionTable2C); |
|
|
grid.setLocalData(rows); |
|
|
grid.setLocalData(rows); |
|
|
|
|
|
} else if ('DECISION_TABLE' === type) { |
|
|
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('decisionTable'); |
|
|
|
|
|
const rows = Tools.json2Object(row.decisionTable); |
|
|
|
|
|
grid.setLocalData(rows); |
|
|
} else if ('SQL' === type) { |
|
|
} else if ('SQL' === type) { |
|
|
const sqlParameterValuesGrid = gridRef.getEditorForm().getFieldComponent('sqlParameterValues'); |
|
|
const sqlParameterValuesGrid = gridRef.getEditorForm().getFieldComponent('sqlParameterValues'); |
|
|
const sqlParameterValuesRows = Tools.json2Object(row.sqlParameterValues); |
|
|
const sqlParameterValuesRows = Tools.json2Object(row.sqlParameterValues); |
|
|