nanjingliujinyu 5 月之前
父節點
當前提交
77ae2ea935
共有 2 個文件被更改,包括 425 次插入2 次删除
  1. 1 1
      ruoyi-ui/src/views/register/componentReg/index.vue
  2. 424 1
      ruoyi-ui/src/views/register/modelData/dataJi.vue

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

@@ -40,7 +40,7 @@
         </el-table-column>
         <el-table-column prop="enname" label="英文名称">
         </el-table-column>
-        <el-table-column prop="className" label="模型类型" width="160"/>
+        <el-table-column prop="type" label="模型类型" width="160"/>
         <el-table-column prop="mdUnit" label="模型单位" width="200"/>
         <el-table-column prop="mdContact" label="联系方式" width="100"/>
         <el-table-column prop="status" label="模型状态" width="140">

+ 424 - 1
ruoyi-ui/src/views/register/modelData/dataJi.vue

@@ -347,10 +347,400 @@
       </span>
     </template>
   </el-dialog>
+  <el-dialog @close=""  v-model="dialogVisibleApi" title="配置管理" width="60%" destroy-on-close :key="tableKey">
+    <div style="display: flex;align-items: center;width: 100%;">
+      <div>
+        API:
+      </div>
+      <div style="width: 18%;">
+        <el-tree-select
+          v-model="valueSel"
+          :data="dataSel"
+          :render-after-expand="false"
+          style="margin-left:1%;width: 100%;"
+        />
+      </div>
+    </div>
+    <div style="margin-top:0%;">
+      <div style="display: flex;justify-content: space-between;align-items: center;">
+        
+      </div>
+      <el-button style="margin-top: 2%;left: 92%;z-index:555;position: absolute;" type="info" plain size="mini">测试</el-button>
+      <el-tabs
+        v-model="activeName"
+        type="card"
+        class="demo-tabs"
+        style="margin-top: 2%;"
+        @tab-click="handleClick"
+      >
+        
+        <el-tab-pane label="参数" name="first">
+          <div style="display: flex;width: 100%;margin-top: 0%;">
+            <el-button  @click="addCanAdd" style="margin-top: 0%;" type="success" size="mini" plain>新增字段</el-button>
+          </div>
+          <el-table 
+          style="margin-top: 1%;width: 98%;"
+          :data="tableDataCanAdd" 
+          :cell-style="{ textAlign: 'center',padding:'2px 0' }"
+          :header-cell-style="{ textAlign: 'center'}"
+          :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center'  }"
+          border >
+              <el-table-column prop="itemName" label="字段编码" width="200">
+                  <template #default="scope">
+                      <el-input placeholder="(必填)" type="primary" class="noBor" v-model="scope.row.fieldCode" size="mini" text style="margin-left: 0%;"></el-input>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段名称">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.fieldName" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段类型">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.metaType" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="长度" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldLength" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="默认值" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDefault" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="说明" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDesc" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="主键" width="80">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-checkbox v-model="scope.row.fieldIspri" label="" size="large" />
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="address" label="操作" width="100">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-button type="danger" @click="delCanAdd(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
+                      </div>
+                  </template>
+              </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="结果集" name="second">
+          <div style="display: flex;width: 100%;margin-top: 0%;">
+            <el-button  @click="addCanAdd" style="margin-top: 0%;" type="success" size="mini" plain>新增字段</el-button>
+          </div>
+          <el-table 
+          style="margin-top: 1%;width: 98%;"
+          :data="tableDataCanAdd" 
+          :cell-style="{ textAlign: 'center',padding:'2px 0' }"
+          :header-cell-style="{ textAlign: 'center'}"
+          :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center'  }"
+          border >
+              <el-table-column prop="itemName" label="字段编码" width="200">
+                  <template #default="scope">
+                      <el-input placeholder="(必填)" type="primary" class="noBor" v-model="scope.row.fieldCode" size="mini" text style="margin-left: 0%;"></el-input>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段名称">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.fieldName" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段类型">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.metaType" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="长度" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldLength" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="默认值" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDefault" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="说明" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDesc" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="主键" width="80">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-checkbox v-model="scope.row.fieldIspri" label="" size="large" />
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="address" label="操作" width="100">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-button type="danger" @click="delCanAdd(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
+                      </div>
+                  </template>
+              </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="预览" name="third">
+          <div style="overflow: auto;height: 20vh;margin-top: -1%;">
+            <el-input placeholder="" :rows="8" type="textarea" v-model="JsonAdd" size="mini" text style="margin-top: 1%;width: 98%;" ></el-input>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+      <div>
+          
+          
+      </div>
+  </div>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="dialogVisibleTree = false">取消</el-button>
+        <el-button type="primary" @click="addPei" size="mini">
+          提交
+        </el-button>
+      </span>
+    </template>
+  </el-dialog>
+  <el-dialog @close=""  v-model="dialogVisibleFile" title="配置管理" width="60%" destroy-on-close :key="tableKey">
+    <div style="display: flex;align-items: center;width: 100%;">
+      <div>
+        文件类型:
+      </div>
+      <div style="width: 18%;">
+        <el-select
+        v-model="valueDs"
+        size="mini"
+        style="width: 100%;margin-left: 1%;"
+        >
+            <el-option
+            v-for="item in optionsDs"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+            />
+        </el-select>
+      </div>
+      <div style="margin-left:2% ">
+        文件格式:
+      </div>
+      <div style="width: 18%;;">
+        <el-select
+        v-model="valueDs"
+        size="mini"
+        style="width: 100%;margin-left: 1%;"
+        >
+            <el-option
+            v-for="item in optionsDs"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+            />
+        </el-select>
+      </div>
+    </div>
+    <el-divider/>
+    <div style="display: flex;align-items: center;width: 100%;">
+      
+    </div>
+    <div style="margin-top:0%;">
+      <div style="display: flex;justify-content: space-between;align-items: center;">
+        
+      </div>
+      <el-button style="margin-top: 2%;left: 92%;z-index:555;position: absolute;" type="info" plain size="mini">测试</el-button>
+      <el-tabs
+        v-model="activeName"
+        type="card"
+        class="demo-tabs"
+        style="margin-top: 2%;"
+        @tab-click="handleClick"
+      >
+        
+        <el-tab-pane label="参数" name="first">
+          <div style="display: flex;width: 100%;margin-top: 0%;">
+            <el-button  @click="addCanAdd" style="margin-top: 0%;" type="success" size="mini" plain>新增字段</el-button>
+          </div>
+          <el-table 
+          style="margin-top: 1%;width: 98%;"
+          :data="tableDataCanAdd" 
+          :cell-style="{ textAlign: 'center',padding:'2px 0' }"
+          :header-cell-style="{ textAlign: 'center'}"
+          :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center'  }"
+          border >
+              <el-table-column prop="itemName" label="字段编码" width="200">
+                  <template #default="scope">
+                      <el-input placeholder="(必填)" type="primary" class="noBor" v-model="scope.row.fieldCode" size="mini" text style="margin-left: 0%;"></el-input>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段名称">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.fieldName" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段类型">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.metaType" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="长度" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldLength" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="默认值" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDefault" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="说明" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDesc" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="主键" width="80">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-checkbox v-model="scope.row.fieldIspri" label="" size="large" />
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="address" label="操作" width="100">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-button type="danger" @click="delCanAdd(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
+                      </div>
+                  </template>
+              </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="结果集" name="second">
+          <div style="display: flex;width: 100%;margin-top: 0%;">
+            <el-button  @click="addCanAdd" style="margin-top: 0%;" type="success" size="mini" plain>新增字段</el-button>
+          </div>
+          <el-table 
+          style="margin-top: 1%;width: 98%;"
+          :data="tableDataCanAdd" 
+          :cell-style="{ textAlign: 'center',padding:'2px 0' }"
+          :header-cell-style="{ textAlign: 'center'}"
+          :row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center'  }"
+          border >
+              <el-table-column prop="itemName" label="字段编码" width="200">
+                  <template #default="scope">
+                      <el-input placeholder="(必填)" type="primary" class="noBor" v-model="scope.row.fieldCode" size="mini" text style="margin-left: 0%;"></el-input>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段名称">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.fieldName" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="字段类型">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input placeholder="" type="primary" class="noBor" v-model="scope.row.metaType" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="长度" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldLength" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="默认值" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDefault" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="说明" >
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-input type="primary" class="noBor" v-model="scope.row.fieldDesc" size="mini" text style="margin-left: 0%;"></el-input>
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="itemName" label="主键" width="80">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-checkbox v-model="scope.row.fieldIspri" label="" size="large" />
+                      </div>
+                  </template>
+              </el-table-column>
+              <el-table-column prop="address" label="操作" width="100">
+                  <template #default="scope">
+                      <div style="width: 100%;">
+                          <el-button type="danger" @click="delCanAdd(scope.$index)" size="mini" text style="margin-left: 0%;">删除</el-button>
+                      </div>
+                  </template>
+              </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="预览" name="third">
+          <div style="overflow: auto;height: 20vh;margin-top: -1%;">
+            <el-input placeholder="" :rows="8" type="textarea" v-model="JsonAdd" size="mini" text style="margin-top: 1%;width: 98%;" ></el-input>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+      <div>
+          
+          
+      </div>
+  </div>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="dialogVisibleTree = false">取消</el-button>
+        <el-button type="primary" @click="addPei" size="mini">
+          提交
+        </el-button>
+      </span>
+    </template>
+  </el-dialog>
 </template>
 <script   setup>
 import { reactive } from 'vue'
 import { Plus } from '@element-plus/icons-vue'
