|
|
@@ -479,7 +479,7 @@
|
|
|
{{formJi.envDisk + 'G'}}
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="CPU核心数:">
|
|
|
- {{formJi.envCpuNum + '个'}}
|
|
|
+ {{formJi.envCpu + '个'}}
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="内存:">
|
|
|
{{formJi.envMem + 'G'}}
|
|
|
@@ -645,7 +645,7 @@
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="服务信息" style="height: 50vh;" :key="activeTabKey">
|
|
|
- <el-button @click="showDe(scope.row)" type="primary" plain size="mini" style="margin-left: 1%;">新增服务</el-button>
|
|
|
+ <el-button @click="showAddSer" type="primary" plain size="mini" style="margin-left: 1%;">新增服务</el-button>
|
|
|
<el-table
|
|
|
:data="tableDataSer"
|
|
|
style="width: 98%;margin-left: 1%;margin-top: 1%;height: 38vh;"
|
|
|
@@ -679,10 +679,11 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="操作" width="150">
|
|
|
+ <el-table-column prop="address" label="操作" width="190">
|
|
|
<template #default="scope">
|
|
|
<div style="display: flex;justify-content: space-between;width: 100%;">
|
|
|
- <el-button @click="showDe(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">查看</el-button>
|
|
|
+ <el-button @click="editSer(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">编辑</el-button>
|
|
|
+ <el-button @click="showTest(scope.row)" type="warning" text size="mini" style="margin-left:-5%;">调试</el-button>
|
|
|
<el-button type="danger" text size="mini" style="margin-left: -5%;" @click="delSer(scope.row)">注销</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -699,6 +700,265 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog >
|
|
|
+ <el-dialog @close="clearAdd" v-model="dialogVisibleSer" title="" width="70%" destroy-on-close
|
|
|
+ :key="tableKey">
|
|
|
+ <div style="overflow: auto;height: 80vh;">
|
|
|
+ <el-form size="mini" :key="tableKey" style="margin-top: 1%;width: 98%;" :model="formAdd"
|
|
|
+ label-position="right" ref="formRefAdd" label-width="120px" :rules="rulesAdd">
|
|
|
+ <el-row :gutter="48">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="服务名称:" prop="name" style="">
|
|
|
+ <div style="display: flex;width: 100%;justify-content: space-between;">
|
|
|
+ <el-input v-model="formAdd.name" style="width: 100%;"/>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="接口类型:" prop="" style="">
|
|
|
+ <div style="display: flex;width: 100%;justify-content: space-between;">
|
|
|
+ <el-select
|
|
|
+ v-model="formAdd.type"
|
|
|
+ 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 style="display: flex;">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="48">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="接口地址:" prop="url">
|
|
|
+ <el-input v-model="formAdd.url" style="width: 100%;" class="input-with-select">
|
|
|
+ <template #prepend>
|
|
|
+ <el-select v-model="formAdd.proxyPath" placeholder="Select" style="width: 115px;">
|
|
|
+ <el-option v-for="item in gatewayRouters" :key="item.id" :label="item.serviceName"
|
|
|
+ :value="item.predicates"/>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="请求方式:" prop="" style="">
|
|
|
+ <el-select
|
|
|
+ v-model="formAdd.rqtype"
|
|
|
+ style="width: 100%;margin-left: 0%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionsRqtype"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="48">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="所属模型:" prop="mdid" style="">
|
|
|
+ <el-tree-select
|
|
|
+ v-model="formAdd.mdid"
|
|
|
+ :data="optionsMdid"
|
|
|
+ check-strictly
|
|
|
+ disabled
|
|
|
+ :render-after-expand="false"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ <!-- <el-select
|
|
|
+ v-model="formAdd.mdid"
|
|
|
+ style="width: 100%;margin-left: 0%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionsMdid"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select> -->
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="排序:" prop="dcSort">
|
|
|
+ <el-input-number v-model="formAdd.sort" :min="1" style="width: 15%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-row :gutter="48">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="响应类型:" prop="" style="display: flex; align-items: center;">
|
|
|
+ <el-radio-group v-model="formAdd.rptype" class="ml-4"
|
|
|
+ style="display: inline-flex; align-items: center;">
|
|
|
+ <el-radio label="1" size="large" style="display: inline-flex; align-items: center;">
|
|
|
+ <span style="position: relative; top: -1px">JSON</span> <!-- 微调文字位置 -->
|
|
|
+ </el-radio>
|
|
|
+ <el-radio label="2" size="large" style="display: inline-flex; align-items: center;">
|
|
|
+ <span style="position: relative; top: -1px">XML</span>
|
|
|
+ </el-radio>
|
|
|
+ <el-radio label="3" size="large" style="display: inline-flex; align-items: center;">
|
|
|
+ <span style="position: relative; top: -1px">HTML</span>
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <!-- <el-form-item label="服务分类:" prop="cateCode" style="">
|
|
|
+ <el-cascader v-model="formAdd.cateCode" :options="cascaderOptions" :props="props1" clearable
|
|
|
+ style="width: 100%;"></el-cascader>
|
|
|
+ </el-form-item> -->
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="8">
|
|
|
+ <el-form-item label="请求方式:" prop="name" style="">
|
|
|
+ <el-select
|
|
|
+ v-model="formJi.type"
|
|
|
+ :disabled="isEdit"
|
|
|
+ style="width: 100%;margin-left: 0%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionsType"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="48">
|
|
|
+ <el-col :span="13">
|
|
|
+ <el-form-item label="服务说明:">
|
|
|
+ <el-input v-model="formAdd.intro" style="width: 100%;" :rows="3" resize="none" type="textarea"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div style="margin-top: 2%;">
|
|
|
+ <div style="display: flex;justify-content: space-between;align-items: center;">
|
|
|
+ <div>
|
|
|
+ 请求参数
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;justify-content: flex-end;margin-right: 2%;">
|
|
|
+ <el-button @click="addCanAdd" style="margin-top: 1%;" type="success" size="mini" plain>新增参数
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-table
|
|
|
+ style="margin-top: 1%;width: 98%;"
|
|
|
+ :data="tableDataCanAdd"
|
|
|
+ :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.paramCode"
|
|
|
+ size="mini" text style="margin-left: 0%;border: transparent;"></el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="itemName" label="参数名称">
|
|
|
+ <template #default="scope">
|
|
|
+ <div style="width: 100%;">
|
|
|
+ <el-input placeholder="请填写参数名称" type="primary" class="noBor" v-model="scope.row.paramName"
|
|
|
+ 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.paramType"
|
|
|
+ class="noBorSel"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 100%;margin-left: 0%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionsCan"
|
|
|
+ :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 placeholder="请填写参数示例" type="primary" class="noBor" v-model="scope.row.paramValue"
|
|
|
+ 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-input type="primary" class="noBor" v-model="scope.row.paramNote" 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="delCanAdd(scope.$index)" size="mini" text
|
|
|
+ style="margin-left: 0%;">删除
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 2%;">
|
|
|
+ <!-- <div>返回响应</div> -->
|
|
|
+ <div style="color: #909399;margin-left: 8%;margin-top:1%;">此处填写本服务接口响应信息描述</div>
|
|
|
+ <el-tabs type="card" style="margin-top: -2%;width: 98%;">
|
|
|
+ <el-tab-pane label="响应内容">
|
|
|
+ <div style="display: flex; flex-direction: column;">
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <div style="overflow: auto;height: 20vh;margin-top: -1%;">
|
|
|
+ <el-input placeholder="" :rows="8" type="textarea" v-model="JsonAdd" size="mini" text
|
|
|
+ style="margin-top: 0%;width: 98%;"></el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 2.5%;margin-left: 0%;padding-bottom: 1%;">
|
|
|
+
|
|
|
+ <el-tabs type="card" style="margin-top: -1.5%;width: 98%;">
|
|
|
+ <el-tab-pane label="使用说明">
|
|
|
+
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-input placeholder="请输入示例" :rows="8" type="textarea" v-model="exampleAdd" size="mini" text
|
|
|
+ style="margin-top: -1%;width: 98%;"></el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button size="mini" @click="dialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" v-if="isAddser" @click="addSer" size="mini">
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" v-if="!isAddser" @click="saveEditService" size="mini">
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog v-model="dialogVisibleFen" :title="titleFen" width="30%" @close="clearFromTree" destroy-on-close :key="tableKey">
|
|
|
<el-form :label-width="100" label-position="right" style="margin-left: 5%;margin-top: 2%;" :model="formTree" class="demo-form-inline" ref="formRefTree" :rules="rulesTree">
|
|
|
<el-form-item label="名称:" prop="parGroupName" style="">
|
|
|
@@ -847,13 +1107,67 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog @close="clearAdd" v-model="dialogVisibleTest" :title="formJi.name" width="60%" destroy-on-close :key="tableKey">
|
|
|
+ <div style="margin-left: 1%;">
|
|
|
+ {{ detailJson.name }}:
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;align-items: center;width: 98%;margin-top: 1%;">
|
|
|
+ <div v-if="detailJson.rqtype==='GET'">
|
|
|
+ <el-tag class="ml-2" type="warning">GET</el-tag>
|
|
|
+ </div>
|
|
|
+ <div v-if="detailJson.rqtype==='POST'">
|
|
|
+ <el-tag class="ml-2" type="warning">POST</el-tag>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-left: 1%;">
|
|
|
+ {{ detailJson.url }}
|
|
|
+ </div>
|
|
|
+ <!-- <svg-icon @click="test" icon-class="startTest" style="margin-left: 1%;width: 50px;height: 25px;cursor: pointer;"/> -->
|
|
|
+ <el-button @click="test" size="mini" type="primary" style="margin-left: 1%;cursor: pointer;" plain>点击测试</el-button>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:2%;font-size: 18px;">
|
|
|
+ 请求参数
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ style="margin-top: 1%;width: 98%;"
|
|
|
+ :data="tableDataCan"
|
|
|
+ :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="paramCode" label="参数字段">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="paramName" label="参数名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="paramType" label="参数类型" width="200">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="paramValue" label="测试值">
|
|
|
+ <template #default="scope">
|
|
|
+ <div style="width: 100%;">
|
|
|
+ <el-input placeholder="请填写" type="primary" class="noBor" v-model="scope.row.paramValue" size="mini" text style="margin-left: 0%;"></el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="paramNote" label="参数说明" show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div style="margin-top:4%;font-size: 18px;">
|
|
|
+ 测试结果
|
|
|
+ </div>
|
|
|
+ <el-input :style="isError ? '--el-input-text-color: red' : ''" placeholder="" :rows="8" type="textarea" v-model="dataReturn" size="mini" text style="margin-top: 1%;width: 98%;color: red;" ></el-input>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { getModelList,addModel,delMdid,getModelDetail,updateModel,
|
|
|
addGroup,getParamsList,changePar,delAllPar,getModelParList,delFen,changeShenhe,delModelPar } from "@/api/register/regCom";
|
|
|
- import {getServiceInfo} from "@/api/service/info";
|
|
|
+import {getServiceInfo,addService,modelTreeSelect,getSerDe,delService,testService,
|
|
|
+ addServiceParam,editService} from "@/api/service/info";
|
|
|
import { ref, onMounted, onUnmounted, nextTick } from 'vue';
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import {
|
|
|
@@ -875,7 +1189,8 @@ const dialogVisibleFen = ref(false)
|
|
|
const currentHeight = ref(100)
|
|
|
const dragTableRef = ref()
|
|
|
const isaddFen = ref(false)
|
|
|
-const dialogVisibleDetail = ref(true)
|
|
|
+const isAddser = ref(true)
|
|
|
+const dialogVisibleDetail = ref(false)
|
|
|
const dialogVisible = ref(false)
|
|
|
const dialogVisibleDe = ref(false)
|
|
|
const dialogVisiblePei = ref(false)
|
|
|
@@ -884,6 +1199,8 @@ const isEdit = ref(true)
|
|
|
const name = ref('')
|
|
|
const isAdd = ref(true)
|
|
|
const mdUnit = ref('')
|
|
|
+const tableDataCanAdd = ref([])
|
|
|
+const JsonAdd = ref('')
|
|
|
const isElse = ref(false)
|
|
|
const elseLan = ref('')
|
|
|
const tableDataCan = ref([])
|
|
|
@@ -893,9 +1210,37 @@ const isExpanded = ref(false)
|
|
|
const expandableDiv = ref(null)
|
|
|
const parRow = ref({})
|
|
|
const initialHeight = 100
|
|
|
+const optionsMdid = ref([])
|
|
|
const activeColor = ref(['#6CA8DB','#6CA8DB','#6CA8DB','#6CA8DB','#6CA8DB','#6CA8DB','#6CA8DB'])
|
|
|
const expandedHeight = 250
|
|
|
const tableDataSer = ref([])
|
|
|
+const formAdd = ref({
|
|
|
+ name: '',
|
|
|
+ cateCode: '',
|
|
|
+ type: '',
|
|
|
+ proxyPath: '',
|
|
|
+ url: '',
|
|
|
+ rqtype: '',
|
|
|
+ rptype: '',
|
|
|
+ intro: '',
|
|
|
+ mdid: ''
|
|
|
+});
|
|
|
+const rulesAdd = reactive({
|
|
|
+ mdid: [{required: true, message: '必填', trigger: 'blur'}],
|
|
|
+ name: [{required: true, message: '必填', trigger: 'blur'}],
|
|
|
+ url: [{required: true, message: '必填', trigger: 'blur'}],
|
|
|
+});
|
|
|
+const formRefAdd = ref();
|
|
|
+const optionsRqtype = ref([
|
|
|
+ {
|
|
|
+ label: 'GET',
|
|
|
+ value: 'GET'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'POST',
|
|
|
+ value: 'POST'
|
|
|
+ },
|
|
|
+])
|
|
|
const formJi = ref({
|
|
|
name:'',
|
|
|
version:'',
|
|
|
@@ -953,6 +1298,41 @@ const rulesTree = reactive({
|
|
|
parGroupCode: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
});
|
|
|
const formRefTree = ref();
|
|
|
+const optionsCan = ref([
|
|
|
+ {
|
|
|
+ label: "string",
|
|
|
+ value: 'string'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "int",
|
|
|
+ value: 'int'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "boolean",
|
|
|
+ value: 'boolean'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "array",
|
|
|
+ value: 'array'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "object",
|
|
|
+ value: 'object'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "number",
|
|
|
+ value: 'number'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "null",
|
|
|
+ value: 'null'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "any",
|
|
|
+ value: 'any'
|
|
|
+ },
|
|
|
+
|
|
|
+])
|
|
|
const activeName = ref('first')
|
|
|
const titleFen = ref('');
|
|
|
const upload = reactive({
|
|
|
@@ -1123,6 +1503,105 @@ function shenhe(row){
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+function addCanAdd() {
|
|
|
+ var par = {
|
|
|
+ parName: ''
|
|
|
+ }
|
|
|
+ tableDataCanAdd.value.push(par)
|
|
|
+}
|
|
|
+
|
|
|
+function delCanAdd(index) {
|
|
|
+ tableDataCanAdd.value.splice(index, 1)
|
|
|
+}
|
|
|
+const exampleAdd = ref('')
|
|
|
+const parId = ref('')
|
|
|
+const isError = ref(false)
|
|
|
+const dataReturn = ref('')
|
|
|
+function test(){
|
|
|
+ var par = detailJson.value
|
|
|
+ par.params = tableDataCan.value
|
|
|
+ testService(par).then(res=>{
|
|
|
+ if(res.code===444){
|
|
|
+ isError.value = true
|
|
|
+ }else{
|
|
|
+ isError.value = false
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
+ dataReturn.value = res.msg
|
|
|
+ })
|
|
|
+}
|
|
|
+async function saveEditService() {
|
|
|
+ var valid
|
|
|
+ await formRefAdd.value.validate((valid1) => {
|
|
|
+ valid = valid1
|
|
|
+ });
|
|
|
+ if (valid) {
|
|
|
+ var par = formAdd.value
|
|
|
+ par.example = exampleAdd.value
|
|
|
+ par.rpcontent = JsonAdd.value
|
|
|
+ var validTable = true
|
|
|
+ for (const item of tableDataCanAdd.value) {
|
|
|
+ if (item.paramCode.length === 0 || item.paramName.length === 0 || item.paramType.length === 0) {
|
|
|
+ proxy.$modal.msgError("请填写必填项!");
|
|
|
+ validTable = false
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (validTable) {
|
|
|
+ await editService(par).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ var parCan = tableDataCanAdd.value
|
|
|
+ parCan.forEach(item => {
|
|
|
+ item.srvId = parId.value
|
|
|
+ });
|
|
|
+ addServiceParam(parCan).then(res1 => {
|
|
|
+ if (res1.code === 200) {
|
|
|
+ proxy.$modal.msgSuccess("修改成功");
|
|
|
+ dialogVisibleSer.value = false
|
|
|
+ showPei(parRow.value)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+async function addSer() {
|
|
|
+ console.log(JsonAdd.value)
|
|
|
+ var valid
|
|
|
+ await formRefAdd.value.validate((valid1) => {
|
|
|
+ valid = valid1
|
|
|
+ });
|
|
|
+ console.log(valid)
|
|
|
+ if (valid) {
|
|
|
+ var par = formAdd.value
|
|
|
+ par.example = exampleAdd.value
|
|
|
+ par.rpcontent = JsonAdd.value
|
|
|
+ console.log(par)
|
|
|
+ await addService(par).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ var parCan = tableDataCanAdd.value
|
|
|
+ if (parCan.length !== 0) {
|
|
|
+ parCan.forEach((item, index) => {
|
|
|
+ item.srvId = res.data.srvId
|
|
|
+ if (item.paramName === '') {
|
|
|
+ parCan.splice(index, 1)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ addServiceParam(parCan).then(res1 => {
|
|
|
+ if (res1.code === 200) {
|
|
|
+ proxy.$modal.msgSuccess("新增成功");
|
|
|
+ dialogVisibleSer.value = false
|
|
|
+ showPei(parRow.value)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
function handleBlur(){
|
|
|
formTree.value.parGroupCode = getChineseInitials(formTree.value.parGroupName)
|
|
|
}
|
|
|
@@ -1149,6 +1628,22 @@ function gatherTable(){
|
|
|
tableDataCan.value = tableDataCanAll.value
|
|
|
}
|
|
|
}
|
|
|
+function showAddSer(){
|
|
|
+ dialogVisibleSer.value = true
|
|
|
+ isAddser.value = true
|
|
|
+}
|
|
|
+async function editSer(row){
|
|
|
+ dialogVisibleSer.value = true
|
|
|
+ isAddser.value = false
|
|
|
+ parId.value = row.srvId
|
|
|
+ await getSerDe(row.srvId).then(res => {
|
|
|
+ tableDataCanAdd.value = res.data.list
|
|
|
+ JsonAdd.value = res.data.ptService.rpcontent
|
|
|
+ formAdd.value = res.data.ptService
|
|
|
+ exampleAdd.value = res.data.ptService.example
|
|
|
+ })
|
|
|
+}
|
|
|
+const dialogVisibleSer = ref(false)
|
|
|
function handleNodeClick(node, data){
|
|
|
console.log(node.mgid)
|
|
|
parMgid.value = node.mgid
|
|
|
@@ -1292,6 +1787,7 @@ async function showPei(row){
|
|
|
var par = {
|
|
|
mdid:row.mdid
|
|
|
}
|
|
|
+ formAdd.value.mdid = row.mdid
|
|
|
await getServiceInfo(par).then(res=>{
|
|
|
if(res.data){
|
|
|
tableDataSer.value = res.data.serviceList
|
|
|
@@ -1346,14 +1842,57 @@ function delCan(index,row){
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-function showTest(){
|
|
|
- dialogVisibleDetail.value = true
|
|
|
+const detailJson = ref({})
|
|
|
+const dialogVisibleTest = ref(false)
|
|
|
+function showTest(row){
|
|
|
+ dialogVisibleTest.value = true
|
|
|
+ dataReturn.value = ''
|
|
|
+ getSerDe(row.srvId).then(res=>{
|
|
|
+ if(res.code===200){
|
|
|
+ detailJson.value = res.data.ptService
|
|
|
+ console.log(detailJson.value)
|
|
|
+ dialogVisibleTest.value = true
|
|
|
+ tableDataCan.value = res.data.list
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+function convertNullToEmptyString(data) {
|
|
|
+ // 如果不是对象或者是null,直接返回(基础类型)
|
|
|
+ if (typeof data !== 'object' || data === null) {
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是数组,遍历每个元素并递归处理
|
|
|
+ if (Array.isArray(data)) {
|
|
|
+ return data.map(item => convertNullToEmptyString(item));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理普通对象
|
|
|
+ const result = {};
|
|
|
+ for (let key in data) {
|
|
|
+ if (data.hasOwnProperty(key)) {
|
|
|
+ const value = data[key];
|
|
|
+
|
|
|
+ if (value === null) {
|
|
|
+ // 将null直接转为空字符串
|
|
|
+ result[key] = '';
|
|
|
+ } else if (typeof value === 'object') {
|
|
|
+ // 递归处理嵌套对象或数组
|
|
|
+ result[key] = convertNullToEmptyString(value);
|
|
|
+ } else {
|
|
|
+ // 其他类型的值直接复制
|
|
|
+ result[key] = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
function showDe(row){
|
|
|
dialogVisibleDe.value = true
|
|
|
getModelDetail(row.mdid).then(res=>{
|
|
|
parForm.value = res.data
|
|
|
formJi.value = res.data
|
|
|
+ formJi.value = convertNullToEmptyString(formJi.value)
|
|
|
if(formJi.value.devlang!=='java'&&formJi.value.devlang!=='nodeJs'&&formJi.value.devlang!=='python'&&formJi.value.devlang!=='c/c++'){
|
|
|
isElse.value = true
|
|
|
formJi.value.devlang = 1
|
|
|
@@ -1502,8 +2041,20 @@ async function handleFileSuccess(response, file, fileList){
|
|
|
function clearFromTree(){
|
|
|
formTree.value = {}
|
|
|
}
|
|
|
+async function delSer(row) {
|
|
|
+ proxy.$modal.confirm('是否确认删除?').then(function () {
|
|
|
+ return delService(row.srvId);
|
|
|
+ }).then(() => {
|
|
|
+ showPei(parRow.value)
|
|
|
+ proxy.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+}
|
|
|
function clearForm(){
|
|
|
tableDataCan.value = []
|
|
|
+ formAdd.value = {
|
|
|
+ }
|
|
|
+ tableDataCanAdd.value = []
|
|
|
checked1.value = false
|
|
|
activeName.value = 'first'
|
|
|
fileList.value = []
|
|
|
@@ -1540,6 +2091,41 @@ function reg(){
|
|
|
isEdit.value = false
|
|
|
dialogVisible.value = true
|
|
|
}
|
|
|
+async function getTreeLeft() {
|
|
|
+ var par = {
|
|
|
+ params:{
|
|
|
+ level:'2',
|
|
|
+ devkind:'APP'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ await modelTreeSelect(par).then(res => {
|
|
|
+ par = res.data
|
|
|
+ optionsMdid.value = filterModelNodes(par)
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+function filterModelNodes(nodes) {
|
|
|
+ if (!Array.isArray(nodes)) return [];
|
|
|
+
|
|
|
+ const result = [];
|
|
|
+ for (const node of nodes) {
|
|
|
+ // 递归处理子节点(如果有)
|
|
|
+ const filteredChildren = node.children ? filterModelNodes(node.children) : [];
|
|
|
+
|
|
|
+ if (node.nodeType === 'MODEL') {
|
|
|
+ // 保留当前节点,并更新其子节点
|
|
|
+ node.value = node.id
|
|
|
+ result.push({
|
|
|
+ ...node,
|
|
|
+ children: filteredChildren
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 删除当前节点,将其子节点提升到当前层级
|
|
|
+ result.push(...filteredChildren);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
function getModelListTable(){
|
|
|
tableData.value = []
|
|
|
var par = {
|
|
|
@@ -1552,11 +2138,13 @@ function getModelListTable(){
|
|
|
getModelList(par).then(res=>{
|
|
|
tableData.value = res.rows
|
|
|
totalComReg.value = res.total
|
|
|
- console.log(tableData)
|
|
|
+ formJi.value.sort = res.total+1
|
|
|
})
|
|
|
}
|
|
|
const seledMo = ['primary','plain','plain','plain','plain','plain','plain']
|
|
|
-
|
|
|
+onMounted(() => {
|
|
|
+ getTreeLeft()
|
|
|
+});
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
:deep(.treeLeft) .el-tree-node__content {
|