nanjingliujinyu 6 сар өмнө
parent
commit
b84ebcb432

+ 20 - 0
ruoyi-ui/src/api/service/info.js

@@ -60,3 +60,23 @@ export function addService(data) {
 export function addParam(data) {
   return request.post("/pt/service/param/addList", data);
 }
+export function editService(data) {
+  return request({
+    url: '/pt/service',
+    method: 'put',
+    data: data
+  })
+}
+export function editParam(data) {
+  return request({
+    url: '/pt/service/param/update',
+    method: 'post',
+    data: data
+  })
+}
+export function delService(id) {
+  return request({
+    url: '/pt/service/' + id,
+    method: 'delete'
+  })
+}

+ 213 - 91
ruoyi-ui/src/views/service/info/index.vue

@@ -12,20 +12,37 @@
         <el-button type="primary" @click="showAdd" style="margin-left: 5%;width: 10%;" :icon="Plus"/>
       </div>
       <!-- <Plus style="width: 1em; height: 1em; margin-left:90%;cursor: pointer;color: #337ecc;" @click="showAddTree"/> -->
-      <el-tree class="treeLeft" :data="data" @node-click="handleNodeClick" node-key="id" style="margin-left: 5%;margin-top: 5%;width: 90%;background-color: transparent;" default-expand-all :key="valueKet">
+      <el-tree  :current-node-key="currentNodeKey" class="treeLeft" :data="data" @node-click="handleNodeClick" node-key="id" style="margin-left: 5%;margin-top: 5%;width: 90%;background-color: transparent;" default-expand-all :key="valueKet">
           <template #default="{ node, data }">
-            <span class="custom-tree-node">
-              <el-icon v-if="data.children"><Folder /></el-icon>
-              <div v-if="!data.children">
-                <el-tag v-if="data.nodeType=='MODEL'" class="ml-2" type="warning">模型</el-tag>
-                <el-tag v-if="data.nodeType=='SERVICE'" class="ml-2">
-                  服务
-                </el-tag>
-                <el-tag v-if="data.nodeType=='TREE'" class="ml-2" type="success">树</el-tag>
-                <!-- <el-tag class="ml-2" type="warning">POST</el-tag>
-                <el-tag class="ml-2" type="danger">DEL</el-tag> -->
+            <span  style="justify-content: space-between;display: flex;width: 100%;align-items: center;">
+              <div class="custom-tree-node">
+                <el-icon v-if="data.children"><Folder /></el-icon>
+                <div v-if="!data.children">
+                  <el-tag v-if="data.nodeType=='MODEL'" class="ml-2" type="warning">模型</el-tag>
+                  <!-- <el-tag  class="ml-2">
+                    服务
+                  </el-tag> -->
+                  <svg-icon icon-class="service2" style="color: #13E03B;" v-if="data.nodeType=='SERVICE'"/>
+                  <el-tag v-if="data.nodeType=='TREE'" class="ml-2" type="success">树</el-tag>
+                </div>
+                <span>{{ node.label }}</span>
+              </div>
+              <div style="margin-right: 1%;">
+                <el-dropdown trigger="hover" @click.stop v-if="currentNodeKey === data.id">
+                    <el-icon class="el-icon--right">
+                      <plus />
+                    </el-icon>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item>Action 1</el-dropdown-item>
+                      <el-dropdown-item>Action 2</el-dropdown-item>
+                      <el-dropdown-item>Action 3</el-dropdown-item>
+                      <el-dropdown-item disabled>Action 4</el-dropdown-item>
+                      <el-dropdown-item divided>Action 5</el-dropdown-item>
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
               </div>
-              <span>{{ node.label }}</span>
             </span>
           </template>
         </el-tree>
@@ -78,13 +95,13 @@
                 </div>
                 <div style="display: flex;width: 100%;">
                     <div style="display: flex;margin-left: 1%;font-size: 15px;color:#909399;width:100%;margin-top: 1%;">
-                        <div>
+                        <!-- <div>
                             服务分类:
                         </div>
                         <div style="margin-left: 0.5%;">
-                            {{detail.name}}
-                        </div>
-                        <div style="margin-left: 5%;">
+                            {{detail.cateCode}}
+                        </div> -->
+                        <div style="margin-left: 0%;">
                             请求方式:
                         </div>
                         <div style="margin-left: 0.5%;">
@@ -114,12 +131,12 @@
                     </div>
                 </div>
                 <div style="margin-left: 1%;font-size: 15px;color:#909399;width:100%;display: flex;margin-top: 0.5%;">
-                    <div style="margin-left: 0%;">
+                    <!-- <div style="margin-left: 0%;">
                         返回说明:
                     </div>
                     <div style="margin-left: 0.5%;">
                         {{detail.name}}
-                    </div>
+                    </div> -->
                 </div>
                 <div style="margin-top: 2.5%;margin-left: 1%;">
                     <div>请求参数</div>
@@ -141,16 +158,15 @@
                       </el-table>
                 </div>
                 <div style="margin-top: 2.5%;margin-left: 1%;">
-                    <div>返回响应</div>
                     <el-tabs type="card" style="margin-top: 1%;width: 98%;">
                         <el-tab-pane label="成功(200)">
                             <div style="display: flex;align-items: center;line-height: 1.5;font-size: 14px;margin-left: 1%;color: #606266;">
-                                <div>HTTP状态码:</div>
+                                <!-- <div>HTTP状态码:</div>
                                 <div>200</div>
                                 <div style="margin-left: 5%;">内容格式:</div>
-                                <div>JSON</div>
+                                <div>JSON</div> -->
                             </div>
-                            <el-tree  :data="data1" :props="defaultProps" @node-click="handleNodeClick" style="margin-top: 1%;margin-left: 2%;background-color: #F7F7F7;background-color: transparent;width: 15%;" default-expand-all>
+                            <!-- <el-tree  :data="dataReturn" :props="defaultProps" @node-click="handleNodeClick" style="margin-top: 1%;margin-left: 2%;background-color: #F7F7F7;background-color: transparent;width: 15%;" default-expand-all>
                                 <template #default="{ node, data }">
                                     <span style="display: flex;justify-content: space-between;width: 100%;align-items: center;">
                                         <span>{{ node.label }}</span>
@@ -167,14 +183,36 @@
                                         </span>
                                     </span>
                                 </template>
-                            </el-tree>
+                            </el-tree> -->
+                            
                         </el-tab-pane>
                     </el-tabs>
+                    <div style="margin-top: -1%;">
+                      <json-viewer 
+                          :value="dataReturn" 
+                          :expand-depth="5" 
+                          copyable 
+                          theme="my-theme"
+                      />
+                      <!-- <JsonEditorVue
+                          v-model="dataReturn"
+                          style="height:98%;width: 100%;"
+                          :mode="'code'"
+                          :showBtns="false"
+                          :options="{
+                            navigationBar: false, // 隐藏顶部导航栏
+                            statusBar: false,     // 隐藏底部状态栏
+                            mode: 'code',          // 仅保留代码编辑模式
+                            mainMenuBar: false     // 隐藏主菜单栏
+                          }"
+                          lang="zh"
+                        /> -->
+                    </div>
                 </div>
                 <div style="margin-top: 2.5%;margin-left: 1%;padding-bottom: 1%;">
                     <div>响应示例</div><el-tabs type="card" style="margin-top: 1%;">
                         <el-tab-pane label="成功示例">
