Hua 3 сар өмнө
parent
commit
8d28ea181c

+ 49 - 54
ruoyi-ui/src/views/evaluate/index.vue

@@ -1,7 +1,15 @@
 <template>
    <div style="overflow-y: auto;background-color:  #F7F7F7;height: 100%;">
      <div style="margin-left: 1%;width: 98%;display: flex;margin-top: 1%;height: 15vh;">
-        <div shadow="always" style="width: 33%;height: 100%;;border-radius: 10px;background-color: white;" class="boxShadow">
+      <div shadow="always" style="width: 33%;height: 100%;;border-radius: 10px;background-color: white;margin-left: 0%;" class="boxShadow">
+          <div style="width: 100%;display: flex;align-items: center;justify-content: center;font-size: 35px;font-weight: bold;color: #2DBEA2;;height: 70%">
+            {{yearAll}}
+          </div>
+          <div style="display: flex;align-items: center;justify-content: center;background-color: #2DBEA2;font-size: 20px;width: 100%;color: white;text-align: center;border-radius: 0 0 10px 10px;height: 30%;">
+            年调用次数
+          </div>
+        </div>
+        <div shadow="always" style="width: 33%;margin-left: 1%;height: 100%;;border-radius: 10px;background-color: white;" class="boxShadow">
           <div style="width: 100%;display: flex;align-items: center;justify-content: center;font-size: 35px;font-weight: bold;color: #477ACF;;height: 70%">
             {{dayAll}}
           </div>
@@ -17,14 +25,7 @@
             月调用次数
           </div>
         </div>
-        <div shadow="always" style="width: 33%;height: 100%;;border-radius: 10px;background-color: white;margin-left: 1%;" class="boxShadow">
-          <div style="width: 100%;display: flex;align-items: center;justify-content: center;font-size: 35px;font-weight: bold;color: #2DBEA2;;height: 70%">
-            {{yearAll}}
-          </div>
-          <div style="display: flex;align-items: center;justify-content: center;background-color: #2DBEA2;font-size: 20px;width: 100%;color: white;text-align: center;border-radius: 0 0 10px 10px;height: 30%;">
-            年调用次数
-          </div>
-        </div>
+        
       </div>
       <div style="background-color:  #F7F7F7;padding-top:1%;">
         <div style="margin-left: 1%;width: 98%;display: flex;height: 32vh;">
@@ -217,7 +218,7 @@ function getMon(){
     },
     mdId:valueModMon.value
   }
-  var x = [1,2,3,4,5,6,7,8,9,10,11,12]
+  var x = getMonthsFromJanuaryToCurrent()
   var y = []
   x.forEach(item=>{
     y.push(0)
@@ -233,6 +234,35 @@ function getMon(){
     initChartbt1(y,mdName)
   })
 }
