|
@ -2,15 +2,20 @@ |
|
|
<w-graph v-model="modelValueRef" :vertex-defines="vertexDefines" :edge-defines="edgeDefines" @save="save"></w-graph> |
|
|
<w-graph v-model="modelValueRef" :vertex-defines="vertexDefines" :edge-defines="edgeDefines" @save="save"></w-graph> |
|
|
</template> |
|
|
</template> |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { ref, nextTick } from 'vue'; |
|
|
import { ref } from 'vue'; |
|
|
import { axios, Environment, NotifyManager, Formater, EnumTools, $t } from '@/platform'; |
|
|
import { axios, Environment, NotifyManager, Formater, EnumTools, $t } from '@/platform'; |
|
|
|
|
|
|
|
|
const dialogRef = ref(); |
|
|
const dialogRef = ref(); |
|
|
const processorIdRef = ref(); |
|
|
const processorIdRef = ref(); |
|
|
const modelValueRef = ref(); |
|
|
const modelValueRef = ref(''); |
|
|
|
|
|
|
|
|
const userDefinedFunctionsRef = ref(); |
|
|
const userDefinedFunctionsRef = ref(); |
|
|
const resourceAbstractsRef = ref(); |
|
|
const resourceAbstractsRef = ref(); |
|
|
|
|
|
const modeAbstractsRef = ref(); |
|
|
|
|
|
|
|
|
|
|
|
const autoCompletion = (context) => { |
|
|
|
|
|
return []; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
const edgeDefines = [ |
|
|
const edgeDefines = [ |
|
|
{ |
|
|
{ |
|
@ -18,10 +23,7 @@ const edgeDefines = [ |
|
|
fromVertexType: 'Condition', |
|
|
fromVertexType: 'Condition', |
|
|
toVertexType: null, |
|
|
toVertexType: null, |
|
|
getLabel: (value) => { |
|
|
getLabel: (value) => { |
|
|
if (value && value.value) { |
|
|
return value.value || ''; |
|
|
return value.value; |
|
|
|
|
|
} |
|
|
|
|
|
return ''; |
|
|
|
|
|
}, |
|
|
}, |
|
|
getValue: (dom) => { |
|
|
getValue: (dom) => { |
|
|
if (dom) { |
|
|
if (dom) { |
|
@ -42,7 +44,7 @@ const edgeDefines = [ |
|
|
return [ |
|
|
return [ |
|
|
{ |
|
|
{ |
|
|
name: 'valueType', |
|
|
name: 'valueType', |
|
|
label: 'valueType', |
|
|
label: $t('re.graph.edge.conditionBranch.entity.valueType'), |
|
|
type: 'w-select', |
|
|
type: 'w-select', |
|
|
options: [ |
|
|
options: [ |
|
|
{ label: $t('java.lang.String'), value: 'java.lang.String' }, |
|
|
{ label: $t('java.lang.String'), value: 'java.lang.String' }, |
|
@ -52,18 +54,20 @@ const edgeDefines = [ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'value', |
|
|
name: 'value', |
|
|
label: 'value', |
|
|
label: $t('re.graph.edge.conditionBranch.entity.value'), |
|
|
type: 'w-text', |
|
|
type: 'w-text', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'commands', |
|
|
name: 'commands', |
|
|
label: 'commands', |
|
|
label: $t('re.graph.edge.conditionBranch.entity.commands'), |
|
|
type: 'w-code-mirror', |
|
|
type: 'w-code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 10, |
|
|
rows: 10, |
|
|
placeholder: true, |
|
|
placeholder: true, |
|
|
lineWrap: true, |
|
|
lineWrap: true, |
|
|
lineBreak: true, |
|
|
lineBreak: true, |
|
|
|
|
|
autoCompletion: autoCompletion, |
|
|
|
|
|
userDefinedFunctions: userDefinedFunctionsRef, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
}, |
|
|
}, |
|
@ -73,7 +77,15 @@ const edgeDefines = [ |
|
|
const vertexDefines = [ |
|
|
const vertexDefines = [ |
|
|
{ |
|
|
{ |
|
|
type: 'Start', |
|
|
type: 'Start', |
|
|
thumbnail: { shape: 'ellipse', label: $t('start'), title: $t('success'), rx: 8, ry: 8, strokeColor: 'black', strokeWidth: 1 }, |
|
|
thumbnail: { |
|
|
|
|
|
shape: 'ellipse', |
|
|
|
|
|
label: $t('re.graph.vertex.start.label'), |
|
|
|
|
|
title: $t('re.graph.vertex.start.title'), |
|
|
|
|
|
rx: 8, |
|
|
|
|
|
ry: 8, |
|
|
|
|
|
strokeColor: 'black', |
|
|
|
|
|
strokeWidth: 1, |
|
|
|
|
|
}, |
|
|
cell: { |
|
|
cell: { |
|
|
shape: 'ellipse', |
|
|
shape: 'ellipse', |
|
|
size: [50, 50], |
|
|
size: [50, 50], |
|
@ -84,17 +96,17 @@ const vertexDefines = [ |
|
|
getValue: (dom) => { |
|
|
getValue: (dom) => { |
|
|
if (dom) { |
|
|
if (dom) { |
|
|
return { |
|
|
return { |
|
|
label: dom.getAttribute('label'), |
|
|
label: dom.getAttribute('label') || '', |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
return { label: $t('start') }; |
|
|
return { label: $t('re.graph.vertex.start.label') }; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getFormFields: () => { |
|
|
getFormFields: () => { |
|
|
return [ |
|
|
return [ |
|
|
{ |
|
|
{ |
|
|
name: 'label', |
|
|
name: 'label', |
|
|
label: 'label', |
|
|
label: $t('description'), |
|
|
type: 'w-text', |
|
|
type: 'w-text', |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
@ -102,18 +114,24 @@ const vertexDefines = [ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
type: 'Condition', |
|
|
type: 'Condition', |
|
|
thumbnail: { shape: 'rhombus', label: $t('condition'), strokeColor: 'black', strokeWidth: 1 }, |
|
|
thumbnail: { |
|
|
|
|
|
shape: 'rhombus', |
|
|
|
|
|
label: $t('re.graph.vertex.condition.label'), |
|
|
|
|
|
title: $t('re.graph.vertex.condition.title'), |
|
|
|
|
|
strokeColor: 'black', |
|
|
|
|
|
strokeWidth: 1, |
|
|
|
|
|
}, |
|
|
cell: { |
|
|
cell: { |
|
|
shape: 'rhombus', |
|
|
shape: 'rhombus', |
|
|
size: [120, 60], |
|
|
size: [120, 60], |
|
|
}, |
|
|
}, |
|
|
getLabel: (value) => { |
|
|
getLabel: (value) => { |
|
|
return value.condition ? value.condition : $t('condition'); |
|
|
return value.condition ? value.condition : ''; |
|
|
}, |
|
|
}, |
|
|
getValue: (dom) => { |
|
|
getValue: (dom) => { |
|
|
if (dom) { |
|
|
if (dom) { |
|
|
return { |
|
|
return { |
|
|
condition: dom.getAttribute('condition'), |
|
|
condition: dom.getAttribute('condition') || '', |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
return { |
|
|
return { |
|
@ -125,56 +143,61 @@ const vertexDefines = [ |
|
|
return [ |
|
|
return [ |
|
|
{ |
|
|
{ |
|
|
name: 'condition', |
|
|
name: 'condition', |
|
|
label: 'condition', |
|
|
label: $t('re.graph.vertex.condition.entity.condition'), |
|
|
type: 'w-code-mirror', |
|
|
type: 'w-code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 10, |
|
|
rows: 10, |
|
|
placeholder: true, |
|
|
placeholder: true, |
|
|
lineWrap: true, |
|
|
lineWrap: true, |
|
|
lineBreak: false, |
|
|
lineBreak: false, |
|
|
|
|
|
autoCompletion: autoCompletion, |
|
|
|
|
|
userDefinedFunctions: userDefinedFunctionsRef, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
type: 'Expression', |
|
|
type: 'CommandSet', |
|
|
thumbnail: { shape: 'rectangle', label: $t('expression'), strokeColor: 'black', strokeWidth: 1 }, |
|
|
thumbnail: { |
|
|
|
|
|
shape: 'rectangle', |
|
|
|
|
|
label: $t('re.graph.vertex.commandSet.label'), |
|
|
|
|
|
title: $t('re.graph.vertex.commandSet.title'), |
|
|
|
|
|
strokeColor: 'black', |
|
|
|
|
|
strokeWidth: 1, |
|
|
|
|
|
}, |
|
|
cell: { |
|
|
cell: { |
|
|
shape: 'rectangle', |
|
|
shape: 'rectangle', |
|
|
size: [120, 60], |
|
|
size: [120, 60], |
|
|
}, |
|
|
}, |
|
|
getLabel: (value) => { |
|
|
getLabel: (value) => { |
|
|
let html = ''; |
|
|
let html = ''; |
|
|
html += '<div style="text-align:center;">' + value.expression + '</div>'; |
|
|
|
|
|
html += '<hr size="0.5"/>'; |
|
|
|
|
|
html += '<div style="text-align:left;">' + value.commands + '</div>'; |
|
|
html += '<div style="text-align:left;">' + value.commands + '</div>'; |
|
|
return html; |
|
|
return html; |
|
|
}, |
|
|
}, |
|
|
getValue: (dom) => { |
|
|
getValue: (dom) => { |
|
|
if (dom) { |
|
|
if (dom) { |
|
|
return { |
|
|
return { |
|
|
expression: dom.getAttribute('expression'), |
|
|
commands: dom.getAttribute('commands') || '', |
|
|
commands: dom.getAttribute('commands'), |
|
|
|
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
return { |
|
|
return { |
|
|
expression: 'xxx', |
|
|
commands: '', |
|
|
commands: 'kjsdfi=klsjdf="xxx";\na=b;', |
|
|
|
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getFormFields: () => { |
|
|
getFormFields: () => { |
|
|
return [ |
|
|
return [ |
|
|
{ name: 'expression', label: 'expression', type: 'w-text' }, |
|
|
|
|
|
{ |
|
|
{ |
|
|
name: 'commands', |
|
|
name: 'commands', |
|
|
label: 'commands', |
|
|
label: $t('re.graph.vertex.commandSet.entity.commands'), |
|
|
type: 'w-code-mirror', |
|
|
type: 'w-code-mirror', |
|
|
lang: 'java', |
|
|
lang: 'java', |
|
|
rows: 10, |
|
|
rows: 10, |
|
|
placeholder: true, |
|
|
placeholder: true, |
|
|
lineWrap: true, |
|
|
lineWrap: true, |
|
|
lineBreak: true, |
|
|
lineBreak: true, |
|
|
|
|
|
autoCompletion: autoCompletion, |
|
|
|
|
|
userDefinedFunctions: userDefinedFunctionsRef, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
}, |
|
|
}, |
|
@ -182,16 +205,16 @@ const vertexDefines = [ |
|
|
{ |
|
|
{ |
|
|
type: 'ResourceAbstract', |
|
|
type: 'ResourceAbstract', |
|
|
thumbnail: { |
|
|
thumbnail: { |
|
|
//shape: 'ellipse', |
|
|
shape: 'ellipse', |
|
|
paths: ['<path fill="white" stroke-width="1" stroke="black" d="M 1 8 L 8 4 L 16 4 L 23 8 L 23 16 L 16 20 L 8 20 L 1 16 L 1 8"></path>'], |
|
|
label: $t('re.graph.vertex.resourceAbstract.label'), |
|
|
label: '资源摘要', |
|
|
title: $t('re.graph.vertex.resourceAbstract.title'), |
|
|
rx: 11, |
|
|
rx: 11, |
|
|
ry: 6, |
|
|
ry: 6, |
|
|
strokeColor: 'black', |
|
|
strokeColor: 'black', |
|
|
strokeWidth: 1, |
|
|
strokeWidth: 1, |
|
|
}, |
|
|
}, |
|
|
cell: { |
|
|
cell: { |
|
|
shape: 'hexagon', |
|
|
shape: 'ellipse', |
|
|
size: [120, 60], |
|
|
size: [120, 60], |
|
|
}, |
|
|
}, |
|
|
getLabel: (value) => { |
|
|
getLabel: (value) => { |
|
@ -235,13 +258,13 @@ const vertexDefines = [ |
|
|
return [ |
|
|
return [ |
|
|
{ |
|
|
{ |
|
|
name: 'resourceAbstractId', |
|
|
name: 'resourceAbstractId', |
|
|
label: $t('re.resources.grid.title'), |
|
|
label: $t('re.graph.vertex.resourceAbstract.entity.resourceAbstractId'), |
|
|
type: 'w-grid-select', |
|
|
type: 'w-grid-select', |
|
|
displayValue: (args) => { |
|
|
displayValue: (args) => { |
|
|
return args.data.name + '(V' + args.data.version + ')'; |
|
|
return args.data.name + '(V' + args.data.version + ')'; |
|
|
}, |
|
|
}, |
|
|
grid: { |
|
|
grid: { |
|
|
title: $t('re.resources.grid.title'), |
|
|
title: $t('re.graph.vertex.resourceAbstract.entity.resourceAbstractId'), |
|
|
denseBody: true, |
|
|
denseBody: true, |
|
|
hideBottom: true, |
|
|
hideBottom: true, |
|
|
configButton: true, |
|
|
configButton: true, |
|
@ -288,6 +311,186 @@ const vertexDefines = [ |
|
|
]; |
|
|
]; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
type: 'ConfigurableResourceAbstract', |
|
|
|
|
|
thumbnail: { |
|
|
|
|
|
shape: 'doubleEllipse', |
|
|
|
|
|
paths: [ |
|
|
|
|
|
'<path fill="white" stroke-width="1" stroke="black" d="M1 12a11 8 0 1 0 22 0a11 8 0 1 0 -22 0"></path>', |
|
|
|
|
|
'<path fill="white" stroke-width="1" stroke="black" d="M3 12a9 6 0 1 0 18 0a9 6 0 1 0 -18 0"></path>', |
|
|
|
|
|
], |
|
|
|
|
|
label: $t('re.graph.vertex.configurableResourceAbstract.label'), |
|
|
|
|
|
title: $t('re.graph.vertex.configurableResourceAbstract.title'), |
|
|
|
|
|
strokeColor: 'black', |
|
|
|
|
|
strokeWidth: 1, |
|
|
|
|
|
}, |
|
|
|
|
|
cell: { |
|
|
|
|
|
shape: 'doubleEllipse', |
|
|
|
|
|
size: [120, 60], |
|
|
|
|
|
}, |
|
|
|
|
|
getLabel: (value) => { |
|
|
|
|
|
let html = '<div style="text-align:left;">' + (value?.inputCommands || '') + '</div>'; |
|
|
|
|
|
html += '<hr/>'; |
|
|
|
|
|
const resourceAbstract = findResourceAbstractById(value.resourceAbstractId); |
|
|
|
|
|
if (resourceAbstract) { |
|
|
|
|
|
html += resourceAbstract.name + '(V' + resourceAbstract.version + ')'; |
|
|
|
|
|
} |
|
|
|
|
|
html += '<hr/>'; |
|
|
|
|
|
html += '<div style="text-align:left;">' + (value?.outputCommands || '') + '</div>'; |
|
|
|
|
|
return html; |
|
|
|
|
|
}, |
|
|
|
|
|
getValue: (dom) => { |
|
|
|
|
|
let result = { resourceAbstractId: '', inputCommands: '', outputCommands: '' }; |
|
|
|
|
|
if (dom) { |
|
|
|
|
|
const code = dom.getAttribute('code'); |
|
|
|
|
|
const version = dom.getAttribute('version'); |
|
|
|
|
|
const resourceAbstract = findResourceAbstractByCodeAndVersion(code, version); |
|
|
|
|
|
if (resourceAbstract) { |
|
|
|
|
|
result.resourceAbstractId = resourceAbstract.id; |
|
|
|
|
|
} |
|
|
|
|
|
result.inputCommands = dom.getAttribute('inputCommands') || ''; |
|
|
|
|
|
result.outputCommands = dom.getAttribute('outputCommands') || ''; |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
}, |
|
|
|
|
|
setValue: (dom, value) => { |
|
|
|
|
|
const resourceAbstract = findResourceAbstractById(value.resourceAbstractId); |
|
|
|
|
|
if (resourceAbstract) { |
|
|
|
|
|
dom.setAttribute('code', resourceAbstract.code); |
|
|
|
|
|
dom.setAttribute('version', resourceAbstract.version); |
|
|
|
|
|
} else { |
|
|
|
|
|
dom.setAttribute('code', ''); |
|
|
|
|
|
dom.setAttribute('version', ''); |
|
|
|
|
|
} |
|
|
|
|
|
dom.setAttribute('inputCommands', value?.inputCommands || ''); |
|
|
|
|
|
dom.setAttribute('outputCommands', value?.outputCommands || ''); |
|
|
|
|
|
}, |
|
|
|
|
|
getFormFields: () => { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'resourceAbstractId', |
|
|
|
|
|
label: $t('re.graph.vertex.configurableResourceAbstract.entity.resourceAbstractId'), |
|
|
|
|
|
type: 'w-grid-select', |
|
|
|
|
|
displayValue: (args) => { |
|
|
|
|
|
return args.data.name + (args.data.version ? '(V' + args.data.version + ')' : ''); |
|
|
|
|
|
}, |
|
|
|
|
|
grid: { |
|
|
|
|
|
title: $t('re.graph.vertex.configurableResourceAbstract.entity.resourceAbstractId'), |
|
|
|
|
|
denseBody: true, |
|
|
|
|
|
hideBottom: true, |
|
|
|
|
|
configButton: true, |
|
|
|
|
|
checkboxSelection: false, |
|
|
|
|
|
tree: true, |
|
|
|
|
|
treeIcon: (row) => { |
|
|
|
|
|
if (row.type === 'FOLDER') { |
|
|
|
|
|
return { name: 'folder', color: 'amber' }; |
|
|
|
|
|
} else if (row.type === 'MODEL') { |
|
|
|
|
|
return { name: 'bi-boxes' }; |
|
|
|
|
|
} else if (row.type === 'SCORE_CARD') { |
|
|
|
|
|
return { name: 'bi-card-list' }; |
|
|
|
|
|
} else { |
|
|
|
|
|
return { name: row.icon }; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
dataUrl: Environment.apiContextPath('/api/re/resource'), |
|
|
|
|
|
pageable: false, |
|
|
|
|
|
sortBy: ['order', '-lastModifyDate'], |
|
|
|
|
|
toolbarConfigure: { noIcon: false }, |
|
|
|
|
|
toolbarActions: ['refresh', 'expand'], |
|
|
|
|
|
columns: [ |
|
|
|
|
|
{ width: '100%', name: 'name', label: $t('name') }, |
|
|
|
|
|
{ |
|
|
|
|
|
width: 80, |
|
|
|
|
|
name: 'type', |
|
|
|
|
|
label: $t('type'), |
|
|
|
|
|
format: (value, row) => { |
|
|
|
|
|
if (value !== 'FOLDER') { |
|
|
|
|
|
return Formater.enum(Enums.ResourceType)(value); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ width: 60, name: 'version', label: $t('version') }, |
|
|
|
|
|
{ |
|
|
|
|
|
width: 80, |
|
|
|
|
|
name: 'status', |
|
|
|
|
|
label: $t('status'), |
|
|
|
|
|
align: 'center', |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'inputCommands', |
|
|
|
|
|
label: $t('re.graph.vertex.configurableResourceAbstract.entity.inputCommands'), |
|
|
|
|
|
type: 'w-code-mirror', |
|
|
|
|
|
lang: 'java', |
|
|
|
|
|
rows: 9, |
|
|
|
|
|
placeholder: true, |
|
|
|
|
|
lineWrap: true, |
|
|
|
|
|
lineBreak: true, |
|
|
|
|
|
autoCompletion: autoCompletion, |
|
|
|
|
|
userDefinedFunctions: userDefinedFunctionsRef, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'outputCommands', |
|
|
|
|
|
label: $t('re.graph.vertex.configurableResourceAbstract.entity.outputCommands'), |
|
|
|
|
|
type: 'w-code-mirror', |
|
|
|
|
|
lang: 'java', |
|
|
|
|
|
rows: 10, |
|
|
|
|
|
placeholder: true, |
|
|
|
|
|
lineWrap: true, |
|
|
|
|
|
lineBreak: true, |
|
|
|
|
|
autoCompletion: autoCompletion, |
|
|
|
|
|
userDefinedFunctions: userDefinedFunctionsRef, |
|
|
|
|
|
}, |
|
|
|
|
|
]; |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
type: 'SubModelAbstract', |
|
|
|
|
|
thumbnail: { |
|
|
|
|
|
paths: ['<path fill="white" stroke-width="1" stroke="black" d="M 1 12 L 6 6 L 18 6 L 23 12 L 23 12 L 18 18 L 6 18 L 1 12 L 1 12"></path>'], |
|
|
|
|
|
label: $t('re.graph.vertex.subModelAbstract.label'), |
|
|
|
|
|
title: $t('re.graph.vertex.subModelAbstract.title'), |
|
|
|
|
|
rx: 11, |
|
|
|
|
|
ry: 6, |
|
|
|
|
|
strokeColor: 'black', |
|
|
|
|
|
strokeWidth: 1, |
|
|
|
|
|
}, |
|
|
|
|
|
cell: { |
|
|
|
|
|
shape: 'hexagon', |
|
|
|
|
|
size: [120, 60], |
|
|
|
|
|
}, |
|
|
|
|
|
getLabel: (value) => { |
|
|
|
|
|
for (const item of modeAbstractsRef.value) { |
|
|
|
|
|
if (item.value === value.code) { |
|
|
|
|
|
return item.label; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return ''; |
|
|
|
|
|
}, |
|
|
|
|
|
getValue: (dom) => { |
|
|
|
|
|
if (dom) { |
|
|
|
|
|
return { |
|
|
|
|
|
code: dom.getAttribute('code') || '', |
|
|
|
|
|
}; |
|
|
|
|
|
} else { |
|
|
|
|
|
return { |
|
|
|
|
|
code: '', |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
getFormFields: () => { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'code', |
|
|
|
|
|
label: $t('re.graph.vertex.subModelAbstract.entity.code'), |
|
|
|
|
|
type: 'w-select', |
|
|
|
|
|
options: modeAbstractsRef, |
|
|
|
|
|
}, |
|
|
|
|
|
]; |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
const findResourceAbstractById = (id) => { |
|
|
const findResourceAbstractById = (id) => { |
|
@ -308,12 +511,49 @@ const findResourceAbstractByCodeAndVersion = (code, version) => { |
|
|
return null; |
|
|
return null; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const open = async (parameterId, processorId) => { |
|
|
|
|
|
processorIdRef.value = processorId; |
|
|
|
|
|
// 获取资源摘要 |
|
|
|
|
|
const resourceAbstractResponse = await axios.get(Environment.apiContextPath('/api/re/resource/getAllReleasableResourceAbstract')); |
|
|
|
|
|
resourceAbstractsRef.value = resourceAbstractResponse?.data; |
|
|
|
|
|
|
|
|
|
|
|
// 获取子模型 |
|
|
|
|
|
const modelResponse = await axios.get(Environment.apiContextPath('/api/re/model/getModeAbstractByParameterProcessor/' + processorId)); |
|
|
|
|
|
const modelOptions = []; |
|
|
|
|
|
for (const item of modelResponse?.data || []) { |
|
|
|
|
|
modelOptions.push({ label: item.name, value: item.code }); |
|
|
|
|
|
} |
|
|
|
|
|
modeAbstractsRef.value = modelOptions; |
|
|
|
|
|
|
|
|
|
|
|
//获取自定义函数 |
|
|
|
|
|
const functionResponse = await axios.get(Environment.apiContextPath('/api/re/function?pageable=false')); |
|
|
|
|
|
const functionOptions = []; |
|
|
|
|
|
for (const item of functionResponse?.data?.content || []) { |
|
|
|
|
|
if (item.enable) { |
|
|
|
|
|
functionOptions.push(item); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
userDefinedFunctionsRef.value = functionOptions; |
|
|
|
|
|
|
|
|
|
|
|
// 获取代码提示列表 |
|
|
|
|
|
const tipResponse = await axios.get(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByParameterId/' + parameterId)); |
|
|
|
|
|
// autoCompletionManager.setParameters(tipResponse?.data?.parameters); |
|
|
|
|
|
// autoCompletionManager.setValueTypes(tipResponse?.data?.valueTypes); |
|
|
|
|
|
|
|
|
|
|
|
// 获取决策树 graph xml |
|
|
|
|
|
const graphResponse = await axios.get(Environment.apiContextPath('api/re/model/parameter/processor/getExecutionFlowById/' + processorIdRef.value)); |
|
|
|
|
|
modelValueRef.value = graphResponse?.data; |
|
|
|
|
|
|
|
|
|
|
|
// 显示对话框 |
|
|
|
|
|
//dialogRef.value.show(); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
const close = () => { |
|
|
const close = () => { |
|
|
dialogRef.value.hide(); |
|
|
dialogRef.value.hide(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const save = (xml) => { |
|
|
const save = (xml) => { |
|
|
axios.post(Environment.apiContextPath('api/re/model/parameter/processor/saveDecisionTreeById/' + processorIdRef.value), { xml }).then((response) => { |
|
|
axios.post(Environment.apiContextPath('api/re/model/parameter/processor/saveExecutionFlowById/' + processorIdRef.value), { xml }).then((response) => { |
|
|
NotifyManager.info($t('operationSuccess')); |
|
|
NotifyManager.info($t('operationSuccess')); |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
@ -323,9 +563,9 @@ defineExpose({ |
|
|
close, |
|
|
close, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 获取资源摘要 |
|
|
const parameterId = '3b2e9e42-3e3e-4cd4-8071-a15fdfab54f3'; |
|
|
const response = await axios.get(Environment.apiContextPath('/api/re/resource/getAllReleasableResourceAbstract')); |
|
|
const processorId = '54d16aa3-1a2e-4c87-9f7a-e78ccbca5cdb'; |
|
|
resourceAbstractsRef.value = response.data; |
|
|
open(parameterId, processorId); |
|
|
|
|
|
|
|
|
const Enums = await EnumTools.fetch(['io.sc.engine.rule.core.enums.ResourceType', 'io.sc.engine.rule.core.enums.DeployStatus']); |
|
|
const Enums = await EnumTools.fetch(['io.sc.engine.rule.core.enums.ResourceType', 'io.sc.engine.rule.core.enums.DeployStatus']); |
|
|
</script> |
|
|
</script> |
|
|