-                             <div style="overflow: auto;height: 50vh">
+                             <div style="overflow: auto;height: 30vh">
                                 <json-viewer 
                                     :value="dataJsonXiang" 
                                     :expand-depth="5" 
@@ -188,18 +226,18 @@
             
               </div>
             </el-tab-pane>
-            <el-tab-pane label="修改" name="second" style="">
+            <el-tab-pane label="修改" name="second" style="" :disabled="isEdit">
                 <div style="overflow: auto;height: 80vh;">
                   <div style="display: flex;margin-top: 1%;">
-                    <el-button type="primary" @click="showAdd" style="margin-left: 80%;">提交</el-button>
-                    <el-button type="danger" @click="showAdd" style="margin-left: 1%;">删除</el-button>
+                    <el-button type="primary" @click="saveEditService" style="margin-left: 80%;z-index: 1000;" :disabled="isEdit">提交</el-button>
+                    <el-button type="danger" @click="delSer" style="margin-left: 1%;z-index: 1000;" :disabled="isEdit">删除</el-button>
                   </div>
                     <el-form size="mini" :key="tableKey" style="margin-top: -2%;width: 98%;"  :model="formJi" label-position="right" ref="formRefJi" label-width="120px" :rules="rulesJi">
                       <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="formJi.name" style="width: 100%;"/>