+function getMonthsFromJanuaryToCurrent() {
+    const today = new Date();
+    const currentYear = today.getFullYear();
+    const currentMonth = today.getMonth() + 1; // 获取当前月份 (1-12)
+    
+    const monthsArray = [];
+    
+    // 从1月循环到当前月份
+    for (let month = 1; month <= currentMonth; month++) {
+        monthsArray.push(month);
+    }
+    
+    return monthsArray;
+}
+function getDaysFromFirstToToday() {
+    const today = new Date();
+    const currentYear = today.getFullYear();
+    const currentMonth = today.getMonth();
+    const currentDay = today.getDate(); // 获取今天是几号
+    
+    const daysArray = [];
+    
+    // 从1号循环到今天
+    for (let day = 1; day <= currentDay; day++) {
+        daysArray.push(day);
+    }
+    
+    return daysArray;
+}
 function getDay(){
   var mdName
   for(var i = 0;i<optionsModel.value.length;i++){
@@ -248,8 +278,7 @@ function getDay(){
     },
     mdId:valueMod.value
   }
-  console.log(Number('01'))
-  var x = getAllDaysInMonth(valueYue.value)
+  var x = getDaysFromFirstToToday(valueYue.value)
   var y = []
   x.forEach(item=>{
     y.push(0)
@@ -290,7 +319,9 @@ function inintChartTop1(x,y,mdName){
     },
     yAxis: {
       type: 'value',
-      splitLine: { show: false }
+      splitLine: { show: false },
+      name: '单位:次', 
+      minInterval: 1, 
     },
     series: [
       {
@@ -300,47 +331,6 @@ function inintChartTop1(x,y,mdName){
       data: y,
       smooth: true
     },
-    // {
-    //   name: '上海沿海风暴潮预报模型',
-    //   type: 'line',
-    //   color:'rgb(51, 126, 204)',
-    //   data:  [39, 37, 37, 1, 18, 19, 16, 15, 18, 16, 19, 35, 12, 10, 5, 12, 25, 2, 16, 13, 27, 14, 4, 9, 18, 27, 29, 14, 35, 22], smooth: true
-    // },
-    // {
-    //   name: '黄浦江水系水文分析预报数值模拟模型',
-    //   type: 'line',
-    //   smooth: true,
-    //   color:'rgb(121, 187, 255)',
-    //   data: [28, 8, 12, 34, 33, 20, 10, 3, 24, 38, 35, 20, 28, 33, 23, 10, 13, 14, 33, 3, 32, 18, 9, 3, 6, 37, 24, 5, 33, 20],
-    // },
-    // {
-    //   name: '苏州河水系水情预报模型',
-    //   type: 'line',
-    //   color:'rgb(121, 187, 255)',
-    //   smooth: true,
-    //   data:  [19, 12, 38, 13, 9, 20, 35, 10, 32, 7, 26, 17, 23, 15, 33, 10, 27, 39, 2, 37, 19, 39, 28, 11, 33, 30, 37, 31, 13, 36],
-    // },
-    // {
-    //   name: '内涝风险实时预警与预报模型',
-    //   type: 'line',
-    //   smooth: true,
-    //   color:"rgb(198, 226, 255)",
-    //   data: [15, 15, 37, 35, 24, 14, 23, 13, 12, 36, 17, 20, 10, 17, 24, 39, 10, 15, 32, 23, 31, 8, 28, 3, 25, 30, 3, 25, 8, 2],
-    // },
-    // {
-    //   name: '上海市中心城区排水系统模型',
-    //   smooth: true,
-    //   type: 'line',
-    //   color:'#67C23A',
-    //   data:  [37, 25, 18, 35, 15, 28, 8, 24, 34, 8, 20, 8, 10, 16, 18, 23, 7, 14, 17, 13, 18, 28, 8, 37, 32, 18, 37, 8, 16, 40],
-    // },
-    // {
-    //   name: '温带风暴潮预报模型',
-    //   smooth: true,
-    //   type: 'line',
-    //   color:'rgb(149, 212, 117)',
-    //   data:  [35, 23, 35, 18, 32, 13, 34, 8, 5, 7, 21, 4, 19, 14, 10, 5, 1, 2, 26, 2, 27, 31, 18, 17, 28, 7, 26, 25, 21, 37],
-    // }
     ]
   };
   
@@ -367,6 +357,8 @@ function initChartbt1(y,mdName){
     },
     yAxis: {
       type: 'value',
+      name: '单位:次', 
+      minInterval: 1, 
       splitLine: { show: false }
     },
     series: [
@@ -407,6 +399,9 @@ function initChartbt2(y){
     },
     yAxis: {
       type: 'value',
+      name: '单位:次', 
+      minInterval: 1, 
+      nameLocation: 'end', 
       splitLine: { show: false }
     },
     series: [

+ 3 - 3
ruoyi-ui/src/views/platform/plugin/index.vue

@@ -509,7 +509,7 @@
           </el-tabs>
         </el-dialog>
         <el-dialog  @close="clearForm" v-model="dialogVisiblePei" width="70%" title="参数配置">
-          <el-tabs v-model="activeName" type="border-card">
+          <el-tabs v-model="activeName" type="border-card" style="height: 45vh;">
             <el-tab-pane label="基本信息" name="first">
               <el-descriptions title="" :column="3" style="margin-top: 0%;margin-left: 1%;background: transparent;">
                 <el-descriptions-item label="模型名称:">{{formJi.name}}</el-descriptions-item>
@@ -527,7 +527,7 @@
                 <el-descriptions-item label="联系方式:">{{formJi.devContact}}</el-descriptions-item>
               </el-descriptions>
             </el-tab-pane>
-            <el-tab-pane label="模型参数" style="height: 50vh;" :key="activeTabKey">
+            <el-tab-pane label="模型参数" style="height: 45vh;" :key="activeTabKey">
               <div style="display: flex;justify-content: space-between;margin-right: 2%;align-items: center;background-color: #e9e9eb;;width: 100%;">
                 <div style="display: flex;align-items: center;margin-left: 1%;">
                   <el-checkbox v-model="checked1" label="参数是否分组" size="large"  @change="gatherTable"/>
@@ -802,7 +802,7 @@ const tableData3 = ref([
   { date1:'水库', date2:'', date3:'single', date4:'基于水文响应' },
   { date1:'雨量站', date2:'', date3:'single', date4:'基于水文响应' }
 ]);
-const checked1 = ref(false)
+const checked1 = ref(true)
 const tableData1= [{date1:'初始状态',
   date2:'sts',
   date3:'数据项',

+ 2 - 2
ruoyi-ui/src/views/platform/plugin/peizhi.vue

@@ -509,7 +509,7 @@
           </el-tabs>
         </el-dialog>
         <el-dialog  @close="clearForm" v-model="dialogVisiblePei" width="70%" title="参数配置">
-          <el-tabs v-model="activeName" type="border-card">
+          <el-tabs v-model="activeName" type="border-card" style="height: 45vh;">
             <el-tab-pane label="基本信息" name="first">
               <el-descriptions title="" :column="3" style="margin-top: 0%;margin-left: 1%;background: transparent;">
                 <el-descriptions-item label="模型名称:">{{formJi.name}}</el-descriptions-item>
@@ -802,7 +802,7 @@ const tableData3 = ref([
   { date1:'水库', date2:'', date3:'single', date4:'基于水文响应' },
   { date1:'雨量站', date2:'', date3:'single', date4:'基于水文响应' }
 ]);
-const checked1 = ref(false)
+const checked1 = ref(true)
 const tableData1= [{date1:'初始状态',
   date2:'sts',
   date3:'数据项',

+ 8 - 6
ruoyi-ui/src/views/register/componentReg/index.vue

@@ -512,8 +512,8 @@
           </el-tabs>
         </el-dialog>
         <el-dialog  @close="clearForm" v-model="dialogVisiblePei" width="70%" title="参数配置">
-          <el-tabs v-model="activeName" type="border-card">
-            <el-tab-pane label="基本信息" name="first">
+          <el-tabs v-model="activeName" type="border-card" style="height: 45vh;">
+            <el-tab-pane label="基本信息" name="first" >
               <el-descriptions title="" :column="3" style="margin-top: 0%;margin-left: 1%;background: transparent;">
                 <el-descriptions-item label="模型名称:">{{formJi.name}}</el-descriptions-item>
                 <el-descriptions-item label="英文名:">{{formJi.enname}}</el-descriptions-item>
@@ -542,7 +542,7 @@
                 </div>
               </div>
               <div style="display: flex;">
-                <div v-if="checked1" style="margin-top:1%;width: 10%;background-color: #F2F6FC;height:45vh;">
+                <div v-if="checked1" style="margin-top:1%;width: 10%;background-color: #F2F6FC;height:32vh;">
                   <el-tree :expand-on-click-node="false" ref="treeRef" :filter-node-method="filterNode" :current-node-key="currentNodeKey" class="treeLeft" 
                     :data="groupTreeData" @node-click="handleNodeClick" node-key="id" style="margin-left: 0%;margin-top: 1%;width: 100%;background-color: transparent;" default-expand-all :key="valueKet">
                         <template #default="{ node, data }">
@@ -583,7 +583,7 @@
                 </div>
                 <div style="width: 90%;flex: 1;">
                   <el-table 
-                style="margin-top: 1%;width: 100%;margin-left: 1%;overflow: auto;"
+                style="margin-top: 1%;width: 100%;margin-left: 1%;overflow: auto;height:32vh;"
                 :data="tableDataCan" 
                 :cell-style="{ textAlign: 'center',padding:'3px 0px' }"
                 :header-cell-style="{ textAlign: 'center', }"
@@ -644,7 +644,9 @@
                 </div>
               </div>
             </el-tab-pane>
-            <el-tab-pane label="模型状态">Role</el-tab-pane>
+            <el-tab-pane label="服务信息" style="height: 50vh;" :key="activeTabKey"> 
+              
+            </el-tab-pane>
           </el-tabs>
           <template #footer>
           <span class="dialog-footer">
@@ -937,7 +939,7 @@ const tableData3 = ref([
   { date1:'水库', date2:'', date3:'single', date4:'基于水文响应' },
   { date1:'雨量站', date2:'', date3:'single', date4:'基于水文响应' }
 ]);
-const checked1 = ref(false)
+const checked1 = ref(true)
 const tableData1= [{date1:'初始状态',
   date2:'sts',
   date3:'数据项',

+ 4 - 5
ruoyi-ui/src/views/register/componentReg/peizhi.vue

@@ -508,9 +508,9 @@
             </el-tab-pane>
           </el-tabs>
         </el-dialog>
-        <el-dialog  @close="clearForm" v-model="dialogVisiblePei" width="70%" title="参数配置">
-          <el-tabs v-model="activeName" type="border-card">
-            <el-tab-pane label="基本信息" name="first">
+        <el-dialog  @close="clearForm" v-model="dialogVisiblePei"  width="70%" title="参数配置">
+          <el-tabs v-model="activeName" type="border-card" style="height: 45vh;">
+            <el-tab-pane label="基本信息1" name="first">
               <el-descriptions title="" :column="3" style="margin-top: 0%;margin-left: 1%;background: transparent;">
                 <el-descriptions-item label="模型名称:">{{formJi.name}}</el-descriptions-item>
                 <el-descriptions-item label="英文名:">{{formJi.enname}}</el-descriptions-item>
@@ -641,7 +641,6 @@
                 </div>
               </div>
             </el-tab-pane>
-            <el-tab-pane label="模型状态">Role</el-tab-pane>
           </el-tabs>
           <template #footer>
           <span class="dialog-footer">
@@ -802,7 +801,7 @@ const tableData3 = ref([
   { date1:'水库', date2:'', date3:'single', date4:'基于水文响应' },
   { date1:'雨量站', date2:'', date3:'single', date4:'基于水文响应' }
 ]);
-const checked1 = ref(false)
+const checked1 = ref(true)
 const tableData1= [{date1:'初始状态',
   date2:'sts',
   date3:'数据项',

+ 12 - 47
ruoyi-ui/src/views/service/info/fabu.vue

@@ -1,7 +1,7 @@
 <template>
-    <!-- 审核devkind = 'APP' -->
+    <!-- 发布 = 'APP' -->
   <div style="width: 100%;;display: flex;">
-    <div style="width: 15%;;background-color: #F2F6FC;max-height: 85vh;overflow: auto;">
+    <!-- <div style="width: 15%;;background-color: #F2F6FC;max-height: 85vh;overflow: auto;">
       <div style="display: flex;padding-top: 1%;padding-top: 5%;">
         <el-input
           v-model="inputNode"
@@ -9,10 +9,7 @@
           class="w-50 m-2"
           :prefix-icon="Search" 
         />
-        <!-- <el-button style="margin-left: 2%;width: 10%;background-color: #F7F7F7" :icon="Filter"/> -->
-        <!-- <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 :expand-on-click-node="false" ref="treeRef" :filter-node-method="filterNode" :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  style="justify-content: space-between;display: flex;width: 100%;align-items: center;">
@@ -22,47 +19,11 @@
                   <svg-icon svg-icon icon-class="cate" style="color: red;" v-if="data.nodeType=='TREE'"/>
                 <span>{{ node.label }}</span>
               </div>
-              <!-- <div style="margin-right: 1%;position: absolute;margin-left: 75%;">
-                <el-dropdown trigger="hover" @click.stop v-if="currentNodeKey === data.id&&data.nodeType!=='SERVICE'">
-                    <el-icon class="el-icon--right" style="color: black;">
-                      <plus />
-                    </el-icon>
-                  <template #dropdown>
-                    <el-dropdown-menu>
-                      <el-dropdown-item style="display: flex;" @click="add1Level">
-                        <el-icon class="el-icon--right" style="color: black;">
-                          <CirclePlus />
-                        </el-icon>
-                        <div>
-                          添加同级
-                        </div>
-                      </el-dropdown-item>
-                      <el-dropdown-item style="display: flex;"  @click="addNextLevel">
-                        <el-icon class="el-icon--right" style="color: black;">
-                          <Connection />
-                        </el-icon>
-                        <div>
-                          新建下级
-                        </div>
-                      </el-dropdown-item>
-                      <divider/>
-                      <el-dropdown-item style="display: flex;"  @click="delAll" divided>
-                        <el-icon class="el-icon--right" style="color: black;">
-                          <CircleClose />
-                        </el-icon>
-                        <div>
-                          删除节点
-                        </div>
-                      </el-dropdown-item>
-                    </el-dropdown-menu>
-                  </template>
-                </el-dropdown>
-              </div> -->
             </span>
           </template>
         </el-tree>
-    </div>
-    <div style="width: 84%;margin-left: 1%;padding-top: 0.5%;" class="tab-container">
+    </div> -->
+    <div style="width: 98%;margin-left: 1%;padding-top: 0.5%;" class="tab-container">
       <div>
         <el-table 
           :data="tableData" 
@@ -78,7 +39,7 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="name" label="服务名称"  width="200">
+          <el-table-column prop="name" label="模型名称"  width="200">
           </el-table-column>
           <el-table-column prop="type" label="接口类型"  width="200">
           </el-table-column>
@@ -214,9 +175,12 @@
             </span>
           </template>
         </el-dialog>
-        <el-dialog @close="clearFromLev" title="" v-model="dialogVisibleLevel" width="50%" destroy-on-close :key="tableKey">
+        <el-dialog @close="clearFromLev" title="发布日志" v-model="dialogVisibleLevel" width="50%" destroy-on-close :key="tableKey">
+          <div style="margin-top:0%;font-size: 18px;">
+            {{titleFabu}}
+          </div>
           <el-table 
-          style="margin-top: 1%;width: 98%;min-height: 400px;"
+          style="margin-top: 2%;width: 98%;min-height: 400px;"
           :data="tableDataLog" 
           :cell-style="{ textAlign: 'center',padding:'2px 0' }"
           :header-cell-style="{ textAlign: 'center'}"
@@ -465,7 +429,7 @@ const filterNode = (value, data) => {
   if (!value) return true; // 空搜索时显示所有节点
   return data.label.includes(value); // 检查节点标签是否包含关键字
 };
-
+const titleFabu = ref('')
 const copied = ref(false);
 const parShenhe = ref({})
 
@@ -475,6 +439,7 @@ function showLog(row){
     proId:row.srvId,
     proType:'PUBLISH'
   }
+  titleFabu.value = row.name
   shenheLog(par).then(res=>{
     tableDataLog.value = res.data
   })

+ 35 - 34
ruoyi-ui/src/views/service/info/shenhe.vue

@@ -64,6 +64,7 @@
     </div>
     <div style="width: 84%;margin-left: 1%;padding-top: 0.5%;" class="tab-container">
       <div>
+        <el-button @click="" type="primary" plain  size="mini" style="margin-left: 1%;" :disabled="testAll">审核该模型</el-button>
         <el-table 
           :data="tableData" 
           style="width: 98%;margin-left: 1%;margin-top: 0.5%;"
@@ -79,6 +80,11 @@
             </template>
           </el-table-column>
           <el-table-column prop="name" label="服务名称"  width="200">
+            <template #default="scope">
+              <div style="color: #409EFF;cursor: pointer;" @click="showDe(scope.row)">
+                {{scope.row.name}}
+              </div>
+            </template>
           </el-table-column>
           <el-table-column prop="type" label="接口类型"  width="200">
           </el-table-column>
@@ -97,29 +103,23 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="audit" label="审核状态" width="100">
+          <el-table-column prop="audit" label="测试状态" width="100">
             <template #default="scope">
-              <div style="text-align: center;display: flex;color:#67C23A" v-if="scope.row.audit=='4'">
-                已审核
+              <div style="text-align: center;display: flex;color:#67C23A" v-if="scope.row.senState==1">
+                已测试
               </div>
-              <div style="text-align: center;display: flex;color:#E6A23C" v-if="scope.row.audit=='3'||scope.row.audit==null">
-                未审核
+              <div style="text-align: center;display: flex;color:#F56C6C" v-if="scope.row.senState==0">
+                测试失败
               </div>
-              <div style="text-align: center;display: flex;color:#F56C6C" v-if="scope.row.audit=='0'">
-                驳回
+              <div style="text-align: center;display: flex;color:#E6A23C" v-if="scope.row.senState==null">
+                未测试
               </div>
             </template>
           </el-table-column>
           <el-table-column prop="address" label="操作" width="150">
               <template #default="scope">
-                  <!-- <div style="display: flex;justify-content: space-between;width: 100%;">
-                      <el-button type="danger" text size="mini" style="margin-left: -5%;" @click="handleDelete(scope.row)">注销</el-button>
-                      <el-button @click="showDe(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">查看</el-button>
-                      <el-button @click="testSer(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">测试</el-button>
-                      <el-button @click="testSer(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">审核</el-button>
-                  </div> -->
                   <div style="display: flex;">
-                    <el-button @click="shenhe(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">审核</el-button>
+                    <el-button @click="testSer(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">测试</el-button>
                     <el-button @click="showLog(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">日志</el-button>
                   </div>
               </template>
@@ -217,9 +217,12 @@
             </span>
           </template>
         </el-dialog>
-        <el-dialog @close="clearFromLev" draggable  :title="titleShen" v-model="dialogVisibleLevel" width="50%" destroy-on-close :key="tableKey">
+        <el-dialog @close="clearFromLev" draggable  title="审核日志" v-model="dialogVisibleLevel" width="50%" destroy-on-close :key="tableKey">
+          <div style="margin-top:0%;font-size: 18px;">
+            {{titleShen}}
+          </div>
           <el-table 
-          style="margin-top: 1%;width: 98%;min-height: 400px;"
+          style="margin-top: 2%;width: 98%;min-height: 400px;height: 40vh;"
           :data="tableDataLog" 
           :cell-style="{ textAlign: 'center',padding:'2px 0' }"
           :header-cell-style="{ textAlign: 'center'}"
@@ -267,6 +270,7 @@ import 'vue-json-viewer/style.css'
 import  JsonEditorVue from 'json-editor-vue3'
 import { cloneDeep } from 'lodash'
 import { useClipboard } from "@vueuse/core";
+import { fa } from "element-plus/es/locales.mjs";
 
 const { proxy } = getCurrentInstance();
 const tableDataLog = ref([])
@@ -391,6 +395,7 @@ const tableDataCanAdd = ref([
       paramNote:''
     }
 ])
+const testAll = ref(true)
 const formZu = ref({
   itemName:'',
   itemTp:'',
@@ -701,23 +706,6 @@ function showAdd(){
   dialogVisible.value = true
 }
 async function handleNodeClick(node,data,event){
-  // parTree.value = data.data
-  // currentNodeKey.value = data.data.id
- 
-  // isEdit.value = false
-  // parId.value = data.data
-  // await getSerDe(data.data.id).then(res=>{
-  //   if(res.data.ptService){
-  //     detail.value = res.data.ptService
-  //     tableDataCan.value = res.data.list
-  //     dataReturn.value = res.data.returnList
-  //     console.log(tableDataCan.value)
-  //     dataJsonXiang.value = res.data.ptService.rpcontent
-  //     formJi.value = res.data.ptService
-  //     example.value = res.data.ptService.example
-  //   }
-    
-  // })
   parMdid.value = data.data.id
   var par = {
     mdid:data.data.id
@@ -726,7 +714,19 @@ async function handleNodeClick(node,data,event){
   await getServiceInfo(par).then(res=>{
     if(res.data){
       tableData.value = res.data.serviceList
-      
+      const allright = true
+      tableData.value.forEach(item=>{
+        if(item.senState!==1){
+          allright = false
+        }
+      })
+      if(parMdid.value&&allright){
+        testAll.value = true
+      }
+      else{
+        testAll.value = false
+
+      }
     }
   })
   parOptions.value.forEach(option => {
@@ -736,6 +736,7 @@ async function handleNodeClick(node,data,event){
   console.log(parOptions.value)
   for(var i = 0; i < parOptions.value.length; i++){
     for(var i1 = 0; i1 < tableData.value.length; i1++){
+      console.log(i1);
       if(parOptions.value[i].value === tableData.value[i1].cateCode){
          tableData.value[i1].cateCode = parOptions.value[i].label
       }

+ 5 - 25
ruoyi-ui/src/views/service/info/test.vue

@@ -117,12 +117,6 @@
           </el-table-column>
           <el-table-column prop="address" label="操作" width="150">
               <template #default="scope">
-                  <!-- <div style="display: flex;justify-content: space-between;width: 100%;">
-                      <el-button type="danger" text size="mini" style="margin-left: -5%;" @click="handleDelete(scope.row)">注销</el-button>
-                      <el-button @click="showDe(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">查看</el-button>
-                      <el-button @click="testSer(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">测试</el-button>
-                      <el-button @click="testSer(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">审核</el-button>
-                  </div> -->
                   <div style="display: flex;">
                     <el-button @click="testSer(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">测试</el-button>
                     <el-button @click="showLog(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">日志</el-button>
@@ -239,9 +233,12 @@
             </span>
           </template>
         </el-dialog>
-        <el-dialog @close="clearFromLev" :title="titleTest" draggable v-model="dialogVisibleLevel" width="50%" destroy-on-close :key="tableKey">
+        <el-dialog @close="clearFromLev" title="测试日志" draggable v-model="dialogVisibleLevel" width="50%" destroy-on-close :key="tableKey">
+          <div style="margin-top:0%;font-size: 18px;">
+            {{titleTest}}
+          </div>
           <el-table 
-            style="margin-top: 1%;width: 98%;"
+            style="margin-top: 2%;width: 98%;height: 40vh;"
             :data="tableDataLog" 
             :cell-style="{ textAlign: 'center',padding:'2px 0' }"
             :header-cell-style="{ textAlign: 'center'}"
@@ -758,23 +755,6 @@ function showAdd(){
   dialogVisible.value = true
 }
 async function handleNodeClick(node,data,event){
-  // parTree.value = data.data
-  // currentNodeKey.value = data.data.id
- 
-  // isEdit.value = false
-  // parId.value = data.data
-  // await getSerDe(data.data.id).then(res=>{
-  //   if(res.data.ptService){
-  //     detail.value = res.data.ptService
-  //     tableDataCan.value = res.data.list
-  //     dataReturn.value = res.data.returnList
-  //     console.log(tableDataCan.value)
-  //     dataJsonXiang.value = res.data.ptService.rpcontent
-  //     formJi.value = res.data.ptService
-  //     example.value = res.data.ptService.example
-  //   }
-    
-  // })
   console.log(data)
   titleTest.value = data.data.label
   parMdid.value = data.data.id

+ 92 - 50
ruoyi-ui/src/views/standardization/modeling/index.vue

@@ -981,7 +981,7 @@ function testOne(){
 const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
 async function startTest(){
   messages.value = []
-  ws.value = new WebSocket('ws://127.0.0.1:8082/websocket/message'); // 替换为你的 WS 地址
+  ws.value = new WebSocket('ws://127.0.0.1:8082/websocket/message'); 
   
   ws.value.onopen = () => {
     connected.value = true;
@@ -1022,9 +1022,7 @@ async function startTest(){
           item.data.outputDefs = paramEnd 
         }
       })
-      
       var a = JSON.parse(JSON.stringify(toObject()))
-      console.log(a)
       a.nodes.forEach(item=>{
         if(item.id==='1'){
           item.type = 'startNode'
@@ -1052,14 +1050,11 @@ async function startTest(){
               type: 'success'
           });
           dialogVisibleSart.value = true
-          // outputData.value = JSON.stringify(res.data)
           outputData.value = beautify(res.data, null, 2, 80)
           ws.value.close()
           ws.value = null
         }
       })
-      // connect()
-      
     }
     else if(tableDataCanStart.value.length===0){
       proxy.$message({
@@ -1241,7 +1236,96 @@ function deepToRaw(obj) {
   return obj;
 }
 
-function saveFlow(){
+async function saveFlow(){
+  if(tableDataCanStart.value.length>0&&tableDataCanEnd.value.length>0){
+    if(isAdd.value){
+      tableDataCanStart.value.forEach(item=>{
+      var par = {
+        name:item.name,
+        dataType:item.dataType,
+        refType:'input',
+        description:item.description,
+        required:item.required
+      }
+      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 = 'serviceNode'
+      }
+    })
+      const count = computed(() => store.getters.id)
+      var par = {
+        appId: count.value,
+        flowName:'default',
+        flowGraph: JSON.stringify(a)
+      }
+      addModelingFlow(par).then(res=>{
+        if(res.code===200){
+          proxy.$message({
+            message: '保存成功',
+            type: 'success'
+          });
+        }
+        getList()
+      })
+    }
+    else{
+      const count = computed(() => store.getters.id)
+      var par = {
+        flowId: parFlowId.value,
+        appId: count.value,
+        flowName:'default',
+        flowGraph: JSON.stringify(a)
+      }
+      console.log(par)
+      editModelingFlow(par).then(res=>{
+        if(res.code===200){
+          proxy.$message({
+            message: '保存成功',
+            type: 'success'
+          });
+          getList()
+        }
+      }) 
+    }
+  }
+  else if(tableDataCanStart.value.length===0){
+    proxy.$message({
+        message: '请设置输入值!',
+        type: 'warning'
+    });
+  }
+  else if(tableDataCanEnd.value.length===0){
+    proxy.$message({
+        message: '请设置输出值!',
+        type: 'warning'
+    });
+  }
   var parFlow = toRaw(toObject())
   parFlow.nodes.forEach(item => {
     if(item.id==='1'){
@@ -1251,51 +1335,11 @@ function saveFlow(){
     if(item.id==='2'){
       item.type='endNode'
       item.data.parameters = tableDataCanEnd.value;
-      // item.data.parameters.splice(0, 0, ...tableDataCanEnd.value);   
-      console.log(item)     
-      // item.data.parameters.splice(0, item.data.parameters.length, ...tableDataCanEnd.value);
-      // item.data.parameters = JSON.parse(JSON.stringify(item.data.parameters))
+      console.log(item)
     }
     item.title = item.label
   });
   
-  // console.log(JSON.parse(JSON.stringify(parFlow)))
-  if(isAdd.value){
-    const count = computed(() => store.getters.id)
-    var par = {
-      appId: count.value,
-      flowName:'default',
-      flowGraph: JSON.stringify(parFlow)
-    }
-    addModelingFlow(par).then(res=>{
-      if(res.code===200){
-        proxy.$message({
-          message: '保存成功',
-          type: 'success'
-        });
-      }
-      getList()
-    })
-  }
-  else{
-    const count = computed(() => store.getters.id)
-    var par = {
-      flowId: parFlowId.value,
-      appId: count.value,
-      flowName:'default',
-      flowGraph: JSON.stringify(parFlow)
-    }
-    console.log(par)
-    editModelingFlow(par).then(res=>{
-      if(res.code===200){
-        proxy.$message({
-          message: '保存成功',
-          type: 'success'
-        });
-        getList()
-      }
-    }) 
-  }
 }
 function getPredecessorsNodes(nodeId, edges = getEdges.value, allNodes = getNodes.value){
   // 1. 找到所有直接指向目标节点的边(即 target 为 nodeId 的边)
@@ -1649,8 +1693,6 @@ watch(messages, (newMessages) => {
       }
     })
   })
-  console.log(nodes.value)
-  console.log('当前节点列表:', newMessages) // 实时输出最新数据
 }, { deep: true })
 // watch(nodes, (newNodes) => {
 //   console.log('当前节点列表:', newNodes) // 实时输出最新数据