|
|
@ -319,13 +319,12 @@ |
|
|
|
if (objs) { |
|
|
|
str += `<div class='border border-b-0 overflow-auto' style='max-height:100px'>`; |
|
|
|
str += `<table width='100%' height='100%'>`; |
|
|
|
for (let i = 0; i < objs.length; i++) { |
|
|
|
const obj = objs[i]; |
|
|
|
objs.forEach((obj) => { |
|
|
|
str += '<tr>'; |
|
|
|
str += ` <td width='30%'>` + obj.name + `</td>`; |
|
|
|
str += ` <td width='70%'><span>` + ('' + PlaceHolder.replace(obj.expression)) + '</span></td>'; |
|
|
|
str += '</tr>'; |
|
|
|
} |
|
|
|
}); |
|
|
|
str += '</table>'; |
|
|
|
str += `</div>`; |
|
|
|
} |
|
|
@ -372,16 +371,15 @@ |
|
|
|
if (objs) { |
|
|
|
let str = `<div class='border border-b-0 overflow-auto' style='max-height:100px'>`; |
|
|
|
str += `<table width='100%' height='100%'>`; |
|
|
|
for (let i = 0; i < objs.length; i++) { |
|
|
|
const obj = objs[i]; |
|
|
|
objs.forEach((obj, index) => { |
|
|
|
str += '<tr>'; |
|
|
|
if (i == 0) { |
|
|
|
if (index == 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>' + ('' + PlaceHolder.replace('' + obj.value)) + '</td>'; |
|
|
|
str += '</tr>'; |
|
|
|
} |
|
|
|
}); |
|
|
|
str += '</table>'; |
|
|
|
str += '</div>'; |
|
|
|
return str; |
|
|
@ -392,13 +390,12 @@ |
|
|
|
if (objs) { |
|
|
|
let str = `<div class='border border-b-0 overflow-auto' style='max-height:100px'>`; |
|
|
|
str += `<table width='100%' height='100%'>`; |
|
|
|
for (let i = 0; i < objs.length; i++) { |
|
|
|
const obj = objs[i]; |
|
|
|
objs.forEach((obj) => { |
|
|
|
str += '<tr>'; |
|
|
|
str += ' <td>' + PlaceHolder.replace(obj.condition) + '</td>'; |
|
|
|
str += ' <td><span>' + ('' + PlaceHolder.replace(obj.value)) + '</span></td>'; |
|
|
|
str += '</tr>'; |
|
|
|
} |
|
|
|
}); |
|
|
|
str += '</table>'; |
|
|
|
str += `</div>`; |
|
|
|
return str; |
|
|
@ -434,12 +431,12 @@ |
|
|
|
form: { |
|
|
|
colsNum: 5, |
|
|
|
fields: [ |
|
|
|
{ colSpan: 5, name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.id, hidden: true }, |
|
|
|
{ colSpan: 5, name: 'id', label: $t('id'), type: 'w-text', hidden: true }, |
|
|
|
{ colSpan: 5, name: 'order', label: $t('order'), type: 'w-number', hidden: true }, |
|
|
|
{ colSpan: 5, name: 'type', label: $t('type'), type: 'w-text', hidden: true }, |
|
|
|
{ colSpan: 5, name: 'description', label: $t('description'), type: 'w-text', hidden: true }, |
|
|
|
{ colSpan: 5, name: 'enable', label: $t('enable'), type: 'w-checkbox', defaultValue: true, hidden: true }, |
|
|
|
{ colSpan: 5, name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.id, showIf: false }, |
|
|
|
{ colSpan: 5, name: 'id', label: $t('id'), type: 'w-text', showIf: false }, |
|
|
|
{ colSpan: 5, name: 'order', label: $t('order'), type: 'w-number', showIf: false }, |
|
|
|
{ colSpan: 5, name: 'type', label: $t('type'), type: 'w-text', showIf: false }, |
|
|
|
{ colSpan: 5, name: 'description', label: $t('description'), type: 'w-text', showIf: false }, |
|
|
|
{ colSpan: 5, name: 'enable', label: $t('enable'), type: 'w-checkbox', defaultValue: true, showIf: false }, |
|
|
|
{ |
|
|
|
colSpan: 5, |
|
|
|
name: 'objectCondition', |
|
|
@ -482,13 +479,13 @@ |
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('objectProperties'); |
|
|
|
const localData = grid.getLocalData(); |
|
|
|
const objectProperties = []; |
|
|
|
for (const item of localData) { |
|
|
|
localData.forEach((item) => { |
|
|
|
objectProperties.push({ |
|
|
|
code: item.code, |
|
|
|
name: item.name, |
|
|
|
expression: item.expression, |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
objectPropertiesMatcherDialogRef.open(objectProperties); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -498,10 +495,10 @@ |
|
|
|
click: (arg) => { |
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('objectProperties'); |
|
|
|
const selecteds = arg.selecteds; |
|
|
|
for (const selected of selecteds) { |
|
|
|
selecteds.forEach((selected) => { |
|
|
|
selected.expression = ''; |
|
|
|
grid.replaceRow(selected); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
'separator', |
|
|
@ -516,16 +513,16 @@ |
|
|
|
click: (arg) => { |
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('objectProperties'); |
|
|
|
const rows = grid.getLocalData(); |
|
|
|
for (const row of rows) { |
|
|
|
rows.forEach((row) => { |
|
|
|
row.expression = ''; |
|
|
|
} |
|
|
|
}); |
|
|
|
grid.setLocalData(rows); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
primaryKey: 'code', |
|
|
|
columns: [ |
|
|
|
{ name: 'code', label: 'code', hidden: true }, |
|
|
|
{ name: 'code', label: 'code', showIf: false }, |
|
|
|
{ |
|
|
|
width: 300, |
|
|
|
name: 'name', |
|
|
@ -559,7 +556,7 @@ |
|
|
|
form: { |
|
|
|
colsNum: 1, |
|
|
|
fields: [ |
|
|
|
{ name: 'code', label: 'code', hidden: true }, |
|
|
|
{ name: 'code', label: 'code', showIf: false }, |
|
|
|
{ |
|
|
|
name: 'expression', |
|
|
|
label: $t('expression'), |
|
|
@ -773,7 +770,7 @@ |
|
|
|
], |
|
|
|
primaryKey: 'uuid', |
|
|
|
columns: [ |
|
|
|
{ width: 200, name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
{ width: 200, name: 'uuid', label: 'uuid', showIf: false }, |
|
|
|
{ |
|
|
|
width: 60, |
|
|
|
name: 'minIncluded', |
|
|
@ -813,7 +810,7 @@ |
|
|
|
form: { |
|
|
|
colsNum: 4, |
|
|
|
fields: [ |
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true, colSpan: 4 }, |
|
|
|
{ name: 'uuid', label: 'uuid', showIf: false, colSpan: 4 }, |
|
|
|
{ name: 'min', label: $t('minValue'), type: 'w-text', colSpan: 3 }, |
|
|
|
{ name: 'minIncluded', label: $t('include'), type: 'w-checkbox' }, |
|
|
|
{ name: 'max', label: $t('maxValue'), type: 'w-text', colSpan: 3 }, |
|
|
@ -882,7 +879,7 @@ |
|
|
|
], |
|
|
|
primaryKey: 'uuid', |
|
|
|
columns: [ |
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
|
{ |
|
|
|
name: 'condition', |
|
|
|
label: $t('condition'), |
|
|
@ -908,7 +905,7 @@ |
|
|
|
form: { |
|
|
|
colsNum: 1, |
|
|
|
fields: [ |
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
|
{ |
|
|
|
name: 'condition', |
|
|
|
label: $t('condition'), |
|
|
@ -1076,9 +1073,9 @@ |
|
|
|
const regex = /\$\{[\u0000-\uFFFF]+?\}/g; |
|
|
|
const array = sql.match(regex); |
|
|
|
const rows = []; |
|
|
|
for (const item of array) { |
|
|
|
array.forEach((item) => { |
|
|
|
rows.push({ uuid: Tools.uuid(), name: item, value: '' }); |
|
|
|
} |
|
|
|
}); |
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('sqlParameterValues'); |
|
|
|
grid.setLocalData(rows); |
|
|
|
}, |
|
|
@ -1107,7 +1104,7 @@ |
|
|
|
], |
|
|
|
primaryKey: 'uuid', |
|
|
|
columns: [ |
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
|
{ |
|
|
|
width: '50%', |
|
|
|
name: 'name', |
|
|
@ -1132,7 +1129,7 @@ |
|
|
|
form: { |
|
|
|
colsNum: 1, |
|
|
|
fields: [ |
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
|
{ |
|
|
|
name: 'name', |
|
|
|
label: $t('name'), |
|
|
@ -1196,9 +1193,9 @@ |
|
|
|
}) |
|
|
|
.then((response) => { |
|
|
|
const fieldMetaDatas = response.data.fieldMetaDatas; |
|
|
|
for (const field of fieldMetaDatas) { |
|
|
|
fieldMetaDatas.forEach((field) => { |
|
|
|
field.value = field.name; |
|
|
|
} |
|
|
|
}); |
|
|
|
const data = response.data.data; |
|
|
|
const grid = gridRef.getEditorForm().getFieldComponent('sqlQueryResult'); |
|
|
|
sqlQueryResultFieldsRef = fieldMetaDatas; |
|
|
@ -1253,7 +1250,7 @@ |
|
|
|
], |
|
|
|
primaryKey: 'uuid', |
|
|
|
columns: [ |
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
|
{ |
|
|
|
width: '50%', |
|
|
|
name: 'field', |
|
|
@ -1278,7 +1275,7 @@ |
|
|
|
form: { |
|
|
|
colsNum: 1, |
|
|
|
fields: [ |
|
|
|
{ name: 'uuid', label: 'uuid', hidden: true }, |
|
|
|
{ name: 'uuid', label: 'uuid', showIf: false }, |
|
|
|
{ |
|
|
|
name: 'field', |
|
|
|
label: $t('fieldName'), |
|
|
@ -1356,19 +1353,19 @@ |
|
|
|
const grid = form.getFieldComponent('objectProperties'); |
|
|
|
const localData = grid.getLocalData(); |
|
|
|
const objectProperties = []; |
|
|
|
for (const item of localData) { |
|
|
|
localData.forEach((item) => { |
|
|
|
objectProperties.push({ |
|
|
|
code: item.code, |
|
|
|
name: item.name, |
|
|
|
expression: item.expression, |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
data.objectProperties = Tools.object2Json(objectProperties); |
|
|
|
} else if ('NUMBER_RANGE' === data.type) { |
|
|
|
const grid = form.getFieldComponent('numberRange'); |
|
|
|
const localData = grid.getLocalData(); |
|
|
|
const ranges = []; |
|
|
|
for (const item of localData) { |
|
|
|
localData.forEach((item) => { |
|
|
|
ranges.push({ |
|
|
|
uuid: item.uuid, |
|
|
|
minIncluded: item.minIncluded, |
|
|
@ -1377,43 +1374,43 @@ |
|
|
|
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) { |
|
|
|
localData.forEach((item) => { |
|
|
|
ranges.push({ |
|
|
|
uuid: item.uuid, |
|
|
|
condition: item.condition, |
|
|
|
value: item.value, |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
data.conditionRange = Tools.object2Json(ranges); |
|
|
|
} else if ('SQL' === data.type) { |
|
|
|
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues'); |
|
|
|
const sqlParameterValuesLocalData = sqlParameterValuesGrid.getLocalData(); |
|
|
|
const sqlParameterValues = []; |
|
|
|
for (const item of sqlParameterValuesLocalData) { |
|
|
|
sqlParameterValuesLocalData.forEach((item) => { |
|
|
|
sqlParameterValues.push({ |
|
|
|
uuid: item.uuid, |
|
|
|
name: item.name, |
|
|
|
value: item.value, |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
data.sqlParameterValues = Tools.object2Json(sqlParameterValues); |
|
|
|
|
|
|
|
const sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping'); |
|
|
|
const sqlFieldMappingLocalData = sqlFieldMappingGrid.getLocalData(); |
|
|
|
const sqlFieldMapping = []; |
|
|
|
for (const item of sqlFieldMappingLocalData) { |
|
|
|
sqlFieldMappingLocalData.forEach((item) => { |
|
|
|
sqlFieldMapping.push({ |
|
|
|
uuid: item.uuid, |
|
|
|
field: item.field, |
|
|
|
parameter: item.parameter, |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
data.sqlFieldMapping = Tools.object2Json(sqlFieldMapping); |
|
|
|
} |
|
|
|
} |
|
|
@ -1431,11 +1428,11 @@ |
|
|
|
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + parameter.id)).then((response) => { |
|
|
|
const parameters = response.data; |
|
|
|
const options = []; |
|
|
|
for (const item of parameters) { |
|
|
|
parameters.forEach((item) => { |
|
|
|
if (item.type === 'IN_OPTION') { |
|
|
|
options.push({ label: item.name, value: item.code }); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
optionOptionsRef = options; |
|
|
|
}); |
|
|
|
|
|
|
@ -1458,9 +1455,9 @@ |
|
|
|
//获取所有参数列表 |
|
|
|
axios.get(Environment.apiContextPath('api/re/model/parameter/findParametersByParameterId?parameterId=' + parameter.id)).then((response) => { |
|
|
|
const options = []; |
|
|
|
for (const indicator of response.data) { |
|
|
|
response.data.forEach((indicator) => { |
|
|
|
options.push({ label: indicator.name, value: '${' + indicator.name + '}' }); |
|
|
|
} |
|
|
|
}); |
|
|
|
parameterOptionsRef = options; |
|
|
|
}); |
|
|
|
|
|
|
@ -1582,9 +1579,9 @@ axios.get(Environment.apiContextPath('/api/system/datasource')).then((response) |
|
|
|
const items = response.data?.content; |
|
|
|
if (items) { |
|
|
|
const options = []; |
|
|
|
for (const item of items) { |
|
|
|
items.forEach((item) => { |
|
|
|
options.push({ label: item.name, value: item.name }); |
|
|
|
} |
|
|
|
}); |
|
|
|
dsOptionsRef.value = options; |
|
|
|
} |
|
|
|
}); |
|
|
@ -1593,11 +1590,11 @@ axios.get(Environment.apiContextPath('/api/re/function?pageable=false')).then((r |
|
|
|
const options = []; |
|
|
|
const items = response.data?.content; |
|
|
|
if (items && items.length > 0) { |
|
|
|
for (const item of items) { |
|
|
|
items.forEach((item) => { |
|
|
|
if (item.enable) { |
|
|
|
options.push(item); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
userDefinedFunctionsRef.value = options; |
|
|
|
}); |
|
|
|