+                                    <el-input :disabled="isEdit" v-model="formJi.name" style="width: 100%;"/>
                                   </div>
                               </el-form-item>
                             </el-col>
@@ -231,6 +269,7 @@
                               <el-form-item label="接口地址:" prop="url" style=""> 
                                   <el-input
                                   v-model="formJi.url"
+                                  :disabled="isEdit"
                                   style="width: 100%;"
                                   placeholder=""
                                   class="input-with-select"
@@ -258,7 +297,7 @@
                       <el-row :gutter="48">
                             <el-col :span="10">
                               <el-form-item label="响应类型:" prop="" style="display: flex; align-items: center;">
-                                <el-radio-group v-model="formJi.rptype" class="ml-4" style="display: inline-flex; align-items: center;">
+                                <el-radio-group :disabled="isEdit" v-model="formJi.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>
@@ -273,7 +312,7 @@
                             </el-col>
                             <el-col :span="6">
                                 <el-form-item label="服务分类:" prop="cateCode" style="">
-                                    <el-cascader v-model="formJi.cateCode" :options="cascaderOptions" :props="props1" clearable style="width: 100%;"></el-cascader>
+                                    <el-cascader :disabled="isEdit" v-model="formJi.cateCode" :options="cascaderOptions" :props="props1" clearable style="width: 100%;"></el-cascader>
                                 </el-form-item>
                             </el-col>
                             <!-- <el-col :span="8">
@@ -296,7 +335,7 @@
                       <el-row :gutter="48">
                             <el-col :span="13">
                               <el-form-item label="服务说明:">
-                                  <el-input v-model="formJi.intro" style="width: 100%;" :rows="3" resize="none" type="textarea"/>
+                                  <el-input :disabled="isEdit" v-model="formJi.intro" style="width: 100%;" :rows="3" resize="none" type="textarea"/>
                               </el-form-item>
                             </el-col>
                       </el-row>
@@ -322,7 +361,7 @@
                                 <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>
+                                            <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>
@@ -417,8 +456,8 @@
                             </el-tab-pane>
                         </el-tabs>
                         <div style="overflow: auto;height: 20vh;margin-top: -1%;">
-                          <JsonEditorVue
-                            v-model="msgSu"
+                          <!-- <JsonEditorVue
+                            v-model="dataJsonXiang"
                             style="height:98%;width: 98%;"
                             :mode="'code'"
                             :showBtns="false"
@@ -429,7 +468,8 @@
                               mainMenuBar: false     // 隐藏主菜单栏
                             }"
                             lang="zh"
-                          />
+                          /> -->
+                          <el-input placeholder="请输入示例" :rows="8" type="textarea" v-model="dataJsonXiang" 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%;">
@@ -439,27 +479,27 @@
                              
                         </el-tab-pane>
                     </el-tabs>
-                    <el-input placeholder="请输入示例" :rows="8" type="textarea" v-model="titleTree" size="mini" text style="margin-top: -1%;width: 98%;" ></el-input>
+                    <el-input placeholder="请输入示例" :rows="8" type="textarea" v-model="example" size="mini" text style="margin-top: -1%;width: 98%;" ></el-input>
                 </div>
                 </div>
             </el-tab-pane>
         </el-tabs>
         <el-dialog @close="clearFromTree" :title="titleTree" v-model="dialogVisible" 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="formJi" label-position="right" ref="formRefJi" label-width="120px" :rules="rulesJi">
