|
@@ -6,9 +6,9 @@
|
|
|
<el-button @click="delWholeFlow" style="margin-left: auto;" type="danger" size="mini">删除</el-button>
|
|
<el-button @click="delWholeFlow" style="margin-left: auto;" type="danger" size="mini">删除</el-button>
|
|
|
<el-button style="margin-left: 1%;" type="info" size="mini" plain @click="toImage">导出为图片</el-button>
|
|
<el-button style="margin-left: 1%;" type="info" size="mini" plain @click="toImage">导出为图片</el-button>
|
|
|
<el-button style="margin-left: 1%;" type="primary" size="mini" @click="saveFlow">保存</el-button>
|
|
<el-button style="margin-left: 1%;" type="primary" size="mini" @click="saveFlow">保存</el-button>
|
|
|
- <el-button style="margin-left: 1%;" type="primary" size="mini" @click="showData">试运行</el-button>
|
|
|
|
|
|
|
+ <el-button style="margin-left: 1%;" type="primary" size="mini" @click="startTest">试运行</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-if="nodeDeSer" style="height: 85vh;overflow-y: auto;width: 20vw;position: absolute;float: right;z-index: 1000;right: 1%;top: 1%;border: 0.1px solid #dedfe0;border-radius: 6px;background-color: white;">
|
|
|
|
|
|
|
+ <div v-if="nodeDeSer" style="height: 82vh;overflow-y: auto;width: 20vw;position: absolute;float: right;z-index: 1000;right: 1%;top:6%;border: 0.1px solid #dedfe0;border-radius: 6px;background-color: white;">
|
|
|
<div style="display: flex;margin-left: 3%;margin-top: 3%;align-items: center;justify-content: space-between;width: 95%;">
|
|
<div style="display: flex;margin-left: 3%;margin-top: 3%;align-items: center;justify-content: space-between;width: 95%;">
|
|
|
<el-tag class="ml-2" style="" type="warning">服务</el-tag>
|
|
<el-tag class="ml-2" style="" type="warning">服务</el-tag>
|
|
|
<div style="margin-left: 4%;">
|
|
<div style="margin-left: 4%;">
|
|
@@ -93,6 +93,145 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="nodeStart" style="height: 82vh;overflow-y: auto;width: 40vw;position: absolute;float: right;z-index: 1000;right: 1%;top:6%;border: 0.1px solid #dedfe0;border-radius: 6px;background-color: white;">
|
|
|
|
|
+ <div style="display: flex;margin-left: 3%;margin-top: 3%;align-items: center;justify-content: space-between;width: 95%;">
|
|
|
|
|
+ <el-tag class="ml-2" style="" type="warning">开始节点</el-tag>
|
|
|
|
|
+ <el-icon @click="saveStartNode" style="margin-left: auto;cursor: pointer;"><Close /></el-icon>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button @click="addStart" style="margin-top: 5%;margin-left: 1%;" type="success" size="mini" :disabled="isEdit" plain>新增参数</el-button>
|
|
|
|
|
+ <div style="display: flex;width: 98%;margin-left: 1%;margin-top:2%;align-items: center;justify-content: space-between;">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ style="margin-top: 1%;width: 100%;"
|
|
|
|
|
+ :data="tableDataCanStart"
|
|
|
|
|
+ :cell-style="{ textAlign: 'center',padding:'2px 0' }"
|
|
|
|
|
+ :header-cell-style="{ textAlign: 'center'}"
|
|
|
|
|
+ :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center' }"
|
|
|
|
|
+ border >
|
|
|
|
|
+ <el-table-column prop="itemName" label="参数名称(必填)">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-input placeholder="请填写参数名称" type="primary" class="noBor" v-model="scope.row.name" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="itemName" label="参数类型(必填)" width="200">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.dataType"
|
|
|
|
|
+ class="noBorSel"
|
|
|
|
|
+
|
|
|
|
|
+ placeholder=""
|
|
|
|
|
+ style="width: 100%;margin-left: 0%;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in optionsType"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="itemName" label="参数说明" >
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-input type="primary" class="noBor" v-model="scope.row.description" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="itemName" label="是否必填" >
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-checkbox v-model="scope.row.required" size="large" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="itemName" label="参数值" >
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-input type="primary" class="noBor" v-model="scope.row.value" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="address" label="操作" width="100">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-button type="danger" @click="delCanStart(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="nodeEnd" style="height: 82vh;overflow-y: auto;width: 25vw;position: absolute;float: right;z-index: 1000;right: 1%;top:6%;border: 0.1px solid #dedfe0;border-radius: 6px;background-color: white;">
|
|
|
|
|
+ <div style="display: flex;margin-left: 3%;margin-top: 3%;align-items: center;justify-content: space-between;width: 95%;">
|
|
|
|
|
+ <el-tag class="ml-2" style="" type="warning">结束节点</el-tag>
|
|
|
|
|
+ <el-icon @click="saveEndNode" style="margin-left: auto;cursor: pointer;"><Close /></el-icon>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button @click="addEnd" style="margin-top: 5%;margin-left: 1%;" type="success" size="mini" :disabled="isEdit" plain>新增参数</el-button>
|
|
|
|
|
+ <div style="display: flex;width: 98%;margin-left: 1%;margin-top:2%;align-items: center;justify-content: space-between;">
|
|
|
|
|
+ <el-table :data="tableDataCanEnd" border style="width: 100%">
|
|
|
|
|
+ <el-table-column prop="paramCode" label="参数名(必填)" width="">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.name" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="itemName" label="参数类型(必填)">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.dataType"
|
|
|
|
|
+ class="noBorSel"
|
|
|
|
|
+ placeholder=""
|
|
|
|
|
+ style="width: 100%;margin-left: 0%;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in optionsType"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="paramValue" label="参数值" width="">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width:100%;">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.paramValue"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ default-first-option
|
|
|
|
|
+ :reserve-keyword="false"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in optionsCan"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.ref"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="address" label="操作" width="100">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div style="width: 100%;">
|
|
|
|
|
+ <el-button type="danger" @click="delEnd(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div style="display: flex;height: 87vh;width: 100%;padding-top:2%;justify-items: center;">
|
|
<div style="display: flex;height: 87vh;width: 100%;padding-top:2%;justify-items: center;">
|
|
|
<div style="width: 20%;margin-left: 1%;overflow-y: auto;margin-top: 0.5%;">
|
|
<div style="width: 20%;margin-left: 1%;overflow-y: auto;margin-top: 0.5%;">
|
|
|
<el-checkbox-group v-model="checkboxGroup1" size="" style="margin-left: 5%;" @change="oneSel">
|
|
<el-checkbox-group v-model="checkboxGroup1" size="" style="margin-left: 5%;" @change="oneSel">
|
|
@@ -513,77 +652,17 @@
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
- <el-dialog @close="clearSt" title="输入开始节点参数" v-model="dialogVisibleSart" width="50%" destroy-on-close :key="tableKey">
|
|
|
|
|
- <el-button @click="addStart" style="margin-top: 1%;" type="success" size="mini" :disabled="isEdit" plain>新增参数</el-button>
|
|
|
|
|
- <el-table
|
|
|
|
|
- style="margin-top: 1%;width: 98%;"
|
|
|
|
|
- :data="tableDataCanStart"
|
|
|
|
|
- :cell-style="{ textAlign: 'center',padding:'2px 0' }"
|
|
|
|
|
- :header-cell-style="{ textAlign: 'center'}"
|
|
|
|
|
- :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center' }"
|
|
|
|
|
- border >
|
|
|
|
|
- <el-table-column prop="itemName" label="参数名称(必填)">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <div style="width: 100%;">
|
|
|
|
|
- <el-input placeholder="请填写参数名称" type="primary" class="noBor" v-model="scope.row.name" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="itemName" label="参数类型(必填)" width="200">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <div style="width: 100%;">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="scope.row.dataType"
|
|
|
|
|
- class="noBorSel"
|
|
|
|
|
-
|
|
|
|
|
- placeholder=""
|
|
|
|
|
- style="width: 100%;margin-left: 0%;"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in optionsType"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="itemName" label="参数说明" >
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <div style="width: 100%;">
|
|
|
|
|
- <el-input type="primary" class="noBor" v-model="scope.row.description" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="itemName" label="是否必填" >
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <div style="width: 100%;">
|
|
|
|
|
- <el-checkbox v-model="scope.row.required" size="large" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="itemName" label="参数值" >
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <div style="width: 100%;">
|
|
|
|
|
- <el-input type="primary" class="noBor" v-model="scope.row.value" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="address" label="操作" width="100">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <div style="width: 100%;">
|
|
|
|
|
- <el-button type="danger" @click="delCanStart(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <el-dialog @close="" title="试运行结果" v-model="dialogVisibleSart" width="50%" destroy-on-close :key="tableKey">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="outputData"
|
|
|
|
|
+ :autosize="{ minRows: 2, maxRows: 4 }"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ placeholder="Please input"
|
|
|
|
|
+ />
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
<span class="dialog-footer">
|
|
|
- <el-button size="mini" @click="dialogVisibleSart = false">取消</el-button>
|
|
|
|
|
- <el-button type="primary" @click="startTest" size="mini">
|
|
|
|
|
- 提交
|
|
|
|
|
|
|
+ <el-button type="primary" @click="dialogVisibleSart = false" size="mini">
|
|
|
|
|
+ 确定
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -639,6 +718,8 @@ const formAdd = ref({
|
|
|
const tableDataCanStart = ref([])
|
|
const tableDataCanStart = ref([])
|
|
|
const dialogVisibleSart = ref(false)
|
|
const dialogVisibleSart = ref(false)
|
|
|
const testAttention = ref()
|
|
const testAttention = ref()
|
|
|
|
|
+const tableDataCanEnd = ref([])
|
|
|
|
|
+const outputData = ref()
|
|
|
const dialogVisibleTest = ref(false)
|
|
const dialogVisibleTest = ref(false)
|
|
|
const dialogVisibleCsv = ref(false)
|
|
const dialogVisibleCsv = ref(false)
|
|
|
const formAddref = ref()
|
|
const formAddref = ref()
|
|
@@ -673,6 +754,8 @@ const formJi = ref({
|
|
|
rptype:'',
|
|
rptype:'',
|
|
|
intro:'',
|
|
intro:'',
|
|
|
});
|
|
});
|
|
|
|
|
+const nodeEnd = ref(false)
|
|
|
|
|
+const nodeStart = ref(false)
|
|
|
const optionsCan = ref()
|
|
const optionsCan = ref()
|
|
|
const parTitle = ref()
|
|
const parTitle = ref()
|
|
|
const rulesJi = reactive({
|
|
const rulesJi = reactive({
|
|
@@ -857,9 +940,16 @@ const handleSelectChange = (selectedValue) => {
|
|
|
scope.row.paramValue = newValue; // 同步更新绑定值[10](@ref)
|
|
scope.row.paramValue = newValue; // 同步更新绑定值[10](@ref)
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+function addEnd(){
|
|
|
|
|
+ tableDataCanEnd.value.push([])
|
|
|
|
|
+}
|
|
|
|
|
+function delEnd(index){
|
|
|
|
|
+ tableDataCanEnd.value.splice(index,1)
|
|
|
|
|
+}
|
|
|
function startTest(){
|
|
function startTest(){
|
|
|
var param = []
|
|
var param = []
|
|
|
- if(tableDataCanStart.value.length>0){
|
|
|
|
|
|
|
+ var paramEnd = []
|
|
|
|
|
+ if(tableDataCanStart.value.length>0&&tableDataCanEnd.value.length>0){
|
|
|
tableDataCanStart.value.forEach(item=>{
|
|
tableDataCanStart.value.forEach(item=>{
|
|
|
var par = {
|
|
var par = {
|
|
|
name:item.name,
|
|
name:item.name,
|
|
@@ -870,14 +960,75 @@ function startTest(){
|
|
|
}
|
|
}
|
|
|
param.push(par)
|
|
param.push(par)
|
|
|
})
|
|
})
|
|
|
|
|
+ tableDataCanEnd.value.forEach(item=>{
|
|
|
|
|
+ var par = {
|
|
|
|
|
+ name:item.name,
|
|
|
|
|
+ dataType:item.dataType,
|
|
|
|
|
+ refType:'ref',
|
|
|
|
|
+ ref:item.paramValue
|
|
|
|
|
+ }
|
|
|
|
|
+ paramEnd.push(par)
|
|
|
|
|
+ })
|
|
|
|
|
+ nodes.value.forEach(item=>{
|
|
|
|
|
+ if(item.id==='1'){
|
|
|
|
|
+ item.data.parameters = param
|
|
|
|
|
+ }
|
|
|
|
|
+ if(item.id==='2'){
|
|
|
|
|
+ item.data.outputDefs = paramEnd
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ var a = JSON.parse(JSON.stringify(toObject()))
|
|
|
|
|
+ a.nodes.forEach(item=>{
|
|
|
|
|
+ if(item.id==='1'){
|
|
|
|
|
+ item.type = 'startNode'
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(item.id==='2'){
|
|
|
|
|
+ item.type = 'endNode'
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ item.type = 'printNode'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ var par = {}
|
|
|
|
|
+ par.flowGraph = JSON.stringify(a)
|
|
|
|
|
+ par.params = {}
|
|
|
|
|
+ tableDataCanStart.value.forEach(item=>{
|
|
|
|
|
+ // par.set(item.name,item.value)
|
|
|
|
|
+ par.params[item.name] = item.value
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(a)
|
|
|
|
|
+ runflow(par).then(res=>{
|
|
|
|
|
+ if(res.code === 200){
|
|
|
|
|
+ proxy.$message({
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ type: 'success'
|
|
|
|
|
+ });
|
|
|
|
|
+ dialogVisibleSart.value = true
|
|
|
|
|
+ outputData.value = JSON.stringify(res.data)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(tableDataCanStart.value.length===0){
|
|
|
|
|
+ proxy.$message({
|
|
|
|
|
+ message: '请设置输入值!',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(tableDataCanEnd.value.length===0){
|
|
|
|
|
+ proxy.$message({
|
|
|
|
|
+ message: '请设置输出值!',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- nodes.value.forEach(item=>{
|
|
|
|
|
- if(item.id==='1'){
|
|
|
|
|
- item.data.data = param
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+function saveStartNode(){
|
|
|
|
|
+ nodeStart.value = false
|
|
|
|
|
+}
|
|
|
|
|
+function saveEndNode(){
|
|
|
|
|
+ nodeEnd.value = false
|
|
|
|
|
+}
|
|
|
function addStart(){
|
|
function addStart(){
|
|
|
tableDataCanStart.value.push([])
|
|
tableDataCanStart.value.push([])
|
|
|
}
|
|
}
|
|
@@ -887,7 +1038,7 @@ function delCanStart(index){
|
|
|
function saveNode(){
|
|
function saveNode(){
|
|
|
// console.log(tableDataCan.value)
|
|
// console.log(tableDataCan.value)
|
|
|
var par = {
|
|
var par = {
|
|
|
- title:parTitle.value,
|
|
|
|
|
|
|
+ title:parTitle.value,
|
|
|
parameters:[]
|
|
parameters:[]
|
|
|
}
|
|
}
|
|
|
tableDataCan.value.forEach(item=>{
|
|
tableDataCan.value.forEach(item=>{
|
|
@@ -1096,31 +1247,52 @@ function removeDuplicatesAndEmptyItems(arr) {
|
|
|
return false;
|
|
return false;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+function parseJSONWithComments(jsonString) {
|
|
|
|
|
+ // 移除单行注释(//)和多行注释(/* */)
|
|
|
|
|
+ const cleanedJson = jsonString.replace(/\/\/.*|\/\*[\s\S]*?\*\//g, '');
|
|
|
|
|
+ try {
|
|
|
|
|
+ return JSON.parse(cleanedJson);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error("解析失败:", error.message);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
onNodeClick(({event, node}) => {
|
|
onNodeClick(({event, node}) => {
|
|
|
|
|
+ nodeEnd.value = false
|
|
|
|
|
+ nodeStart.value = false
|
|
|
|
|
+ nodeDeSer.value = false
|
|
|
console.log(node)
|
|
console.log(node)
|
|
|
parNodeid.value = node.id
|
|
parNodeid.value = node.id
|
|
|
parTitle.value = node.data.name
|
|
parTitle.value = node.data.name
|
|
|
tableDataCan.value = []
|
|
tableDataCan.value = []
|
|
|
optionsCan.value = []
|
|
optionsCan.value = []
|
|
|
var parNode = getPredecessorsNodes(node.id)
|
|
var parNode = getPredecessorsNodes(node.id)
|
|
|
- parNode.forEach((item,index) => {
|
|
|
|
|
- if(item.data.rpcontent){
|
|
|
|
|
- var parShu = Object.keys(JSON.parse(item.data.rpcontent))
|
|
|
|
|
|
|
+ console.log((JSON.parse(JSON.stringify(parNode))))
|
|
|
|
|
+ var a = JSON.parse(JSON.stringify(parNode))
|
|
|
|
|
+ a.forEach((item,index) => {
|
|
|
|
|
+ console.log(item.data)
|
|
|
|
|
+ if(item.data.label!=='开始'&&item.data.service&&item.data.service.rpcontent){
|
|
|
|
|
+ item.data.service.rpcontent = parseJSONWithComments(item.data.service.rpcontent)
|
|
|
|
|
+ // console.log((item.data.service.rpcontent))
|
|
|
|
|
+ var parShu = Object.keys((item.data.service.rpcontent))
|
|
|
parShu.forEach(item1=>{
|
|
parShu.forEach(item1=>{
|
|
|
var count = index+1
|
|
var count = index+1
|
|
|
var par = {
|
|
var par = {
|
|
|
ref:count.toString() + ':' + item1,
|
|
ref:count.toString() + ':' + item1,
|
|
|
- name:item.data.name + ':' + item1
|
|
|
|
|
|
|
+ name:item.data.label + ':' + item1
|
|
|
}
|
|
}
|
|
|
optionsCan.value.push(par)
|
|
optionsCan.value.push(par)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- console.log((node.data.rpcontent))
|
|
|
|
|
|
|
+ console.log(optionsCan.value)
|
|
|
|
|
+ if(node.data.label==='结束'){
|
|
|
|
|
+ nodeEnd.value = true
|
|
|
|
|
+ }
|
|
|
|
|
+ if(node.data.label==='开始'){
|
|
|
|
|
+ nodeStart.value = true
|
|
|
|
|
+ }
|
|
|
if(node.data.nodeType==='SERVICE'){
|
|
if(node.data.nodeType==='SERVICE'){
|
|
|
- console.log(222)
|
|
|
|
|
- // console.log(getPredecessorsNodes(node.id))
|
|
|
|
|
getSerDe(node.data.id).then(res=>{
|
|
getSerDe(node.data.id).then(res=>{
|
|
|
serviceRqtype.value = res.data.ptService.rqtype
|
|
serviceRqtype.value = res.data.ptService.rqtype
|
|
|
servieName.value = res.data.ptService.name
|
|
servieName.value = res.data.ptService.name
|
|
@@ -1129,7 +1301,6 @@ onNodeClick(({event, node}) => {
|
|
|
serviceUrl.value = res.data.ptService.url
|
|
serviceUrl.value = res.data.ptService.url
|
|
|
nodeDeSer.value = true
|
|
nodeDeSer.value = true
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
if(node.data.nodeType==='tool'){
|
|
if(node.data.nodeType==='tool'){
|
|
|
console.log(node.data.value)
|
|
console.log(node.data.value)
|