Hua 3 місяців тому
батько
коміт
6d5906f934

+ 2 - 2
ruoyi-ui/.env.development

@@ -10,8 +10,8 @@ VITE_APP_BASE_Title = '/sh'
 # 若依管理系统/生产环境
 VITE_APP_BASE_API = '/sh-api'
 
-VITE_DEV_PATH = 'http://localhost:8082'
-#VITE_DEV_PATH = 'http://39.98.38.2:18082/sh-api'
+# VITE_DEV_PATH = 'http://localhost:8082'
+VITE_DEV_PATH = 'http://192.168.2.119:8082'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip

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

@@ -301,4 +301,11 @@ export function getYinqing(query) {
     method: "get",
     params: query,
   });
+}
+export function serState(query) {
+  return request({
+    url: "/pt/service/state",
+    method: "get",
+    params: query,
+  });
 }

+ 39 - 6
ruoyi-ui/src/views/evaluate/index.vue

@@ -66,7 +66,7 @@
             </el-card>
           </div>
         </div>
-        <div style="margin-left: 1%;width: 98%;display: flex;margin-top: 1%;height: 38vh;">
+        <div style="margin-left: 1%;width: 98%;display: flex;margin-top: 1%;height: 45vh;">
           <el-card shadow="always" class="box-card" style="width:50%;height: 100%;">
             <div style="margin-left: 1%;font-weight: bold;">
               模型每月服务调度次数统计
@@ -126,7 +126,7 @@
                     />
                 </el-select> -->
             </div>
-            <div id="bt2"  style="width: 100%;margin-left: 1%;margin-top: -1%;height: 28vh;">
+            <div id="bt2"  style="width: 100%;margin-left: 1%;margin-top: -1%;height: 35vh;">
 
             </div>
           </el-card>