+                    <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="version" style="">
+                              <el-form-item label="服务名称:" prop="name" style="">
                                   <div style="display: flex;width: 100%;justify-content: space-between;">
-                                    <el-input v-model="formJi.version" style="width: 100%;"/>
+                                    <el-input v-model="formAdd.name" style="width: 100%;"/>
                                   </div>
                               </el-form-item>
                             </el-col>
                             <el-col :span="6">
-                              <el-form-item label="接口类型:" prop="name" style="">
+                              <el-form-item label="接口类型:" prop="" style="">
                                 <div style="display: flex;width: 100%;justify-content: space-between;">
                                   <el-select
-                                    v-model="formJi.type"
+                                    v-model="formAdd.type"
                                     :disabled="isEdit"
                                         style="width: 100%;margin-left: 0%;"
                                     >
@@ -480,9 +520,9 @@
                       </el-row>
                       <el-row :gutter="48">
                             <el-col :span="10">
-                              <el-form-item label="接口地址:" prop="enname" style=""> 
+                              <el-form-item label="接口地址:" prop="url" style=""> 
                                   <el-input
-                                  v-model="input3"
+                                  v-model="formAdd.url"
                                   style="width: 100%;"
                                   placeholder=""
                                   class="input-with-select"
@@ -491,9 +531,9 @@
                               </el-form-item>
                             </el-col>
                             <el-col :span="6">
-                                <el-form-item label="请求方式:" prop="name" style="">
+                                <el-form-item label="请求方式:" prop="" style="">
                                     <el-select
-                                    v-model="formJi.type"
+                                    v-model="formAdd.rqtype"
                                     :disabled="isEdit"
                                         style="width: 100%;margin-left: 0%;"
                                     >
@@ -509,8 +549,8 @@
                       </el-row>
                       <el-row :gutter="48">
                             <el-col :span="10">
-                              <el-form-item label="响应类型:" prop="name" style="display: flex; align-items: center;">
-                                <el-radio-group v-model="radio1" class="ml-4" style="display: inline-flex; align-items: center;">
+                              <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>
@@ -524,8 +564,8 @@
                               </el-form-item>
                             </el-col>
                             <el-col :span="6">
-                                <el-form-item label="服务分类:" prop="name" style="">
-                                    <el-cascader v-model="a" :options="cascaderOptions" :props="props1" clearable style="width: 100%;"></el-cascader>
+                                <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">
@@ -548,7 +588,7 @@
                       <el-row :gutter="48">
                             <el-col :span="13">
                               <el-form-item label="服务说明:">
-                                  <el-input v-model="formJi.intro" style="width: 100%;" :rows="3" resize="none" type="textarea"/>
+                                  <el-input v-model="formAdd.intro" style="width: 100%;" :rows="3" resize="none" type="textarea"/>
                               </el-form-item>
                             </el-col>
                       </el-row>
@@ -560,13 +600,13 @@
                             请求参数
                           </div>
                           <div style="display: flex;justify-content: flex-end;margin-right: 2%;">
-                            <el-button  @click="addPa" style="margin-top: 1%;" type="success" size="mini" plain>新增参数</el-button>
+                            <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="tableDataCan" 
+                            :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'  }"
@@ -574,7 +614,7 @@
                                 <el-table-column prop="itemName" label="参数字段">
                                     <template #default="scope">
                                         <div style="width: 100%;">
-                                            <el-input placeholder="请填写参数编码" type="primary" class="noBor" v-model="scope.row.itemCode" size="mini" text style="margin-left: 0%;border: transparent;"></el-input>
+                                            <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>
@@ -614,7 +654,7 @@
                                 <el-table-column prop="address" label="操作" width="100">
                                     <template #default="scope">
                                         <div style="width: 100%;">
-                                            <el-button type="danger" @click="delCan(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
+                                            <el-button type="danger" @click="delCanAdd(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
                                         </div>
                                     </template>
                                 </el-table-column>
@@ -669,19 +709,7 @@
                             </el-tab-pane>
                         </el-tabs>
                         <div style="overflow: auto;height: 20vh;margin-top: -1%;">