+import { modelTreeSelect } from "@/api/service/info";
 import { cateTree,addCate,delCate,fieldAll,addSet,dataSetList,editSet,fieldAdd,delField,getDataSourceList,delSet  } from "@/api/register/regCom.js";
 import { ref, onMounted, onUnmounted, nextTick } from 'vue';
 import Codemirror from 'codemirror-editor-vue3';
@@ -370,6 +760,9 @@ const cmOptions = {
   }
 };
 const activeName = ref('first')
+const dialogVisibleApi = ref(false)
+const dialogVisibleFile = ref(true)
+const valueSel = ref('')
 const { proxy } = getCurrentInstance();
 const data =  ref([])
 const title =  ref([])
@@ -409,6 +802,7 @@ const formTree = ref({
   itemNo:'',
   itemNotes:'',
 });
+const dataSel = ref([])
 const parMeta = ref({})
 const rulesTree = reactive({
   itemName: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -417,6 +811,34 @@ const rulesTree = reactive({
 const formRefTree = ref();
 const parDscode = ref('')
 const parLev = ref(1)
+
+async function getTreeSel(){
+  await modelTreeSelect().then(res=>{
+    dataSel.value = res.data
+  })
+}
+function filterModelNodes(nodes) {
+  if (!Array.isArray(nodes)) return [];
+  
+  const result = [];
+  for (const node of nodes) {
+    // 递归处理子节点(如果有)
+    const filteredChildren = node.children ? filterModelNodes(node.children) : [];
+    
+    if (node.nodeType === 'MODEL') {
+      // 保留当前节点,并更新其子节点
+      node.value = node.id
+      result.push({
+        ...node,
+        children: filteredChildren
+      });
+    } else {
+      // 删除当前节点,将其子节点提升到当前层级
+      result.push(...filteredChildren);
+    }
+  }
+  return result;
+}
 function getOptionsDs(){
   getDataSourceList().then(res=>{
     optionsDs.value = res.rows
@@ -626,7 +1048,7 @@ function saveEditTa(){
 }
 function delRow(row) {
   proxy.$modal.confirm('是否确认删除?').then(function () {
-    return delSet(row.cateId);
+    return delSet(row.dcCode);
   }).then(() => {
     getTable();
     proxy.$modal.msgSuccess("删除成功");
@@ -678,6 +1100,7 @@ function editTree(node, data){
 onMounted(() => {
   getTree()
   getOptionsDs()
+  getTreeSel()
   // getTable()
 });