@@ -318,9 +318,20 @@ function inintChartTop1(x,y,mdName){
     },
     yAxis: {
       type: 'value',
+      show: true,
       splitLine: { show: false },
       name: '单位:次', 
       minInterval: 1, 
+      axisTick: {
+        show: true // 确保显示刻度线
+      },
+       axisLine: {
+        show: true, // 确保显示轴线
+        lineStyle: {
+          color: '#333', // 可以设置轴线的颜色,例如与文字颜色一致
+          // width: 1 // 可以设置轴线宽度,可选
+        }
+      },
     },
     series: [
       {
@@ -356,9 +367,20 @@ function initChartbt1(y,mdName){
     },
     yAxis: {
       type: 'value',
+      show: true,
       name: '单位:次', 
       minInterval: 1, 
-      splitLine: { show: false }
+      splitLine: { show: false },
+      axisTick: {
+        show: true // 确保显示刻度线
+      },
+       axisLine: {
+        show: true, // 确保显示轴线
+        lineStyle: {
+          color: '#333', // 可以设置轴线的颜色,例如与文字颜色一致
+          // width: 1 // 可以设置轴线宽度,可选
+        }
+      },
     },
     series: [
       {
@@ -391,7 +413,7 @@ function initChartbt2(y){
       rotate: -25,   // 旋转角度,正值表示顺时针旋转,负值表示逆时针旋转
       // 可以设置文字样式,如字体大小、颜色等
       textStyle: {
-        fontSize: 8,
+        fontSize: 10,
         color: '#333'
       }
     }
@@ -400,8 +422,19 @@ function initChartbt2(y){
       type: 'value',
       name: '单位:次', 
       minInterval: 1, 
+      show: true,
       nameLocation: 'end', 
-      splitLine: { show: false }
+      splitLine: { show: false },
+      axisTick: {
+        show: true // 确保显示刻度线
+      },
+       axisLine: {
+        show: true, // 确保显示轴线
+        lineStyle: {
+          color: '#333', // 可以设置轴线的颜色,例如与文字颜色一致
+          // width: 1 // 可以设置轴线宽度,可选
+        }
+      },
     },
     series: [
       {
@@ -456,7 +489,7 @@ async function getTreeLeft(){
     }
   }
   await modelTreeSelect(par).then(res=>{
-    optionsModel.value = res.data
+    optionsModel.value = res.data[0].children
     valueMod.value = optionsModel.value[0].id
     valueModMon.value = optionsModel.value[0].id
     valueMon.value = getFirstDayOfYear()

+ 7 - 7
ruoyi-ui/src/views/evaluate/quality.vue

@@ -26,11 +26,11 @@
         v-model="activeName"
         type="card"
         class="demo-tabs"
-        @tab-click="getQualityList"
-        >
-            <el-tab-pane label="周" name="first"></el-tab-pane>
-            <el-tab-pane label="月" name="second"></el-tab-pane>
-            <el-tab-pane label="年" name="third"></el-tab-pane>
+        @tab-change="getQualityList"
+        >   
+        <el-tab-pane label="年" name="third"></el-tab-pane>
+        <el-tab-pane label="月" name="second"></el-tab-pane>
+        <el-tab-pane label="周" name="first"></el-tab-pane>
         </el-tabs>
         <el-table 
           :data="tableData" 
@@ -295,8 +295,8 @@ function setDate(){
   timeMon.value = getFirstDayOfMonthShort()
   timeYear.value = getFirstDayOfYear()
 }
-function getQualityList(){
-  
+function getQualityList(val){
+  console.log('val',val)
   var par = {
     devkind:'APP',
     params:{

+ 2 - 2
ruoyi-ui/src/views/evaluate/score.vue

@@ -104,14 +104,14 @@
                     </el-popover>
                   </template>
                 </el-table-column>
-                <el-table-column prop="address" label="操作" width="150">
+                <!-- <el-table-column prop="address" label="操作" width="150">
                   <template #default="scope">
                       <div style="display: flex;">
                         <el-button @click="editLog(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">修改</el-button>
                         <el-button @click="delLogList(scope.row)" type="danger" text size="mini" style="margin-left: 0%;">删除</el-button>
                       </div>
                   </template>
-                </el-table-column>
+                </el-table-column> -->
             </el-table>
           <template #footer>
               <span class="dialog-footer">

+ 8 - 6
ruoyi-ui/src/views/evaluate/xiaolv.vue

@@ -26,11 +26,13 @@
         v-model="activeName"
         type="card"
         class="demo-tabs"
-        @tab-click="getEfficiencyList"
-        >
-            <el-tab-pane label="周" name="first"></el-tab-pane>
-            <el-tab-pane label="月" name="second"></el-tab-pane>
-            <el-tab-pane label="年" name="third"></el-tab-pane>
+        @tab-change="getEfficiencyList"
+        >   
+          <el-tab-pane label="年" name="third"></el-tab-pane>
+          <el-tab-pane label="月" name="second"></el-tab-pane>
+          <el-tab-pane label="周" name="first"></el-tab-pane>
+              
+            
         </el-tabs>
         <el-table 
           :data="tableData" 
@@ -212,7 +214,7 @@ import { getEfficiency } from "@/api/service/info";
 
 const timeMon = ref('')
 const timeYear = ref('')
-const activeName = ref('first')
+const activeName = ref('third')
 const tableData = ref ([])
 
 function getWeekRange(date = new Date()) {

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

@@ -178,7 +178,7 @@ function reset() {
     leader: undefined,
     phone: undefined,
     email: undefined,
-    status: "0"
+    status: "1"
   };
   proxy.resetForm("deptRef");
 }

+ 154 - 32
ruoyi-ui/src/views/register/componentReg/index.vue

@@ -53,9 +53,11 @@
         <el-table-column prop="audit" label="审核状态" width="140">
           <template #default="scope">
             <div>
-              <div v-if="scope.row.audit === '0'||scope.row.audit === null" style="color:#909399">待审核</div>
+              <div v-if="scope.row.audit === null||scope.row.audit === ''" style="color:#E6A23C">待申请</div>
+              <div v-if="scope.row.audit === '0'" style="color:#909399">待审核</div>
               <div v-else-if="scope.row.audit === '1'" style="color: #67C23A">审核通过</div>
               <div v-else-if="scope.row.audit === '2'" style="color: #F56C6C">驳回</div>
+              <div v-else-if="scope.row.audit === '3'" style="color: #F56C6C">更新审核</div>
             </div>
           </template>
         </el-table-column>
@@ -64,10 +66,11 @@
             <div>
               <div v-if="scope.row.publish === '0'||scope.row.publish === null" style="color:#909399">未发布</div>
               <div v-else-if="scope.row.publish === '1'" style="color: #67C23A">已发布</div>
+              <div v-else-if="scope.row.publish === '3'" style="color: #F56C6C">更新发布</div>
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="modifyBy" label="发布时间" width="170"/>
+        <el-table-column prop="modifyby" label="注册时间" width="170"/>
         <el-table-column prop="version" label="版本" width="120"/>
         <el-table-column prop="address" label="操作" width="270">
             <template #default="scope">
@@ -77,7 +80,7 @@
                     <!-- <el-button @click="showDe(scope.row)" type="primary" text size="mini" style="margin-left: -5%;">查看</el-button> -->
                     <el-button @click="showPei(scope.row)" type="warning" text size="mini" style="margin-left: -5%;">配置</el-button>
                     <el-button type="danger" @click="delModel(scope.row)" text size="mini" style="margin-left: -5%;">删除</el-button>
-                    <el-button v-if="scope.row.audit === '0'||scope.row.audit === null" type="info" @click="shenhe(scope.row)" text size="mini" style="margin-left: -5%;">审核申请</el-button>
+                    <el-button v-if="scope.row.audit === null||scope.row.audit === '2'||scope.row.audit === ''" type="info" @click="shenhe(scope.row)" text size="mini" style="margin-left: -5%;">审核申请</el-button>
                 </div>
             </template>
         </el-table-column>
@@ -545,7 +548,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: ;" :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"/>
@@ -736,7 +739,7 @@
                         style="width: 100%;margin-left: 0%;"
                     >
                       <el-option
-                          v-for="item in optionsType"
+                          v-for="item in optionsJieType"
                           :key="item.value"
                           :label="item.label"
                           :value="item.value"
@@ -754,12 +757,12 @@
               <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>
+                    <!-- <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"
+                        <el-option v-for="item in gatewayRouters" :key="item.id" :label="item.uri"
                                    :value="item.predicates"/>
                       </el-select>
-                    </template>
+                    </template> -->
                   </el-input>
                 </el-form-item>
               </el-col>
@@ -964,7 +967,7 @@
         </div>
         <template #footer>
                   <span class="dialog-footer">
-                    <el-button size="mini" @click="dialogVisible = false">取消</el-button>
+                    <el-button size="mini" @click="dialogVisibleSer = false">取消</el-button>
                     <el-button type="primary" v-if="isAddser" @click="addSer" size="mini">
                       提交
                     </el-button>
@@ -1138,7 +1141,7 @@
               {{ 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>
+            <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;">
             请求参数
@@ -1184,6 +1187,7 @@ import { getModelList,addModel,delMdid,getModelDetail,updateModel,
 import {getServiceInfo,addService,modelTreeSelect,getSerDe,delService,testService,
   addServiceParam,editService} from "@/api/service/info";
 import { ref, onMounted, onUnmounted, nextTick } from 'vue';
+import {getGatewayRouters} from "@/api/gateway/gatewayRouters.js";
 import { Search } from '@element-plus/icons-vue'
 import {
   ArrowLeft,
@@ -1398,6 +1402,24 @@ let tableData = ref([{name:'1'}])
 const heightAll = window.innerHeight
 const valueHelpSel = '';
 const tableheight = window.innerHeight*0.8
+const optionsJieType =ref([
+  {
+    value: 'RESTful',
+    label: 'RESTful',
+  },
+  {
+    value: 'WebService',
+    label: 'WebService',
+  },
+  {
+    value: 'HTTP',
+    label: 'HTTP',
+  },
+  {
+    value: 'WebSocket',
+    label: 'WebSocket',
+  },
+])
 const optionsType = [
   {
     value: '1',
@@ -1506,10 +1528,15 @@ function getChineseInitials(str) {
     });
     return result.join('');
 }
+function getGate(){
+  getGatewayRouters().then(res => {
+    gatewayRouters.value = res.data
+  })
+}
 function shenhe(row){
   var par = {
     mdid:row.mdid,
-    audit:'2',
+    audit:'0',
     devkind:'APP'
   }
   changeShenhe(par).then(res=>{
@@ -1569,16 +1596,36 @@ async function saveEditService() {
         if (res.code === 200) {
           var parCan = tableDataCanAdd.value
           if(parCan.length!== 0){
-            parCan.forEach(item => {
-                item.srvId = parId.value
-              });
-              addServiceParam(parCan).then(res1 => {
-              if (res1.code === 200) {
-                proxy.$modal.msgSuccess("修改成功");
-                dialogVisibleSer.value = false
-                showPei(parRow.value)
+            var parRule = true
+            parCan.forEach((item, index) => {
+              item.srvId = res.data.srvId
+              if(item.paramCode&&item.paramType&&item.paramName){
+                item.parRule = true
+              }
+              else{
+                item.parRule = false
+              }
+              if (item.paramName === '') {
+                parCan.splice(index, 1)
+              }
+            });
+            parCan.forEach((item, index) => {
+              if(item.parRule===false){
+                parRule = false
               }
             })
+            if(parRule){
+              addServiceParam(parCan).then(res1 => {
+                if (res1.code === 200) {
+                  proxy.$modal.msgSuccess("修改成功");
+                  dialogVisibleSer.value = false
+                  showPei(parRow.value)
+                }
+              })
+            }
+            else{
+              proxy.$modal.msgError("请填写必填项!");
+            }
           }
           else{
             proxy.$modal.msgSuccess("修改成功");
@@ -1607,12 +1654,10 @@ function clearAdd(){
   exampleAdd.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
@@ -1622,26 +1667,72 @@ async function addSer() {
       if (res.code === 200) {
         var parCan = tableDataCanAdd.value
         if (tableDataCanAdd.value.length !== 0) {
+          var parRule = true
           parCan.forEach((item, index) => {
             item.srvId = res.data.srvId
+            if(item.paramCode&&item.paramType&&item.paramName){
+              item.parRule = true
+            }
+            else{
+              item.parRule = false
+            }
             if (item.paramName === '') {
               parCan.splice(index, 1)
             }
           });
-          addServiceParam(parCan).then(res1 => {
-            if (res1.code === 200) {
-              proxy.$modal.msgSuccess("新增成功");
-              dialogVisibleSer.value = false
-              showPei(parRow.value)
+          parCan.forEach((item, index) => {
+            if(item.parRule===false){
+              parRule = false
             }
           })
+          if(parRule){
+            addServiceParam(parCan).then(res1 => {
+              if (res1.code === 200) {
+                proxy.$modal.msgSuccess("新增成功");
+                dialogVisibleSer.value = false
+                showPei(parRow.value)
+              }
+            })
+          }
+          else{
+            proxy.$modal.msgError("请填写必填项!");
+          }
         }
 
       }
     })
   }
-
 }
+// if(tableDataCanAll.value.length>0){
+//     var parRule = true
+//     tableDataCanAll.value.forEach((item, index, array) => { 
+//       item.mdid = parForm.value.mdid
+//       item.parCate = 'int'
+//       if(item.parDefVal&&item.parType&&item.parName&&item.parEnname){
+//         item.parRule = true
+//       }
+//       else{
+//         item.parRule = false
+//       }
+//     })
+//     tableDataCanAll.value.forEach((item, index, array) => { 
+//       if(item.parRule===false){
+//         parRule = false
+//       }
+//     })
+//     if(parRule === true){
+//       changePar(tableDataCanAll.value).then(res=>{
+//         if(res.code===200){
+//           proxy.$modal.msgSuccess("修改成功");
+//           dialogVisiblePei.value = false
+//           getModelListTable()
+//         }
+//       })
+//     }
+//     else{
+//       proxy.$modal.msgError("请填写必填项!");
+//     }
+//   }
 function handleBlur(){
   formTree.value.parGroupCode = getChineseInitials(formTree.value.parGroupName)
 }
@@ -1796,17 +1887,34 @@ function saveChangePar(){
     })
   }
   if(tableDataCanAll.value.length>0){
+    var parRule = true
     tableDataCanAll.value.forEach((item, index, array) => { 
       item.mdid = parForm.value.mdid
       item.parCate = 'int'
+      if(item.parDefVal&&item.parType&&item.parName&&item.parEnname){
+        item.parRule = true
+      }
+      else{
+        item.parRule = false
+      }
     })
-    changePar(tableDataCanAll.value).then(res=>{
-      if(res.code===200){
-        proxy.$modal.msgSuccess("修改成功");
-        dialogVisiblePei.value = false
-        getModelListTable()
+    tableDataCanAll.value.forEach((item, index, array) => { 
+      if(item.parRule===false){
+        parRule = false
       }
     })
+    if(parRule === true){
+      changePar(tableDataCanAll.value).then(res=>{
+        if(res.code===200){
+          proxy.$modal.msgSuccess("修改成功");
+          dialogVisiblePei.value = false
+          getModelListTable()
+        }
+      })
+    }
+    else{
+      proxy.$modal.msgError("请填写必填项!");
+    }
   }
   else{
     var par = {
@@ -1822,6 +1930,7 @@ function saveChangePar(){
   }
 }
 async function showPei(row){
+  tableDataSer.value = []
   dialogVisiblePei.value = true
   parRow.value = row
   var par = {
@@ -2167,6 +2276,15 @@ function filterModelNodes(nodes) {
   }
   return result;
 }
+function maskString(str) {
+    if (!str || str.length <= 6) {
+        return str;
+    }
+    
+    return str.replace(/^(.{3})(.*)(.{3})$/, (_, first, middle, last) => {
+        return first + '*'.repeat(middle.length) + last;
+    });
+}
 function getModelListTable(){
   tableData.value = [] 
   var par = {
@@ -2180,11 +2298,15 @@ function getModelListTable(){
     tableData.value = res.rows
     totalComReg.value = res.total
     formJi.value.sort = res.total+1
+    tableData.value.forEach((item,index,array)=>{
+      item.mdContact = maskString(item.mdContact)
+    })
   })
 }
 const seledMo = ['primary','plain','plain','plain','plain','plain','plain']
 onMounted(() => {
   getTreeLeft()
+  getGate()
 });
 </script>
 <style scoped>

+ 26 - 10
ruoyi-ui/src/views/register/componentReg/peizhi.vue

@@ -50,19 +50,34 @@
         <el-table-column prop="type" label="模型类型" width="160"/>
         <el-table-column prop="mdUnit" label="模型单位" width="220"/>
         <el-table-column prop="mdContact" label="联系方式" width="150"/>
-        <el-table-column prop="status" label="模型状态" width="140">
+        <el-table-column prop="audit" label="审核状态" width="140">
+          <template #default="scope">
+            <div>
+              <div v-if="scope.row.audit === '0'||scope.row.audit === null" style="color:#909399">待审核</div>
+              <div v-else-if="scope.row.audit === '1'" style="color: #67C23A">审核通过</div>
+              <div v-else-if="scope.row.audit === '2'" style="color: #F56C6C">驳回</div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="status" label="发布状态" width="140">
+          <template #default="scope">
+            <div>
+              <div v-if="scope.row.publish === '0'||scope.row.publish === null" style="color:#909399">未发布</div>
+              <div v-else-if="scope.row.publish === '1'" style="color: #67C23A">已发布</div>
+            </div>
+          </template>
         </el-table-column>
         <el-table-column prop="modifyBy" label="发布时间" width="170"/>
         <el-table-column prop="version" label="版本" width="120"/>
-        <el-table-column prop="address" label="操作" width="270">
+        <el-table-column prop="address" label="操作" width="100">
             <template #default="scope">
                 <div style="display: flex;justify-content: space-between;width: 100%;">
                     <!-- <el-button type="primary" @click="showEdit(scope.row)" size="mini" text style="margin-left: 0%;">编辑</el-button> -->
                     <!-- <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: -5%;">查看</el-button> -->
-                    <el-button @click="showPei(scope.row)" type="warning" text size="mini" style="margin-left: -5%;">配置</el-button>
+                    <el-button @click="showPei(scope.row)" type="warning" text size="mini" style="margin-left: 1%;">配置</el-button>
                     <!-- <el-button type="danger" @click="delModel(scope.row)" text size="mini" style="margin-left: -5%;">删除</el-button>
-                    <el-button type="danger" @click="shenhe(scope.row)" text size="mini" style="margin-left: -5%;">审核申请</el-button> -->
+                    <el-button v-if="scope.row.audit === '0'||scope.row.audit === null" type="info" @click="shenhe(scope.row)" text size="mini" style="margin-left: -5%;">审核申请</el-button> -->
                 </div>
             </template>
         </el-table-column>
@@ -511,7 +526,7 @@
             </el-tab-pane>
           </el-tabs>
         </el-dialog>
-        <el-dialog  @close="clearForm" v-model="dialogVisiblePei" width="70%" title="参数配置">
+        <el-dialog  @close="clearForm" v-model="dialogVisiblePei" width="70%" title="模型配置">
           <el-tabs v-model="activeName" type="border-card" style="height: 50vh;">
             <el-tab-pane label="基本信息" name="first" >
               <el-descriptions title="" :column="3" style="margin-top: 0%;margin-left: 1%;background: transparent;">
@@ -530,7 +545,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: " :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"/>
@@ -644,7 +659,7 @@
                 </div>
               </div>
             </el-tab-pane>
-            <el-tab-pane label="服务信息" style="height: 50vh;" :key="activeTabKey"> 
+            <el-tab-pane label="服务信息" style="" :key="activeTabKey"> 
               <el-button @click="showAddSer" type="primary" plain size="mini" style="margin-left: 1%;">新增服务</el-button>
               <el-table 
                 :data="tableDataSer"
@@ -949,7 +964,7 @@
         </div>
         <template #footer>
                   <span class="dialog-footer">
-                    <el-button size="mini" @click="dialogVisible = false">取消</el-button>
+                    <el-button size="mini" @click="dialogVisibleSer = false">取消</el-button>
                     <el-button type="primary" v-if="isAddser" @click="addSer" size="mini">
                       提交
                     </el-button>
@@ -1493,13 +1508,14 @@ function getChineseInitials(str) {
 }
 function shenhe(row){
   var par = {
-    srvIds:row.mdid,
-    audit:'2',
+    mdid:row.mdid,
+    audit:'0',
     devkind:'APP'
   }
   changeShenhe(par).then(res=>{
     if(res.code===200){
       proxy.$modal.msgSuccess("已可测试!");
+      getModelListTable()
     }
   })
 }

+ 146 - 48
ruoyi-ui/src/views/service/info/editModel.vue

@@ -90,6 +90,11 @@
           </el-table-column>
           <el-table-column prop="name" label="服务名称"  width="200">
           </el-table-column>
+          <el-table-column prop="status" label="状态" width="170">
+            <template #default="scope">
+                <el-switch @change="changejobStatus(scope.row)" v-model="scope.row.state"/>
+            </template>
+        </el-table-column>
           <el-table-column prop="type" label="接口类型"  width="200">
           </el-table-column>
           <el-table-column prop="url" label="接口地址"  show-overflow-tooltip/>
@@ -113,7 +118,7 @@
               <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 type="danger" text size="mini" style="margin-left: -5%;" @click="delSer(scope.row)">注销</el-button>
+                    <el-button type="danger" text size="mini" style="margin-left: -5%;" @click="delSer(scope.row)">删除</el-button>
                   </div>
               </template>
           </el-table-column>
@@ -158,12 +163,12 @@
               <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>
+                    <!-- <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>
+                    </template> -->
                   </el-input>
                 </el-form-item>
               </el-col>
@@ -277,7 +282,7 @@
                   :header-cell-style="{ textAlign: 'center'}"
                   :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center'  }"
                   border>
-                <el-table-column prop="itemName" label="参数字段">
+                <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"
@@ -285,7 +290,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column prop="itemName" label="参数名称">
+                <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"
@@ -293,7 +298,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column prop="itemName" label="参数类型" width="200">
+                <el-table-column prop="itemName" label="参数类型(必填)" width="200">
                   <template #default="scope">
                     <div style="width: 100%;">
                       <el-select
@@ -413,7 +418,7 @@
             :header-cell-style="{ textAlign: 'center'}"
             :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center'  }"
             border>
-          <el-table-column prop="itemName" label="参数字段">
+          <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"
@@ -421,7 +426,7 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="itemName" label="参数名称">
+          <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"
@@ -429,7 +434,7 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="itemName" label="参数类型" width="200">
+          <el-table-column prop="itemName" label="参数类型(必填)" width="200">
             <template #default="scope">
               <div style="width: 100%;">
                 <el-select
@@ -487,7 +492,7 @@
                  :key="tableKey">
         <div style="overflow: auto;height: 80vh;">
         <div style="display: flex;margin-top: 1%;">
-          <!-- <el-button type="primary" @click="saveEditService" style="margin-left: 80%;z-index: 1000;" :disabled="isEdit">
+          <!-- <el-button type="primary" @click="edSer" 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> -->
@@ -785,7 +790,7 @@
         <template #footer>
               <span class="dialog-footer">
                 <el-button size="mini" @click="dialogVisibleSerDe = false">取消</el-button>
-                <el-button type="primary" @click="saveEditService" size="mini">
+                <el-button type="primary" @click="edSer" size="mini">
                   确定
                 </el-button>
             </span>
@@ -809,7 +814,8 @@ import {
   getServiceReturn,
   modelTreeSelect,
   postReturnlist,
-  getServiceInfo
+  getServiceInfo,
+  serState
 } from "@/api/service/info";
 import 'vue-json-viewer/style.css'
 import {cloneDeep} from 'lodash'
@@ -884,12 +890,6 @@ const dataJsonXiang = ref()
 const parTree = ref({})
 const valueKet = ref(0)
 const tableDataCan = ref([
-  {
-    paramName: '',
-    paramCode: '',
-    paramType: '',
-    paramNote: ''
-  }
 ])
 const optionsMdid = ref([])
 const optionsRqtype = ref([
@@ -1019,9 +1019,7 @@ const rulesLev = reactive({
   itemName: [{required: true, message: '必填', trigger: 'blur'}],
 });
 const gatewayRouters = ref([])
-getGatewayRouters().then(res => {
-  gatewayRouters.value = res.data
-})
+
 const formRefLev = ref();
 const cascaderOptions = ref([])
 const props1 = ref({
@@ -1042,7 +1040,25 @@ const copied = ref(false);
 async function delNode() {
   removeNodeById(dataTreeReturn.value, parTreeId.value)
 }
-
+function getGate(){
+  getGatewayRouters().then(res => {
+    gatewayRouters.value = res.data
+  })
+}
+function changejobStatus(row){
+  var par = {
+    state: row.state===true?'1':'0',
+    srvId: row.srvId
+  }
+  serState(par).then(res=>{
+    if(res.code==200){
+      proxy.$message({
+        message: '状态修改成功',
+        type: 'success'
+      });
+    }
+  })
+}
 function removeNodeById(tree, targetId) {
   // 检查树是否为空
   if (!tree || !Array.isArray(tree) || tree.length === 0) {
@@ -1305,7 +1321,10 @@ async function delSer(row) {
   proxy.$modal.confirm('是否确认删除?').then(function () {
     return delService(row.srvId);
   }).then(() => {
-    getTreeLeft();
+    var par1  = {
+      data:{id:parMdid.value}
+    }
+    handleNodeClick(null,par1,null)
     proxy.$modal.msgSuccess("删除成功");
   }).catch(() => {
   });
@@ -1338,7 +1357,7 @@ function getParamName(paramCode) {
   return nameMap[paramCode] || '';
 }
 
-async function saveEditService() {
+async function edSer() {
   var valid
   await formRefJi.value.validate((valid1) => {
     valid = valid1
@@ -1348,7 +1367,6 @@ async function saveEditService() {
     var par = formJi.value
     par.example = example.value
     par.rpcontent = dataJsonXiang.value
-    par.cateCode = par.cateCode[0]
     var validTable = true
     for (const item of tableDataCan.value) {
       if (item.paramCode.length === 0 || item.paramName.length === 0 || item.paramType.length === 0) {
@@ -1361,25 +1379,60 @@ async function saveEditService() {
       await editService(par).then(res => {
         if (res.code === 200) {
           var parCan = tableDataCan.value
-          parCan.forEach(item => {
-            item.srvId = parId.value
-          });
-          addServiceParam(parCan).then(res1 => {
-            if (res1.code === 200) {
-              proxy.$modal.msgSuccess("修改成功");
-              getTreeLeft()
+          if(parCan.length>0){
+            var parRule = true
+            parCan.forEach(item => {
+              item.srvId = parId.value
+              if(item.paramCode&&item.paramType&&item.paramName){
+                item.parRule = true
+              }
+              else{
+                item.parRule = false
+              }
+            });
+            parCan.forEach((item, index) => {
+              if(item.parRule===false){
+                parRule = false
+              }
+            })
+            if(parRule){
+              addServiceParam(parCan).then(res1 => {
+                if (res1.code === 200) {
+                  proxy.$modal.msgSuccess("修改成功");
+                  dialogVisible.value = false
+                  dialogVisibleSerDe.value = false
+                  var par1  = {
+                    data:{id:parMdid.value}
+                  }
+                  handleNodeClick(null,par1,null)
+                    getTreeLeft()
+                  }
+              })
             }
-          })
+            else{
+              proxy.$modal.msgError("请填写必填项!");
+            }
+          }
+          else{
+            dialogVisible.value = false
+            dialogVisibleSerDe.value = false
+            var par1  = {
+              data:{id:parMdid.value}
+            }
+            handleNodeClick(null,par1,null)
+          }
         }
+        
       })
       var par = JSON.parse(JSON.stringify(dataTreeReturn.value))
       var par1 = flattenTreeWithArrayIndex(par)
-      postReturnlist(par1).then(res => {
-        if (res.code === 200) {
-          proxy.$modal.msgSuccess("新增成功");
-          getTreeLeft()
-        }
-      })
+      
+      // postReturnlist(par1).then(res => {
+      //   if (res.code === 200) {
+      //     proxy.$modal.msgSuccess("新增成功");
+      //     getTreeLeft()
+      //   }
+      // })
     }
   }
 }
@@ -1446,30 +1499,58 @@ async function addSer() {
     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
         if (parCan.length !== 0) {
+          var parRule = true
           parCan.forEach((item, index) => {
             item.srvId = res.data.srvId
             if (item.paramName === '') {
               parCan.splice(index, 1)
             }
+            if(item.paramCode&&item.paramType&&item.paramName){
+              item.parRule = true
+            }
+            else{
+              item.parRule = false
+            }
           });
-          addServiceParam(parCan).then(res1 => {
-            if (res1.code === 200) {
-              proxy.$modal.msgSuccess("新增成功");
-              getTreeLeft()
+          parCan.forEach((item, index) => {
+            if(item.parRule===false){
+              parRule = false
             }
           })
+          if(parRule){
+            addServiceParam(parCan).then(res1 => {
+              if (res1.code === 200) {
+                proxy.$modal.msgSuccess("新增成功");
+                dialogVisible.value = false
+                dialogVisibleSerDe.value = false
+                var par1  = {
+                  data:{id:parMdid.value}
+                }
+                handleNodeClick(null,par1,null)
+                getTreeLeft()
+              }
+            })
+          }
+          else{
+            proxy.$modal.msgError("请填写必填项!");
+          }
+        }
+        else{
+          dialogVisible.value = false
+          dialogVisibleSerDe.value = false
+          var par1  = {
+            data:{id:parMdid.value}
+          }
+          handleNodeClick(null,par1,null)
         }
-
       }
     })
 
-
   }
 
 }
@@ -1517,11 +1598,12 @@ async function showDe(row) {
     }
   })
 }
+const parMdid = ref('')
 async function handleNodeClick(node,data,event){
   var par = {
     mdid:data.data.id
   }
-  
+  parMdid.value = data.data.id
   await getServiceInfo(par).then(res=>{
     if(res.data){
       tableDataSer.value = res.data.serviceList
@@ -1529,6 +1611,14 @@ async function handleNodeClick(node,data,event){
     tableDataSer.value.forEach(item => {
       item.modelName = res.data.name;
     });
+    tableDataSer.value.forEach(item=>{
+      if(item.state==='0'||item.state===null){
+        item.state = false
+      }
+      if(item.state==='1'){
+        item.state = true
+      }
+    })
   })
   parOptions.value.forEach(option => {
     option.label = option.cateName;
@@ -1792,11 +1882,17 @@ async function getTreeLeft() {
       devkind:'APP'
     }
   }
+  var firstMdid
   await modelTreeSelect(par).then(res => {
     par = res.data
     data.value = res.data
+    firstMdid = res.data[0].children[0].id
   })
   optionsMdid.value = filterModelNodes(par)
+  var par1  = {
+    data:{id:firstMdid}
+  }
+  handleNodeClick(null,par1,null)
 }
 
 function renameTreeProperties(tree) {
@@ -1895,9 +1991,11 @@ async function getAllSer() {
     });
   })
 }
+
 onMounted(() => {
-  getAllSer()
+  // getAllSer()
   fetchData()
+  getGate()
   getTreeLeft()
 });
 

+ 31 - 22
ruoyi-ui/src/views/service/info/fabu.vue

@@ -41,23 +41,9 @@
           </el-table-column>
           <el-table-column prop="name" label="模型名称"  width="250">
           </el-table-column>
-          <el-table-column prop="type" label="接口类型"  width="200">
-          </el-table-column>
-          <el-table-column prop="url" label="接口地址"  show-overflow-tooltip/>
-          <el-table-column prop="rqtype" label="请求方式" width="200"/>
-          <el-table-column prop="rptype" label="响应类型" width="150">
-            <template #default="scope">
-              <div style="text-align: center;display: flex;" v-if="scope.row.rptype=='1'">
-                JSON
-              </div>
-              <div style="text-align: center;display: flex;" v-if="scope.row.rptype=='2'">
-                XML
-              </div>
-              <div style="text-align: center;display: flex;" v-if="scope.row.rptype=='3'">
-                HTML
-              </div>
-            </template>
+          <el-table-column prop="type" label="接口类型"  width="250">
           </el-table-column>
+          <el-table-column prop="intro" label="介绍"  show-overflow-tooltip/>
           <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=='1'">
@@ -73,15 +59,18 @@
               <div style="text-align: center;display: flex;color:#67C23A" v-if="scope.row.publish=='1'">
                 已发布
               </div>
-              <div style="text-align: center;display: flex;color:#F56C6C" v-if="scope.row.publish=='2'||scope.row.publish==null">
+              <div style="text-align: center;display: flex;color:#F56C6C" v-if="scope.row.publish=='2'">
                 下线
               </div>
               <div style="text-align: center;display: flex;color:#E6A23C" v-if="scope.row.publish=='3'">
-                更新
+                更新发布
+              </div>
+              <div style="text-align: center;display: flex;color:#E6A23C" v-if="scope.row.publish==null">
+                待发布
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="address" label="操作" width="150">
+          <el-table-column prop="address" label="操作" width="200">
               <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>
@@ -91,13 +80,13 @@
                   </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="xiaxian(scope.row)" type="danger" 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>
           </el-table-column>
         </el-table>
       </div>
-      
         <el-dialog @close="clearAdd" v-model="dialogVisible" title="" width="60%" destroy-on-close :key="tableKey">
           <div style="display: flex;align-items: center;">
             <div v-if="detailJson.rqtype==='GET'">
@@ -158,7 +147,7 @@
             <el-form-item label="是否发布:" prop="" style="">
               <el-radio-group v-model="publish" style="margin-top: -0.5%;">
                 <el-radio value="1" size="large">发布</el-radio>
-                <el-radio value="2" size="large">下线</el-radio>
+                <!-- <el-radio value="2" size="large">下线</el-radio> -->
               </el-radio-group>
             </el-form-item>
             <el-form-item label="说明:" prop="" style="">
@@ -458,6 +447,25 @@ function showLog(row){
   shenheLog(par).then(res=>{
     tableDataLog.value = res.data
   })
+}
+function xiaxian(row){
+  var par ={
+    publish:'2',
+    mdid:row.mdid
+  }
+  proxy.$modal.confirm('是否确认下线?').then(function () {
+    return publishModel(par).then(res=>{
+    if(res.code===200){
+        getList()
+      }
+      dialogVisibleTest.value = false
+  });
+  }).then(() => {
+    proxy.$modal.msgSuccess("下线成功");
+  }).catch(() => {});
+
+
+  
 }
 function saveShenhe(){
   parShenhe.value.publish = publish.value
@@ -832,7 +840,8 @@ function getDate(){
 function getList(){
   tableData.value = []
   var par = {
-    parasms:{
+    devkind:'APP',
+    params:{
       toPublish:'1'
     }
   }

+ 11 - 6
ruoyi-ui/src/views/service/info/shenhe.vue

@@ -83,11 +83,11 @@
                 </div>
               </div>
             </div>
-            <div style="display: flex;align-items: center;width: 50%;margin-top: 1%;margin-left: 3%;">
+            <div style="display: flex;align-items: center;width: 100%;margin-top: 1%;margin-left: 3%;">
               <div style="font-size: 16px;font-weight: bold;">
                 模型简介:
               </div>
-              <div style="font-size: 15px;margin-left: 1%;">
+              <div style="font-size: 15px;margin-left: 1%;word-wrap: break-word;width: 90%;">
                 {{ parTree.intro }}
               </div>
             </div>
@@ -159,8 +159,8 @@
             </div>
             <!-- <el-link :icon="isExpanded ? ArrowUp : ArrowDown"   @click="zhankai" type="primary"  size="mini" style="position: absolute;right:1%;bottom: 5%;">{{ isExpanded ? '收起' : '展开' }}</el-link > -->
           </div>
-        <el-button @click="showShen" type="primary" plain  size="mini" style="float: right;margin-right: 1%;margin-top: 1%;" :disabled="testAll">审核该模型</el-button>
-        <!-- <el-button @click="showShen" type="primary" plain  size="mini" style="margin-left: 1%;">审核该模型</el-button> -->
+        <!-- <el-button @click="showShen" type="primary" plain  size="mini" style="float: right;margin-right: 1%;margin-top: 1%;" :disabled="testAll">审核该模型</el-button> -->
+        <el-button @click="showShen"  type="primary" plain  size="mini" style="float: right;margin-right: 1%;margin-top: 1%;">审核该模型</el-button>
         <el-table 
           :data="tableData" 
           style="width: 98%;margin-left: 1%;margin-top: 4%;"
@@ -306,7 +306,7 @@
           </div>
           <template #footer>
             <span class="dialog-footer">
-                <el-button size="mini" @click="dialogVisibleTest = false">取消</el-button>
+                <el-button size="mini" @click="dialogVisibleShen = false">取消</el-button>
                 <el-button type="primary" @click="saveShenhe" size="mini">
                   提交
                 </el-button>
@@ -914,9 +914,13 @@ async function getTreeLeft(){
   await modelTreeSelect(par).then(res=>{
     par = res.data
     data.value = res.data
-    
+    firstMdid.value = res.data[0].children[0].id
   })
   optionsMdid.value = filterModelNodes(par)
+  var par1  = {
+    data:{id:firstMdid.value}
+  }
+  handleNodeClick(null,par1,null)
 }
 function renameTreeProperties(tree) {
   // 深拷贝避免修改原始数据(可选,根据需求)
@@ -995,6 +999,7 @@ function addCanAdd(){
 function delCanAdd(index){
   tableDataCanAdd.value.splice(index, 1)
 }
+const firstMdid = ref('')
 function getDate(){
   const today = new Date();
   const year = today.getFullYear();

+ 8 - 1
ruoyi-ui/src/views/service/info/test.vue

@@ -813,11 +813,17 @@ async function getTreeLeft(){
   await modelTreeSelect(par).then(res=>{
     par = res.data
     data.value = res.data
-    
+    firstMdid.value = res.data[0].children[0].id
   })
+  
   optionsMdid.value = filterModelNodes(par)
   console.log(optionsMdid.value)
+  var par1  = {
+    data:{id:firstMdid.value}
+  }
+  handleNodeClick(null,par1,null)
 }
+const firstMdid = ref('')
 function renameTreeProperties(tree) {
   // 深拷贝避免修改原始数据(可选,根据需求)
   const newTree = cloneDeep(tree); // 使用 lodash
@@ -895,6 +901,7 @@ function delCanAdd(index){
 onMounted(() => {
   fetchData()
   getTreeLeft()
+  
 });
 
 </script>

+ 8 - 7
ruoyi-ui/src/views/standardization/modelUsing/index.vue

@@ -102,7 +102,7 @@
               :auto-upload="false"
           >
             <el-button @click="clearDefault" plain type="primary" size="mini" style="margin-left:auto;width: 80px;"
-                       :icon="Upload">上传
+              :icon="Upload">上传
             </el-button>
           </el-upload>
         </el-form-item>
@@ -199,7 +199,7 @@ function editModel(item) {
 }
 
 function handleBizDataShowConfig(data) {
-router.push("/standardization/modeling/bizDataShowConfig/" + data.appId)
+  router.push("/standardization/modeling/bizDataShowConfig/" + data.appId)
 }
 
 function subEdit() {
@@ -219,7 +219,8 @@ function subEdit() {
         })
       }
     })
-  } else {
+  } 
+  else {
     formAddref.value.validate(async (valid) => {
       if (valid) {
         nextTick(() => {
@@ -253,10 +254,10 @@ function delModel(item) {
 }
 
 function submitAdd() {
-  if (!parFile.value) {
+  if (parFile.value) {
     formAddref.value.validate(async (valid) => {
       if (valid) {
-        formAdd.value.appIcon = '/profile/upload/2025/08/20/defaultModel_20250820173415A032.png'
+        formAdd.value.appIcon = '/profile/upload/2025/10/30/defaultModel_20251030230202A001.png'
         addModeling(formAdd.value).then(res => {
           if (res.code === 200) {
             proxy.$message({
@@ -272,7 +273,8 @@ function submitAdd() {
       }
     })
 
-  } else {
+  } 
+  else {
     formAddref.value.validate(async (valid) => {
       if (valid) {
         nextTick(() => {
@@ -328,7 +330,6 @@ function clearDefault() {
 }
 
 function handleChange(file, fileList) {
-  console.log(file, fileList)
   parFile.value = file
   const rawFile = file.raw;
   previewUrl.value = URL.createObjectURL(rawFile);

+ 40 - 2
ruoyi-ui/src/views/standardization/modeling/index.vue

@@ -4,7 +4,7 @@
     <div style="display: flex;margin-left: 1%;padding-top: 0.5%;position: absolute;z-index: 1000;justify-content: space-between;width: 98%;align-items: center;"> 
       <el-icon size="large" style="cursor: pointer" @click="back"><Back /></el-icon>
       <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="startTest">试运行</el-button>
     </div>
@@ -1217,9 +1217,47 @@ onEdgeClick(({ edge }) => {
 });
 async function getTreeLeft(){
   await modelTreeSelect().then(res=>{
-    dataTree.value = res.data
+
+    dataTree.value = flatArrayToTree(res.data)
   })
 }
+function flatArrayToTree(flatArray, rootPid = '1') {
+  if (!Array.isArray(flatArray) || flatArray.length === 0) {
+    return [];
+  }
+
+  const nodeMap = new Map();
+  const tree = [];
+
+  // 第一遍循环:建立id到节点的映射,并添加children属性
+  flatArray.forEach(item => {
+    nodeMap.set(item.id, {
+      ...item,
+      children: []
+    });
+  });
+
+  // 第二遍循环:建立父子关系
+  flatArray.forEach(item => {
+    const currentNode = nodeMap.get(item.id);
+    
+    if (item.pid === rootPid) {
+      // 根节点直接加入结果数组
+      tree.push(currentNode);
+    } else {
+      // 非根节点:找到父节点并加入其children数组
+      const parentNode = nodeMap.get(item.pid);
+      if (parentNode) {
+        parentNode.children.push(currentNode);
+      } else {
+        // 如果找不到父节点,作为孤儿节点直接放在根级
+        tree.push(currentNode);
+      }
+    }
+  });
+
+  return tree;
+}
 function deepToRaw(obj) {
   // 如果是数组,遍历每个元素并递归处理
   if (Array.isArray(obj)) {