-                          <JsonEditorVue
-                            v-model="msgSu"
-                            style="height:98%;width: 98%;"
-                            :mode="'code'"
-                            :showBtns="false"
-                            :options="{
-                              navigationBar: false, // 隐藏顶部导航栏
-                              statusBar: false,     // 隐藏底部状态栏
-                              mode: 'code',          // 仅保留代码编辑模式
-                              mainMenuBar: false     // 隐藏主菜单栏
-                            }"
-                            lang="zh"
-                          />
+                          <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%;">
@@ -691,7 +719,7 @@
                              
                         </el-tab-pane>
                     </el-tabs>
-                    <el-input placeholder="请输入示例" :rows="8" type="textarea" v-model="titleTree" size="mini" text style="margin-top: -1%;width: 98%;" ></el-input>
+                    <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>
@@ -710,7 +738,7 @@
 import {getCatalog} from "@/api/service/catalog";
 import { Plus,Search,Filter,Promotion,Check  } from '@element-plus/icons-vue'
 import { reactive } from 'vue'
-import { modelTreeSelect,getSerDe } from "@/api/service/info";
+import { modelTreeSelect,getSerDe,addService,addParam,editService,editParam,addServiceParam,delService } from "@/api/service/info";
 import { ref, onMounted, onUnmounted, nextTick,onBeforeMount } from 'vue';
 import JsonViewer from 'vue-json-viewer'
 import 'vue-json-viewer/style.css' 
@@ -726,15 +754,15 @@ const treeData =  ref(
     {label:'上海市中心城区排水系统模型'},
     {label:'温带风暴潮预报模型等专业模型的标准化改造'},
 )
-const msgSu= ref({
-  "msg":"操作成功",
-  "code":200
-})
+const JsonAdd= ref(JSON.stringify({ data: "初始值1" }))
+const exampleAdd = ref('')
 const detail = ref({
   name:'',
   rqtype:'',
   rptype:''
 })
+const isEdit = ref(true)
+const dataReturn = ref({})
 const optionsCan = ref([
   {
     label:"string",
@@ -770,6 +798,7 @@ const optionsCan = ref([
   },
   
 ])
+const currentNodeKey = ref('')
 const options =  ref([
     {label:'开发中',
     value:'1'
@@ -779,6 +808,7 @@ const options =  ref([
     },
 ])
 const dataJsonXiang = ref([])
+const valueKet = ref(0)
 const tableDataCan = ref([
     {
       itemName:'',
@@ -825,6 +855,15 @@ const isAdd = ref(false)
 const isAddTa = ref(false)
 const treeId = ref('');
 const valueSta = ref('1');
+const example = ref('');
+const tableDataCanAdd = ref([
+  {
+      itemName:'',
+      itemCode:'',
+      paramType:'',
+      paramNote:''
+    }
+])
 const formZu = ref({
   itemName:'',
   itemTp:'',
@@ -835,6 +874,7 @@ const formZu = ref({
   itemUnit:'',
   itemNotes:'',
 });
+const parId= ref('')
 const formJi = ref({
   name:'',
   cateCode:'',
@@ -850,14 +890,21 @@ const rulesJi = reactive({
   cateCode: [{ required: true, message: '必填', trigger: 'blur' }],
 });
 const formRefJi = ref();
-const rulesZu = reactive({
-  itemName: [{ required: true, message: '必填', trigger: 'blur' }],
-  itemEn: [{ required: true, message: '必填', trigger: 'blur' }],
-  itemTp: [{ required: true, message: '必填', trigger: 'blur' }],
-  itemDataTp: [{ required: true, message: '必填', trigger: 'blur' }],
-  itemDefaultVal: [{ required: true, message: '必填', trigger: 'blur' }],
+const formAdd = ref({
+  name:'',
+  cateCode:'',
+  type:'',
+  url:'',
+  rqtype:'',
+  rptype:'',
+  intro:'',
 });
-const formRefZu = ref();
+const rulesAdd = reactive({
+  name: [{ required: true, message: '必填', trigger: 'blur' }],
+  url: [{ required: true, message: '必填', trigger: 'blur' }],
+  cateCode: [{ required: true, message: '必填', trigger: 'blur' }],
+});
+const formRefAdd = ref();
 
 const formTree = ref({
   itemName:'',
@@ -875,25 +922,91 @@ const cascaderOptions = ref([])
 const props1 = ref({
   checkStrictly: true,
 })
+const detailJson = ref([])
 
-function addSer(){
-  formRefJi.value.validate((valid) => {
-    if(valid){
-      var par = formJi.value
-
-    }
+async function delSer(){
+  proxy.$modal.confirm('是否确认删除?').then(function () {
+    return delService(parId.value.id);
+  }).then(() => {
+    getTreeLeft();
+    proxy.$modal.msgSuccess("删除成功");
+  }).catch(() => {});
+}
+async function saveEditService(){
+  console.log(JsonAdd.value)
+  var valid
+  await formRefJi.value.validate((valid1) => {
+    valid = valid1
   });
+  console.log(valid)
+  if(valid){
+    var par = formJi.value
+    par.example = example.value
+    par.rpcontent = dataJsonXiang.value
+    par.cateCode = par.cateCode[0]
+    console.log(par)
+    await editService(par).then(res=>{
+      if(res.code===200){
+        var parCan = tableDataCan.value
+        // parCan.srvId = parId.value.srvId
+        addServiceParam(parCan).then(res1=>{
+          if(res1.code===200){
+            proxy.$modal.msgSuccess("修改成功");
+            getTreeLeft()
+          }
+        })
+      }
+    })
+  }
+}
+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
+    par.cateCode = par.cateCode[0]
+    console.log(par)
+
+    await addService(par).then(res=>{
+      if(res.code===200){
+        var parCan = tableDataCanAdd.value
+        parCan.srvId = res.data.srvId
+        addServiceParam(parCan).then(res1=>{
+          if(res1.code===200){
+            proxy.$modal.msgSuccess("新增成功");
+            getTreeLeft()
+          }
+        })
+      }
+    })
+    
+    
+  }
+
 }
 function showAdd(){
   dialogVisible.value = true
 }
-function handleNodeClick(node,data){
-  getSerDe(data.id).then(res=>{
-    detail.value = res.data
+function handleNodeClick(node,data,event){
+  currentNodeKey.value = data.data.id
+  console.log(currentNodeKey.value)
+  isEdit.value = false
+  parId.value = data.data
+  getSerDe(data.data.id).then(res=>{
+    detail.value = res.data.ptService
     detail.value.nodeType = data.data.nodeType
     tableDataCan.value = res.data.list
+    dataReturn.value = res.data.returnList
     console.log(tableDataCan.value)
-    dataJsonXiang.value = res.data.returnList 
+    dataJsonXiang.value = res.data.ptService.rpcontent
+    formJi.value = res.data.ptService
+    example.value = res.data.ptService.example
   })
 }
 function getTreeLeft(){
@@ -965,6 +1078,15 @@ function addPa(){
 function delCan(index){
   tableDataCan.value.splice(index, 1)
 }
+function addCanAdd(){
+    var par = {
+        itemName:''
+    }
+    tableDataCanAdd.value.push(par)
+}
+function delCanAdd(index){
+  tableDataCanAdd.value.splice(index, 1)
+}
 onMounted(() => {
   fetchData()
   getTreeLeft()
@@ -1035,7 +1157,6 @@ onMounted(() => {
 }
 :deep(.treeLeft) .el-tree-node__content:active {
     background-color: rgka(69,157,255,0.1) !important;
-    transform: scale(0.98); /* 轻微缩放增强按压感 */
   }
 
   /* 选中态(Active) */
@@ -1069,6 +1190,7 @@ onMounted(() => {
   display: flex;       /* 启用 Flex 布局 */
   align-items: center; /* 垂直居中 */
   gap: 8px;            /* 图标与文字间距 */
+  justify-content: space-between;
 }
 .el-table .el-table__row td {
   height: 60px !important; /* 行高 */