Ver Fonte

Merge remote-tracking branch 'origin/master'

侯茂昌 há 1 ano atrás
pai
commit
b61ba38cb6
35 ficheiros alterados com 3144 adições e 4256 exclusões
  1. 2 3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysBpmNodeScriptController.java
  2. 4 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  3. 4 12
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  4. 50 0
      ruoyi-system/src/main/resources/sql/initialize_sys_tenant_menu.json
  5. 11 0
      ruoyi-ui/src/api/bpmprocess/process.js
  6. 11 1
      ruoyi-ui/src/api/relateTable/index.js
  7. 33 14
      ruoyi-ui/src/components/kFormDesign/OptionsEdit.vue
  8. 9 0
      ruoyi-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/index.vue
  9. 22 9
      ruoyi-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/module/formItemProperties.vue
  10. 1 1
      ruoyi-ui/src/main.js
  11. 3 2
      ruoyi-ui/src/utils/sqlString.js
  12. 16 5
      ruoyi-ui/src/views/bpmprocess/scriptManage.vue
  13. 0 1
      ruoyi-ui/src/views/bussiness/components/taskList.vue
  14. 139 26
      ruoyi-ui/src/views/bussiness/processMange.vue
  15. 137 0
      ruoyi-ui/src/views/dialogMange/components/RelayDialog.vue
  16. 0 323
      ruoyi-ui/src/views/dialogMange/components/StyleFormPanel.vue
  17. 379 0
      ruoyi-ui/src/views/dialogMange/components/relayTable.vue
  18. 421 293
      ruoyi-ui/src/views/dialogMange/index.vue
  19. 279 236
      ruoyi-ui/src/views/dialogMange/relayTableMange/tablelist.vue
  20. 0 465
      ruoyi-ui/src/views/dialogMange/styleMange/index.vue
  21. 495 0
      ruoyi-ui/src/views/dialogTemplate/components/NodeInfoDialog.vue
  22. 330 347
      ruoyi-ui/src/views/dialogTemplate/components/index.vue
  23. 7 237
      ruoyi-ui/src/views/dialogTemplate/indexTable.vue
  24. 63 32
      ruoyi-ui/src/views/relateTable/components/RelateTableCard.vue
  25. 425 361
      ruoyi-ui/src/views/relateTable/index.vue
  26. 0 1685
      ruoyi-ui/src/views/relateTable/relateMange.vue
  27. 51 100
      ruoyi-ui/src/views/relateTable/relateTableEdit.vue
  28. 47 8
      ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementExecuteForm.vue
  29. 2 0
      ruoyi-ui/src/views/system/bpmnPro/components/Toolbar/tools/Save.vue
  30. 6 2
      ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/getNodeMsg.js
  31. 18 0
      ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/myFieldUtil.js
  32. 1 0
      ruoyi-ui/src/views/system/bpmnPro/index.vue
  33. 1 1
      ruoyi-ui/src/views/system/tenant/dict/data.vue
  34. 57 31
      ruoyi-ui/src/views/system/tenant/index.vue
  35. 120 57
      ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

+ 2 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysBpmNodeScriptController.java

@@ -117,9 +117,8 @@ public class SysBpmNodeScriptController extends BaseController
     /**
      *  根据scriptKey获取流程节点脚本详细信息
      */
-    @Anonymous
-    @GetMapping("/selectSysBpmNodeScriptByScriptKey/{scriptKey}")
-    public AjaxResult selectSysBpmNodeScriptByScriptKey(@PathVariable("scriptKey") String scriptKey){
+    @GetMapping("/selectSysBpmNodeScriptByScriptKey")
+    public AjaxResult selectSysBpmNodeScriptByScriptKey(String scriptKey){
         return success(sysBpmNodeScriptService.selectSysBpmNodeScriptByScriptKey(scriptKey));
     }
 

+ 4 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.alibaba.fastjson2.JSON;
 import com.ruoyi.common.annotation.Anonymous;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -269,9 +270,8 @@ public class SysRoleController extends BaseController
     /**
      * 根据角色权限字符查询该角色下是否存在真实用户
      */
-    @Anonymous
-    @GetMapping("/selectUserByRoleKey/{roleKeys}")
-    public AjaxResult selectUserByRoleKey(@PathVariable("roleKeys") List<String> roleKeys){
-        return AjaxResult.success(roleService.selectUserByRoleKey(roleKeys));
+    @GetMapping("/selectUserByRoleKey")
+    public AjaxResult selectUserByRoleKey(String roleKeys){
+        return AjaxResult.success(roleService.selectUserByRoleKey((List<String>) JSON.parse(roleKeys)));
     }
 }

+ 4 - 12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -11,14 +11,7 @@ import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
@@ -299,9 +292,8 @@ public class SysUserController extends BaseController
     /**
      * 查询这组用户中是否存在真实用户
      */
-    @Anonymous
-    @GetMapping("/selectUserByUserIds/{userIds}")
-    public AjaxResult selectUserByUserIds(@PathVariable("userIds") List<Long> userIds){
-        return AjaxResult.success(userService.selectUserByUserIds(userIds));
+    @GetMapping("/selectUserByUserIds")
+    public AjaxResult selectUserByUserIds(String userIds){
+        return AjaxResult.success(userService.selectUserByUserIds((List<Long>) JSON.parse(userIds)));
     }
 }

+ 50 - 0
ruoyi-system/src/main/resources/sql/initialize_sys_tenant_menu.json

@@ -1098,5 +1098,55 @@
         "children": [],
         "tenantName": null,
         "tenantId": null
+    },
+    {
+        "createBy": null,
+        "createTime": "2023-10-11 09:28:10",
+        "updateBy": null,
+        "updateTime": null,
+        "remark": null,
+        "menuId": 4409,
+        "menuName": "弹窗管理",
+        "parentName": null,
+        "parentId": 1103,
+        "orderNum": 5,
+        "path": "tableDialog",
+        "component": "dialogTemplate/indexTable",
+        "query": null,
+        "isFrame": "1",
+        "isCache": "0",
+        "menuType": "C",
+        "visible": "0",
+        "status": "0",
+        "perms": "",
+        "icon": "bpmn-icon-call-activity",
+        "children": [],
+        "tenantName": null,
+        "tenantId": null
+    },
+    {
+        "createBy": null,
+        "createTime": "2023-10-11 09:28:10",
+        "updateBy": null,
+        "updateTime": null,
+        "remark": null,
+        "menuId": 4410,
+        "menuName": "弹窗编辑",
+        "parentName": null,
+        "parentId": 1103,
+        "orderNum": 6,
+        "path": "dialogMange",
+        "component": "dialogMange/index",
+        "query": null,
+        "isFrame": "1",
+        "isCache": "0",
+        "menuType": "C",
+        "visible": "1",
+        "status": "0",
+        "perms": "",
+        "icon": "bpmn-icon-collaboration",
+        "children": [],
+        "tenantName": null,
+        "tenantId": null
     }
 ]

+ 11 - 0
ruoyi-ui/src/api/bpmprocess/process.js

@@ -137,3 +137,14 @@ export function addScript(data) {
     data: data
   })
 }
+
+//触发异常节点 
+export function triggerExceptionNode(data) {
+  return request({
+    url: '/system/execute/node/triggerExceptionNode',
+    method: 'post',
+    data: data,
+    baseURL: process.env.VUE_APP_BASE_API4,
+  })
+}
+

+ 11 - 1
ruoyi-ui/src/api/relateTable/index.js

@@ -59,7 +59,7 @@ export function dragGroupTableInfo(query) {
 }
 
 // 修改表格
-export function updataGroup(data){
+export function updataGroup(data) {
   return request({
     url: '/system/group',
     method: 'put',
@@ -67,3 +67,13 @@ export function updataGroup(data){
     baseURL: process.env.VUE_APP_BASE_API3
   })
 }
+
+//流程节点  获取节点弹窗数据
+export function getProcessPopupResultInfo(query) {
+  return request({
+    url: '/system/productionplan/getProcessPopupResultInfo',
+    method: 'get',
+    params: query,
+    baseURL: process.env.VUE_APP_BASE_API4
+  })
+}

+ 33 - 14
ruoyi-ui/src/components/kFormDesign/OptionsEdit.vue

@@ -445,18 +445,17 @@ export default {
     },
     mySelectItem: {
       handler(nval) {
-        console.log(nval);
-        if (
-          nval.options.sqlData &&
-          nval.options.sqlData.dynamicName == nval.options.dynamicKey
-        ) {
-          this.btnList = nval.options.sqlData.echoDatas.map((item) => {
-            return {
-              sql: "",
-              echoData: item,
-            };
-          });
-        }
+        // if (
+        //   nval.options.sqlData &&
+        //   nval.options.sqlData.dynamicName == nval.options.dynamicKey
+        // ) {
+        //   this.btnList = nval.options.sqlData.echoDatas.map((item) => {
+        //     return {
+        //       sql: "",
+        //       echoData: item,
+        //     };
+        //   });
+        // }
       },
       deep: true,
       immediate: true,
@@ -464,10 +463,26 @@ export default {
     myOptions: {
       handler(nval) {
         console.log("options", nval);
+        this.btnList = [];
+        this.reset();
+        if (nval.sqlData && nval.sqlData.dynamicName == nval.dynamicKey) {
+          this.btnList = nval.sqlData.echoDatas.map((item) => {
+            return {
+              sql: "",
+              echoData: item,
+            };
+          });
+        }
+        console.log(this.btnList);
       },
       deep: true,
       immediate: true,
     },
+    // 'formData.tableName': {
+    //   handler(nval) {
+    //     if(nval){}
+    //   }
+    // }
   },
   computed: {
     ...mapState({
@@ -539,12 +554,14 @@ export default {
       // }
       this.editIndex = editIndex;
       let currentItem = this.btnList[editIndex];
+      console.log(currentItem, "currentItem");
       if (currentItem?.echoData) {
         let { formData, filterTableData, flagFormData } = JSON.parse(
           currentItem.echoData
         );
         this.filterTableData = filterTableData;
         this.formData = formData;
+
         // this.flagFormData = flagFormData;
       } else {
         this.btnList[editIndex] = {
@@ -552,6 +569,10 @@ export default {
           echoData: "",
         };
       }
+      this.formData.dynamicName = this.myOptions.dynamicKey;
+      if (this.formData.tableName) {
+        this.getFieldOptions(this.formData.tableName);
+      }
       this.isShow = true;
     },
     // 弹窗取消回调
@@ -561,7 +582,6 @@ export default {
     },
     // 弹窗确认回调
     conformHandler() {
-      console.log(this.formData, this.filterTableData);
       let sql = getOptionsSqlString(this.formData, this.filterTableData);
       // let sqlData = {};
       // sqlData[this.formData.dynamicName] = sql;
@@ -583,7 +603,6 @@ export default {
       sqlData.sqls = this.btnList.map((item) => item.sql);
       sqlData.echoDatas = this.btnList.map((item) => item.echoData);
       this.$emit("setDynamicKey", sqlData);
-      console.log(sql);
       this.reset();
 
       this.isShow = false;

+ 9 - 0
ruoyi-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/index.vue

@@ -120,6 +120,7 @@
                 class="form-item-properties"
                 :selectItem="selectItem"
                 :hideModel="hideModel"
+                @changeOptionsListData="changeOptionsListData"
               />
             </a-tab-pane>
           </a-tabs>
@@ -273,6 +274,14 @@ export default {
     }
   },
   methods: {
+    changeOptionsListData(flag, index) {
+      if (flag) {
+        this.selectItem.options.optionsListData.push('');
+        console.log(this.selectItem.options.optionsListData);
+      } else (
+        this.selectItem.options.optionsListData.split(index,1)
+      )
+    },
     generateKey(list, index) {
       // console.log('generateKey');
       // 生成key值

+ 22 - 9
ruoyi-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/module/formItemProperties.vue

@@ -25,7 +25,7 @@
             @change="getFormList"
             mode="tags"
           /> -->
-          <el-select v-model="selectItem.tableName" placeholder="请选择" @change="getListName(selectItem)">
+          <el-select v-model="selectItem.tableName" placeholder="请选择" filterable @change="getListName(selectItem)">
             <el-option
               v-for="item in formList.formName"
               :key="item.tableName"
@@ -40,7 +40,7 @@
           v-if="!hideModel && isDefined(selectItem.model)"
           label="列名"
         >
-          <el-select v-model="selectItem.model" placeholder="请选择">
+          <el-select v-model="selectItem.model" filterable placeholder="请选择">
             <el-option
               v-for="item in formList.listName"
               :key="item.value"
@@ -140,13 +140,16 @@
             <RadioButton :value="false">静态数据</RadioButton>
             <RadioButton :value="true">动态数据</RadioButton>
           </Radio>
-
-          <Input
+          <!-- <div class="dynamic-wrap"> -->
+            <Input
             v-show="options.dynamic"
             v-model="options.dynamicKey"
             placeholder="动态数据变量名"
           />
-          <OptionsEdit v-show="options.dynamic" @setDynamicKey="setDynamicKey" :options="options" :selectItem="selectItem"></OptionsEdit>
+          <OptionsEdit class="ml5 mt10" :dynamicKey="options.dynamicKey" v-show="options.dynamic&&options
+          .dynamicKey" @setDynamicKey="setDynamicKey" :options="options" :selectItem="selectItem"></OptionsEdit>
+          <!-- </div> -->
+          
           
 
           <KChangeOption v-show="!options.dynamic" v-model="options.options" />
@@ -707,10 +710,11 @@ export default {
     }
   },
   methods: {
-    setDynamicKey(key,sqlData) {
-      this.options.dynamicKey = key;
-      this.options.sqlData=sqlData
-      console.log(this.options.dynamicKey,key,111);
+    setDynamicKey(sqlData) {
+      console.log('sqlData',sqlData);
+      this.options.dynamicKey = sqlData.dynamicName;
+      this.options.sqlData=JSON.parse(JSON.stringify(sqlData))
+      // console.log(this.options.dynamicKey,key,111);
     },
     /**
      * 判断是否已定义
@@ -757,3 +761,12 @@ export default {
   
 };
 </script>
+
+<style lang="scss" scoped>
+.dynamic-wrap{
+  display: flex !important;
+  align-items: center;
+
+}
+
+</style>

+ 1 - 1
ruoyi-ui/src/main.js

@@ -71,7 +71,7 @@ import JsonExcel from 'vue-json-excel'
 
 // 自定义指令
 import Directives from '@/utils/directives'
-import './mock.js'
+// import './mock.js'
 
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts

+ 3 - 2
ruoyi-ui/src/utils/sqlString.js

@@ -14,12 +14,13 @@ export default function getOptionsSqlString(baseData, conditions) {
   })
   let set = new Set(allTable);
   allTable = [...set];
-  console.log(allTable);
   let tableNickNameStr = ''    //表格别名
   allTable.forEach(item => {
     tableNickNameStr += `${item} AS ${item} `
   })
-  tableNickNameStr += 'WHERE '
+  if (conditions?.length) {
+    tableNickNameStr += 'WHERE '
+  }
   // 拼接条件
   let conditionArr = [];
   conditions.forEach(condition => {

+ 16 - 5
ruoyi-ui/src/views/bpmprocess/scriptManage.vue

@@ -172,8 +172,12 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  
         <el-form-item label="脚本编码:" prop="scriptKey">
-          <el-input v-model="form.scriptKey" placeholder="请输入脚本编码" :disabled="true"/>
-          <el-button icon="el-icon-document-copy"></el-button>
+          <el-col :span="20">
+            <el-input v-model="form.scriptKey" placeholder="请输入脚本编码" :disabled="true"/>
+          </el-col>
+          <el-col :span="4">
+            <el-button icon="el-icon-document-copy" v-clipboard:copy="form.scriptKey" v-clipboard:success="onCopy" v-clipboard:error="onError"></el-button>
+          </el-col>
         </el-form-item>
         <el-form-item label="脚本名称:" prop="scriptName">
           <el-input v-model="form.scriptName" placeholder="请输入脚本名称" />
@@ -260,6 +264,7 @@ import uuid from "@/utils/bpmn/uuid";
 import Editor from "vue2-ace-editor";
 import {v4 as uuidv4} from 'uuid';
 import * as monaco from "monaco-editor";
+import Clipboard from "clipboard";
 
 export default {
   name: "Script",
@@ -358,7 +363,14 @@ export default {
       require("brace/mode/javascript");
       require("brace/snippets/javascript");
     },
-
+    // 复制成功
+    onCopy() {
+      this.$modal.msgSuccess("脚本编码已成功复制到剪贴板");
+    },
+    //复制失败
+    onError() {
+      this.$modal.msgError("脚本编码复制失败");
+    },
     /** 查询流程节点脚本列表 */
     getList() {
       this.loading = true;
@@ -410,10 +422,9 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() { 
-     
       this.monacoEditor?.dispose();
       this.reset();
-      this.form.scriptKey= uuidv4()
+      this.form.scriptKey= uuidv4();
       console.log(this.form.scriptKey);
       this.open = true;
       this.title = "添加流程节点脚本";

+ 0 - 1
ruoyi-ui/src/views/bussiness/components/taskList.vue

@@ -48,7 +48,6 @@
 <script>
 import uuid from "@/utils/bpmn/uuid";
 import TaskItem from "./TaskItem.vue";
-import { start } from "nprogress";
 export default {
   name: "TaskList",
   props: ["cardData"],

+ 139 - 26
ruoyi-ui/src/views/bussiness/processMange.vue

@@ -76,7 +76,7 @@
                 getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
               }}</span>
               <span v-else-if="col.prop == 'benTaskNodeState'">{{
-                scope.row.benTaskNodeState == "0" ? "已执行" : "未执行"
+                scope.row.benTaskNodeState == "0" ? "未执行" : "已执行"
               }}</span>
               <span v-else>{{ scope.row[col.prop] }}</span>
             </template>
@@ -109,19 +109,26 @@
                       </el-button>
                     </el-dropdown-item> -->
                     <el-dropdown-item>
-                      <el-dropdown
-                        size="mini"
-                        @command="
-                          (command) => handleCommand(command, scope.row)
-                        "
-                      >
+                      <el-dropdown size="mini">
                         <el-button
                           size="mini"
                           type="text"
                           icon="el-icon-d-arrow-right"
                           >触发异常
                         </el-button>
-                        <el-dropdown-menu slot="dropdown"> </el-dropdown-menu>
+                        <el-dropdown-menu slot="dropdown">
+                          <el-dropdown-item
+                            v-for="item in scope.row.exceptionScriptList"
+                            :key="item.id"
+                          >
+                            <el-button
+                              @click="exceptionTrigger(scope.row, item)"
+                              size="mini"
+                              type="text"
+                              >{{ item.scriptName }}
+                            </el-button>
+                          </el-dropdown-item>
+                        </el-dropdown-menu>
                       </el-dropdown>
                     </el-dropdown-item>
                   </el-dropdown-menu>
@@ -145,7 +152,23 @@
           <!-- <el-form label-width="100px" :model="commonData">
             <h1>这里会引入当前节点需要处理的表单</h1>
           </el-form> -->
-          <component v-if="myForm" :is="myForm" ref="myFormRef"></component>
+          <k-form-build
+            v-if="formType == 'dragForm'"
+            class="formBuild"
+            ref="addFromRef"
+            :dynamicData="dynamicData"
+            :defaultValue="defaultValue"
+            :value="jsonData"
+          />
+          <NodeInfoDialog
+            v-else-if="formType == 'composeForm'"
+            :taskInfo="taskInfo"
+          ></NodeInfoDialog>
+          <component
+            v-else-if="formType == 'designForm'"
+            :is="myForm"
+            ref="myFormRef"
+          ></component>
           <span slot="footer" class="dialog-footer">
             <el-button @click="closeExecuteNode">取消</el-button>
             <el-button type="primary" @click="executeNode">运行</el-button>
@@ -161,13 +184,16 @@ import {
   processList,
   runProcessNodeExecution,
 } from "@/api/bpmprocess/run/executeProcess";
+import { triggerExceptionNode } from "@/api/bpmprocess/process";
+
 import getNodeSequence from "@/utils/bpmn/getNodeSequence";
 import GY1 from "./dialogCompments/GY1.vue";
-
+import { getForm } from "@/api/dragform/form";
+import NodeInfoDialog from "@/views/dialogTemplate/components/NodeInfoDialog.vue";
 export default {
   name: "processMange",
   props: [],
-  components: { GY1 },
+  components: { GY1, NodeInfoDialog },
   dicts: ["bpm_type"],
   data() {
     return {
@@ -226,6 +252,12 @@ export default {
           label: "创建时间",
         },
       ],
+      formType: "", //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单   designForm:定制表单
+      // k-form-build 数据
+      dynamicData: {},
+      defaultValue: {},
+      jsonData: {},
+      taskInfo: {}, //
     };
   },
   computed: {},
@@ -246,11 +278,61 @@ export default {
         }
       });
     },
+    // 获取表单数据
+    async getFormData() {
+      let formData = {};
+      switch (this.formType) {
+        case "dragForm":
+          try {
+            formData = await this.$refs.addFromRef.getData();
+          } catch (error) {
+            console.log(error);
+            this.$message.error("表单校验异常,请稍后重试");
+            return {};
+          }
+          break;
+        case "designForm":
+          let temp = await this.$refs.myFormRef.getFormData();
+          if (!temp.flag) {
+            this.$message.error(temp.msg);
+            return {};
+          } else {
+            formData = temp.data;
+          }
+          break;
+        default:
+          break;
+      }
+      return formData;
+    },
+    // 重置弹窗数据
+    resetDialogForm() {
+      this.formType = ""; //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单   designForm:定制表单
+      // k-form-build 数据
+      this.dynamicData = {};
+      this.defaultValue = {};
+      this.jsonData = {};
+    },
     // 打开运行节点弹窗
-    opneExecuteNode(row) {
-      console.log(row);
-      this.myForm = row.benTaskNodeName.split("-")[0];
+    async opneExecuteNode(row) {
+      this.resetDialogForm();
+      let preFix = row.benTaskNodeName.split("-")[0];
+      if (row.benTaskNodeFormKey) {
+        if (row.benTaskNodeFormType == "dragForm") {
+          //拖拽表单
+          this.formType = "dragForm";
+          await this.getDragFormInfo(row.benTaskNodeFormKey);
+        } else if (row.benTaskNodeFormType == "composeForm") {
+          //工艺组合表单
+          this.formType = "composeForm";
+        }
+      } else if (preFix) {
+        //定制表单
+        this.formType = "designForm";
+        this.myForm = preFix;
+      }
       this.row = row; //记录当前行数据
+      if (!this.formType) return;
       this.open = true; // 打开弹窗
       // 根据当前节点绑定的表单信息查询对应的表单进行展示
     },
@@ -263,15 +345,8 @@ export default {
         benTaskNodeKey,
         bepTaskProcessXmlContent
       );
-      let formData = {};
-      if (this.$refs.myFormRef) {
-        //获取自定义表单组件内容
-        formData = await this.$refs.myFormRef.getFormData();
-        if (!formData.flag) {
-          this.$message.error(formData.msg);
-          return;
-        }
-      }
+      let formData = await this.getFormData();
+
       // let payLoad = {
       //   basicMap: {
       //     taskNodeKey: nodeId,
@@ -291,13 +366,28 @@ export default {
         nextNodeKey: nextNodeId, //下一节点编码
         implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
         taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
-        formDataMap: formData.data, //自定义表单组件收集的表单数据
+        formDataMap: formData, //自定义表单组件收集的表单数据
       };
       runProcessNodeExecution(payLoad).then((res) => {
         console.log(res);
       });
       console.log(payLoad);
     },
+    // 获取拖拽表单数据
+    async getDragFormInfo(fid) {
+      try {
+        let res = await getForm(fid);
+        if (res.code == 200) {
+          this.jsonData = JSON.parse(res.data.dfVueTemplate);
+        } else {
+          console.log(res);
+          this.$message.error("网络异常,请稍后再试");
+        }
+      } catch (error) {
+        console.log(error);
+        this.$message.error("网络异常,请稍后再试");
+      }
+    },
     // 关闭运行节点弹窗
     closeExecuteNode(row) {
       console.log(row);
@@ -322,8 +412,31 @@ export default {
       return xmlObj;
     },
     // 触发异常回调
-    handleCommand(command, row) {
-      console.log("触发异常");
+    exceptionTrigger(row, scriptData) {
+      this.$modal
+        .confirm("是否确认触发<" + scriptData.scriptName + ">异常?")
+        .then(function (val) {
+          console.log(val);
+          // 发送触发异常节点的请求
+          let payLoad = {
+            taskProcessKey: row.bepTaskKey,
+            taskNodeKey: row.benTaskNodeKey,
+            sysBpmNodeScriptVO: scriptData,
+          };
+          triggerExceptionNode(payLoad).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("触发成功");
+              this.open = false;
+              this.getList();
+            } else {
+              this.$message.error("触发失败请稍后再试");
+            }
+          });
+        })
+        .catch(() => {
+          this.open = false;
+          this.$message.info("取消成功");
+        });
     },
     // 获取字典对应label
     getDictLabel(value, dictLsit = []) {

+ 137 - 0
ruoyi-ui/src/views/dialogMange/components/RelayDialog.vue

@@ -0,0 +1,137 @@
+<template>
+  <el-dialog title="添加依赖关系" :visible.sync="isShow" width="30%">
+    <el-form
+      :model="formData"
+      ref="formDataRef"
+      :rules="rules"
+      label-width="80px"
+      :inline="false"
+      size="normal"
+    >
+      <el-form-item label="表格">
+        <el-select
+          v-model="formData.tableName"
+          placeholder="请选择依赖表"
+          clearable
+          filterable
+          @change="tableChangeHandler"
+        >
+          <el-option
+            v-for="item in tableList"
+            :key="item.tableName"
+            :label="item.tableComment"
+            :value="item.tableName"
+          >
+            <span style="float: left">{{ item.tableComment }}</span>
+            <span style="float: right; color: #8492a6; font-size: 13px">{{
+              item.tableName
+            }}</span>
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="字段">
+        <el-select
+          v-model="formData.fieldName"
+          placeholder="请选择依赖字段"
+          clearable
+          filterable
+        >
+          <el-option
+            v-for="item in fieldList"
+            :key="item.fieldName"
+            :label="item.fieldDescription"
+            :value="item.fieldName"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+
+    <template #footer>
+      <span>
+        <el-button @click="closeHandler">取消</el-button>
+        <el-button type="primary" @click="confirmHandler">确认</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { tableInfoList } from "@/api/dataEngine/index";
+import {
+  getFormName,
+  getListName,
+  dragTablePreview,
+} from "@/api/dragform/form.js";
+export default {
+  name: "RelayDialog",
+  props: [],
+  components: {},
+  data() {
+    return {
+      isShow: false,
+      formData: {
+        tableName: "",
+        fieldName: "",
+      },
+      tableList: [],
+      fieldList: [],
+      rules: {},
+      queryParams: {
+        // isEnablePaging: false,
+        databaseType: this.$store.state.user.dataSource.databaseType,
+        databaseName: this.$store.state.user.dataSource.databaseName,
+        // username: this.$store.state.user.dataSource.username,
+      },
+    };
+  },
+  computed: {},
+  methods: {
+    async openHandlder(echoData = {}) {
+      this.formData = {
+        tableName: "",
+        fieldName: "",
+      };
+      await this.getTableList();
+      this.isShow = true;
+    },
+    closeHandler() {
+      let res = {
+        flag: false,
+      };
+      this.isShow = false;
+    },
+    confirmHandler() {
+      let res = {
+        flag: true,
+        data: this.formData,
+      };
+      this.$emit("saveRelayRes", res);
+      this.isShow = false;
+    },
+    async getTableList() {
+      //请求表  列表
+      try {
+        let res = await getFormName(this.queryParams);
+        console.log(res);
+        this.tableList = res.data;
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    async tableChangeHandler(value) {
+      //获取字段列表
+      if (!value) return;
+      let payLoad = { ...this.queryParams, tableName: value };
+      try {
+        let res = await getListName(payLoad);
+        this.fieldList = res;
+      } catch (error) {
+        console.log(error);
+      }
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss"></style>

+ 0 - 323
ruoyi-ui/src/views/dialogMange/components/StyleFormPanel.vue

@@ -1,323 +0,0 @@
-<template>
-  <div class="style-wrap">
-    <el-form
-      ref="formData"
-      :model="formData"
-      label-width="100px"
-      :rules="rules"
-    >
-      <el-form-item label="表格名称" prop="menuName">
-        <el-input v-model="formData.menuName" @input="iptChange()"></el-input>
-      </el-form-item>
-      <el-form-item label="时间格式" prop="timeFormate">
-        <el-select
-        @input="iptChange()"
-          v-model="formData.timeFormate"
-          placeholder="请选择时间格式"
-        >
-          <el-option
-            v-for="val in dict.type.sys_time_format"
-            :key="val.value"
-            :label="val.label"
-            :value="val.value"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="表格主键" prop="primaryKey">
-        <el-select
-        @input="iptChange()"
-          v-model="formData.primaryKey"
-          placeholder="请选择表格主键"
-        >
-          <el-option
-            v-for="val in primaryKeyList"
-            :key="val.fieldName"
-            :label="val.fieldDescription"
-            :value="val.fieldName"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="操作列按钮" prop="btnGroupList">
-        <el-select
-        @input="iptChange()"
-          v-model="formData.btnGroupList"
-          placeholder="请选择按钮组"
-          clearable
-          multiple
-        >
-          <el-option
-            v-for="val in btnGroupOptions"
-            :key="val.btnKey"
-            :label="val.btnGroupName"
-            :value="val.btnKey"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="排序依赖字段">
-        <el-select
-        @input="iptChange()"
-          v-model="formData.orderByColumn"
-          placeholder="请选择排序依赖"
-        >
-          <el-option
-            v-for="val in orderByFieldList"
-            :key="val.fieldName"
-            :label="val.fieldDescription"
-            :value="val.tableName + '.' + val.fieldName"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="排序方式" v-show="formData.orderByColumn">
-        <el-radio v-model="formData.isAsc" :label="false"
-          >升序</el-radio
-        >
-        <el-radio v-model="formData.isAsc" :label="true"
-          >降序</el-radio
-        >
-      </el-form-item>
-      <el-form-item label="当前表字段">
-        <el-select v-model="formData.relyFile" placeholder="请选择当前表字段">
-          <el-option
-            v-for="item in orderByFieldList"
-            :key="item.fieldName"
-            :label="item.fieldDescription"
-            :value="item.tableName + '.' + item.fieldName">
-          </el-option>
-        </el-select>
-      </el-form-item> 
-      <!-- <el-form-item label="依赖方式">
-        <el-select v-model="formData.relyOption" placeholder="请选择依赖方式">
-          <el-option
-            v-for="item in relyOptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select>
-      </el-form-item> -->
-      
-      <!-- <el-form-item label="自定义依赖值" v-show="formData.relyOption === '0'">
-        <el-input v-model="formData.relayValue" placeholder="请输入依赖值"></el-input>
-      </el-form-item> -->
-      
-      <el-form-item label="依赖表">
-        <el-select
-          v-model="formData.relytableName"
-          placeholder="请选择依赖表"
-          filterable
-          @change="getrelyList"
-          class="mb10"
-        >
-          <el-option
-            v-for="item in dragTableList"
-            :key="item.dtName"
-            :label="item.dtName"
-            :value="item.dtName"
-          >
-            <span style="float: left">{{ item.dtName }}</span>
-            <span style="float: right; color: #8492a6; font-size: 13px">{{
-              item.dtTableName
-            }}</span>
-          </el-option>
-        </el-select>
-      </el-form-item>
-
-      <el-form-item label="依赖表字段">
-        <el-select
-            v-model="formData.relaykey"
-            placeholder="请选择依赖字段"
-          >
-          <el-option
-            v-for="item in dragTableFilds"
-            :key="item.keu"
-            :label="item.val"
-            :value="item.key"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script>
-import { listType } from "@/api/system/tenant/type";
-import { getDicts } from "@/api/system/dict/data";
-import { listTable, removeTableList } from "@/api/dragform/tableList";
-export default {
-  name: "StyleFormPanel",
-  dicts: ["sys_time_format", "table_statistic_type"],
-  props: {
-    subFieldList: {
-      default: [],
-      type: Array,
-    },
-    btnGroupOptions: {
-      default: [],
-      type: Array,
-    },
-    echoData:{
-      default: {},
-    }
-  },
-  components: {},
-  data() {
-    return {
-      dragTableList:[],
-      dragTableFilds:[],
-      editData:{},
-      dragTableFilds:{},
-      rules: {},
-      formData: {
-        timeFormate:'',
-        relytableName:'',
-        isAsc: false,
-        primaryKey: "",
-        btnGroupList: [],
-      },
-      relyFileds: {},
-      conditionDefaultValueMap: '',
-      relyOptions:[
-        {
-         value: '0',
-         label: '自定义依赖值'
-        },
-        {
-          value: '1',
-          label: '依赖其他字段'
-        }
-      ],
-      tableList: []
-    }
-  },
-  computed: {
-    orderByFieldList() {
-      return this.tableFieldList;
-    },
-    primaryKeyList() {
-      // console.log(this.subFieldList)
-      return this.subFieldList.filter((item) => !item.isChildren);
-    },
-    orderByFieldList() {
-      return this.subFieldList;
-    },
-    relayKeyList(){
-      return this.subFieldList.filter((item) => !item.isChildren);
-    }
-  },
-  watch: {
-    tableFieldList: {
-      handler(nval) {
-        if (!nval || !nval.length) return;
-        this.allFieldList = nval;
-        this.isShowFieldList = nval.filter((item) => item.isShow);
-        let tempList = nval.map((item) => {
-          return {
-            tableName: item.tableName,
-            tableComment: item.tableComment,
-          };
-        });
-        this.tableList = [];
-        tempList.forEach((item) => {
-          let isHas = this.tableList.find(
-            (it) => it.tableName == item.tableName
-          );
-          if (!isHas) {
-            this.tableList.push(item);
-          }
-        });
-      },
-      immediate: true,
-      deep: true,
-    },
-
-    formData:{
-      handler(nval){
-        this.$emit('subFormData', this.formData)
-      },
-      immediate: true,
-      deep: true,
-    },
-    echoData:{
-      handler(nval){
-          let {
-            menuName,
-            timeFormate,
-            orderByColumn,
-            isAsc,
-            primaryKey,
-            btnGroupList,
-            relyFile,
-            relytableName,
-            relaykey,
-            relyOption
-          } = nval.formData;
-          Object.assign(this.formData, {
-            menuName,
-            timeFormate,
-            orderByColumn,
-            isAsc,
-            primaryKey,
-            btnGroupList,
-            relyFile,
-            relytableName,
-            relaykey,
-            relyOption
-
-          });
-        
-        this.getdragTable()
-        this.getrelyList()
-        // this.editData = item;
-      },
-      // immediate: true,
-      deep: true,
-    }
-  },
-  methods: {
-    iptChange(){
-	    this.$forceUpdate();  //强制刷新
-    },
-    getdragTable(){
-       let queryParams = {
-        isEnablePaging:false,
-        dtType: 0
-      }
-      listTable(queryParams).then(res => {
-        this.dragTableList = res.rows
-      })
-    },
-    getrelyList() {
-      this.dragTableList.forEach(item => {
-        if(this.formData.relytableName == item.dtName){
-          this.dragTableFilds = JSON.parse(item.dtColumnName)
-        }
-      })
-      this.dragTableFilds.forEach(item => {
-        for(let val in item){
-          item.key = val
-          item.val = item[val]
-        }
-      })
-    },
-  },
-  async mounted() {
-    this.getdragTable()
-  },
-};
-</script>
-
-<style scoped lang="scss">
-.style-wrap {
-  .condition-table-wrap {
-    width: 100%;
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    .table-title {
-      margin-bottom: 10px;
-      font-size: 16px;
-      font-weight: 600;
-    }
-  }
-}
-</style>

+ 379 - 0
ruoyi-ui/src/views/dialogMange/components/relayTable.vue

@@ -0,0 +1,379 @@
+<template>
+  <div class="style-wrap">
+    <el-form
+      ref="formData"
+      :model="formData"
+      label-width="100px"
+      :rules="rules"
+    >
+      <el-form-item label="表格名称" prop="menuName">
+        <el-input v-model="formData.menuName" @input="iptChange()"></el-input>
+      </el-form-item>
+      <el-form-item label="时间格式" prop="timeFormate">
+        <el-select
+          @input="iptChange()"
+          v-model="formData.timeFormate"
+          placeholder="请选择时间格式"
+        >
+          <el-option
+            v-for="val in dict.type.sys_time_format"
+            :key="val.value"
+            :label="val.label"
+            :value="val.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="表格主键" prop="primaryKey">
+        <el-select
+          @input="iptChange()"
+          v-model="formData.primaryKey"
+          placeholder="请选择表格主键"
+        >
+          <el-option
+            v-for="val in primaryKeyList"
+            :key="val.fieldName"
+            :label="val.fieldDescription"
+            :value="val.fieldName"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="操作列按钮" prop="btnGroupList">
+        <el-select
+          @input="iptChange()"
+          v-model="formData.btnGroupList"
+          placeholder="请选择按钮组"
+          clearable
+          multiple
+        >
+          <el-option
+            v-for="val in btnGroupOptions"
+            :key="val.btnKey"
+            :label="val.btnGroupName"
+            :value="val.btnKey"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="排序依赖字段">
+        <el-select
+          @input="iptChange()"
+          v-model="formData.orderByColumn"
+          placeholder="请选择排序依赖"
+        >
+          <el-option
+            v-for="val in orderByFieldList"
+            :key="val.fieldName"
+            :label="val.fieldDescription"
+            :value="val.tableName + '.' + val.fieldName"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="排序方式" v-show="formData.orderByColumn">
+        <el-radio v-model="formData.isAsc" :label="false">升序</el-radio>
+        <el-radio v-model="formData.isAsc" :label="true">降序</el-radio>
+      </el-form-item>
+      <!-- <el-form-item label="当前表字段">
+        <el-select v-model="formData.relyFile" placeholder="请选择当前表字段">
+          <el-option
+            v-for="item in orderByFieldList"
+            :key="item.fieldName"
+            :label="item.fieldDescription"
+            :value="item.tableName + '.' + item.fieldName"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item> -->
+
+      <!-- <el-form-item label="依赖表格">
+        <el-select
+          v-model="formData.relytableName"
+          placeholder="请选择依赖表"
+          filterable
+          @change="getrelyList"
+          class="mb10"
+        >
+          <el-option
+            v-for="item in dragTableList"
+            :key="item.dtName"
+            :label="item.dtName"
+            :value="item.dtName"
+          >
+            <span style="float: left">{{ item.dtName }}</span>
+            <span style="float: right; color: #8492a6; font-size: 13px">{{
+              item.dtTableName
+            }}</span>
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="依赖表格字段">
+        <el-select
+            v-model="formData.relaykey"
+            placeholder="请选择依赖字段"
+          >
+          <el-option
+            v-for="item in dragTableFilds"
+            :key="item.keu"
+            :label="item.val"
+            :value="item.key"
+          ></el-option>
+        </el-select>
+      </el-form-item> -->
+
+      <!-- <el-form-item label="依赖表">
+        <el-select
+          v-model="formData.relytableName"
+          placeholder="请选择依赖表"
+          filterable
+          @change="getrelalist"
+          class="mb10"
+        >
+          <el-option
+            v-for="item in tableList"
+            :key="item.tableName"
+            :label="item.tableComment"
+            :value="item.tableName"
+          >
+            <span style="float: left">{{ item.tableComment }}</span>
+            <span style="float: right; color: #8492a6; font-size: 13px">{{
+              item.tableName
+            }}</span>
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="依赖表字段">
+        <el-select v-model="formData.relaykey" placeholder="请选择依赖字段">
+          <el-option
+            v-for="val in relayTableList"
+            :key="val.fieldName"
+            :label="val.fieldDescription"
+            :value="val.fieldName"
+          >
+            <span style="float: left">{{ val.fieldDescription }}</span>
+            <span style="float: right; color: #8492a6; font-size: 13px">{{
+              val.fieldName
+            }}</span>
+          </el-option>
+        </el-select>
+      </el-form-item> -->
+    </el-form>
+  </div>
+</template>
+
+<script>
+import { listType } from "@/api/system/tenant/type";
+import { getDicts } from "@/api/system/dict/data";
+import {
+  getFormName,
+  getListName,
+  dragTablePreview,
+} from "@/api/dragform/form.js";
+import { mapState } from "vuex";
+import { listTable, removeTableList } from "@/api/dragform/tableList";
+export default {
+  name: "StyleFormPanel",
+  dicts: ["sys_time_format", "table_statistic_type"],
+  props: {
+    subFieldList: {
+      default: [],
+      type: Array,
+    },
+    btnGroupOptions: {
+      default: [],
+      type: Array,
+    },
+    echoData: {
+      default: {},
+    },
+    tableList: {
+      default: [],
+      type: Array,
+    },
+  },
+  components: {},
+  data() {
+    return {
+      relaytableField: [],
+      dragTableList: [],
+      dragTableFilds: [],
+      rules: {},
+      formData: {
+        timeFormate: "",
+        relytableName: "",
+        isAsc: false,
+        primaryKey: "",
+        btnGroupList: [],
+      },
+      relyFileds: {},
+      relyOptions: [
+        {
+          value: "0",
+          label: "自定义依赖值",
+        },
+        {
+          value: "1",
+          label: "依赖其他字段",
+        },
+      ],
+      // tableList: [],
+    };
+  },
+  computed: {
+    ...mapState({
+      databaseName: (state) => state.user.dataSource.databaseName,
+      databaseType: (state) => state.user.dataSource.databaseType,
+      username: (state) => state.user.dataSource.username,
+      tenantId: (state) => state.user.tenant.tenantId,
+    }),
+    // 表格主鍵
+    primaryKeyList() {
+      // console.log(this.subFieldList)
+      return this.subFieldList.filter((item) => !item.isChildren);
+    },
+    // 当前表字段
+    orderByFieldList() {
+      return this.subFieldList;
+    },
+    relayKeyList() {
+      return this.subFieldList.filter((item) => !item.isChildren);
+    },
+    // 依赖表字段
+    relayTableList() {
+      return this.relaytableField.filter((item) => !item.isChildren);
+    },
+  },
+  watch: {
+    formData: {
+      handler(nval) {
+        this.$emit("subFormData", this.formData);
+      },
+      immediate: true,
+      deep: true,
+    },
+    // 回显数据
+    echoData: {
+      handler(nval) {
+        let {
+          menuName,
+          timeFormate,
+          orderByColumn,
+          isAsc,
+          primaryKey,
+          btnGroupList,
+          relyFile,
+          relytableName,
+          relaykey,
+          relyOption,
+        } = nval.formData;
+        Object.assign(this.formData, {
+          menuName,
+          timeFormate,
+          orderByColumn,
+          isAsc,
+          primaryKey,
+          btnGroupList,
+          relyFile,
+          relytableName,
+          relaykey,
+          relyOption,
+        });
+
+        this.getdragTable();
+        this.getrelyList();
+      },
+      // immediate: true,
+      deep: true,
+    },
+  },
+  methods: {
+    // 依赖表字段
+    getrelalist() {
+      if (!this.formData.relytableName) return;
+      let data = {
+        databaseName: this.databaseName,
+        databaseType: this.databaseType,
+        tableName: this.formData.relytableName,
+      };
+      let tableComment = this.getTableCommont(
+        this.formData.relytableName,
+        this.tableList
+      );
+      // 获取当前表单结构信息
+      getListName(data).then((res) => {
+        // console.log(res);
+        this.relaytableField = res.map((item, index) => {
+          return {
+            id: this.formData.relytableName + "_" + item.fieldName,
+            fieldName: item.fieldName,
+            fieldDescription: item.fieldDescription,
+            relationTable: "",
+            relationFieldName: "",
+            relaFieldNameList: [],
+            disableRelaFieldName: false,
+            relationType: "",
+            relationShowField: [],
+            relationShowFiledList: [],
+            disableRelaType: false,
+            isShow: true,
+            isSearch: false,
+            isExport: true,
+            relationTableList: this.relationTableList,
+            tableName: this.formData.relytableName,
+            tableComment,
+            relationFieldList: [],
+          };
+        });
+      });
+    },
+    iptChange() {
+      this.$forceUpdate(); //强制刷新
+    },
+    // 依赖表格
+    getdragTable() {
+      let queryParams = {
+        isEnablePaging: false,
+        dtType: 0,
+      };
+      listTable(queryParams).then((res) => {
+        this.dragTableList = res.rows;
+      });
+    },
+    // 依赖表格字段
+    getrelyList() {
+      this.dragTableList.forEach((item) => {
+        if (this.formData.relytableName == item.dtName) {
+          this.dragTableFilds = JSON.parse(item.dtColumnName);
+        }
+      });
+      this.dragTableFilds.forEach((item) => {
+        for (let val in item) {
+          item.key = val;
+          item.val = item[val];
+        }
+      });
+    },
+    // 获取当前表描述
+    getTableCommont(tableName, tableList) {
+      return tableList.find((item) => item.tableName == tableName).tableComment;
+    },
+  },
+  async mounted() {
+    this.getdragTable();
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.style-wrap {
+  .condition-table-wrap {
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    .table-title {
+      margin-bottom: 10px;
+      font-size: 16px;
+      font-weight: 600;
+    }
+  }
+}
+</style>

Diff do ficheiro suprimidas por serem muito extensas
+ 421 - 293
ruoyi-ui/src/views/dialogMange/index.vue


+ 279 - 236
ruoyi-ui/src/views/dialogMange/styleMange/tablelist.vue → ruoyi-ui/src/views/dialogMange/relayTableMange/tablelist.vue

@@ -1,139 +1,147 @@
 <template>
   <div>
     <el-card shadow="always" :body-style="{ padding: '20px' }">
-          <template #header>
-            <div>
-              <span>关联子表</span>
-            </div>
+      <template #header>
+        <div>
+          <span>关联子表</span>
+        </div>
+      </template>
+      <el-select
+        v-model="tableName"
+        placeholder="请选择数据表"
+        filterable
+        @change="getList"
+        class="mb10"
+      >
+        <el-option
+          v-for="item in tableList"
+          :key="item.tableName"
+          :label="item.tableComment"
+          :value="item.tableName"
+        >
+          <span style="float: left">{{ item.tableComment }}</span>
+          <span style="float: right; color: #8492a6; font-size: 13px">{{
+            item.tableName
+          }}</span>
+        </el-option>
+      </el-select>
+      <el-table
+        :data="tableFieldList"
+        border
+        ref="dragTable"
+        row-key="id"
+        max-height="500px"
+      >
+        >
+        <el-table-column
+          type="index"
+          label="序号"
+          width="50"
+          class-name="allowDrag"
+        >
+        </el-table-column>
+        <el-table-column prop="fieldName" label="数据字段"> </el-table-column>
+        <el-table-column prop="fieldDescription" label="字段描述">
+          <template slot-scope="scope">
+            <input
+              @input="iptChange()"
+              :class="{
+                isNullDesc:
+                  scope.row.fieldDescription == '' &&
+                  scope.row.isShow &&
+                  isInputInvalid
+                    ? true
+                    : false,
+                ipt: true,
+              }"
+              v-model="scope.row.fieldDescription"
+            />
           </template>
-          <el-select
-            v-model="tableName"
-            placeholder="请选择数据表"
-            filterable
-            @change="getList"
-            class="mb10"
-          >
-          <el-option
-            v-for="item in tableList"
-            :key="item.tableName"
-            :label="item.tableComment"
-            :value="item.tableName"
-          >
-            <span style="float: left">{{ item.tableComment }}</span>
-            <span style="float: right; color: #8492a6; font-size: 13px">{{
-              item.tableName
-            }}</span>
-          </el-option>
-          </el-select>
-          <el-table
-            :data="tableFieldList"
-            border
-            ref="dragTable"
-            row-key="id"
-            max-height="500px"
-          >
+        </el-table-column>
+        <el-table-column prop="relationTable" label="关联表">
+          <template slot-scope="scope">
+            <el-select
+              @input="iptChange()"
+              v-model="scope.row.relationTable"
+              :disabled="
+                !scope.row.relationTableList ||
+                !scope.row.relationTableList.length
+              "
+              placeholder="请选择关联的表"
+              clearable
+              filterable
+              @change="ralationTableChange(scope.row)"
             >
-            <el-table-column
-              type="index"
-              label="序号"
-              width="50"
-              class-name="allowDrag"
+              <el-option
+                v-for="item in scope.row.relationTableList"
+                :key="item.tableName"
+                :label="item.tableComment"
+                :value="item.tableName"
+              >
+                <span style="float: left">{{ item.tableComment }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{
+                  item.tableName
+                }}</span>
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column prop="relationFieldName" label="关联条件字段">
+          <template slot-scope="scope">
+            <el-select
+              v-model="scope.row.relationFieldName"
+              @change="relationFieldChange(scope.row)"
+              :disabled="!scope.row.disableRelaFieldName"
+              placeholder="关联字段"
+              filterable
+            >
+              <el-option
+                v-for="item in scope.row.relaFieldNameList"
+                :key="item.fieldName"
+                :label="item.fieldDescription"
+                :value="item.fieldName"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column prop="relationType" label="关联方式">
+          <template slot-scope="scope">
+            <el-select
+              v-model="scope.row.relationType"
+              placeholder="请选择关联方式"
+              :disabled="!scope.row.disableRelaType"
+              @change="relationTypeChangeHandler(scope.row)"
+              filterable
+            >
+              <el-option
+                v-for="item in relaTypeList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column prop="isShow" label="是否显示">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.isShow"> </el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column prop="isShowRelaDialog" label="添加依赖关系">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.isShowRelaDialog"
+              @change="isShowRelaDialogHandler(scope.row)"
             >
-            </el-table-column>
-            <el-table-column prop="fieldName" label="数据字段">
-            </el-table-column>
-            <el-table-column prop="fieldDescription" label="字段描述">
-              <template slot-scope="scope">
-                <input
-                @input="iptChange()"
-                  :class="{
-                    isNullDesc:
-                      scope.row.fieldDescription == '' &&
-                      scope.row.isShow &&
-                      isInputInvalid
-                        ? true
-                        : false,
-                    ipt: true,
-                  }"
-                  v-model="scope.row.fieldDescription"
-                />
-              </template>
-            </el-table-column>
-            <el-table-column prop="relationTable" label="关联表">
-              <template slot-scope="scope">
-                <el-select
-                @input="iptChange()"
-                  v-model="scope.row.relationTable"
-                  :disabled="
-                    !scope.row.relationTableList ||
-                    !scope.row.relationTableList.length
-                  "
-                  placeholder="请选择关联的表"
-                  clearable
-                  filterable
-                  @change="ralationTableChange(scope.row)"
-                >
-                  <el-option
-                    v-for="item in scope.row.relationTableList"
-                    :key="item.tableName"
-                    :label="item.tableComment"
-                    :value="item.tableName"
-                  >
-                    <span style="float: left">{{ item.tableComment }}</span>
-                    <span
-                      style="float: right; color: #8492a6; font-size: 13px"
-                      >{{ item.tableName }}</span
-                    >
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column prop="relationFieldName" label="关联条件字段">
-              <template slot-scope="scope">
-                <el-select
-                  v-model="scope.row.relationFieldName"
-                  @change="relationFieldChange(scope.row)"
-                  :disabled="!scope.row.disableRelaFieldName"
-                  placeholder="关联字段"
-                  filterable
-                >
-                  <el-option
-                    v-for="item in scope.row.relaFieldNameList"
-                    :key="item.fieldName"
-                    :label="item.fieldDescription"
-                    :value="item.fieldName"
-                  >
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column prop="relationType" label="关联方式">
-              <template slot-scope="scope">
-                <el-select
-                  v-model="scope.row.relationType"
-                  placeholder="请选择关联方式"
-                  :disabled="!scope.row.disableRelaType"
-                  @change="relationTypeChangeHandler(scope.row)"
-                  filterable
-                >
-                  <el-option
-                    v-for="item in relaTypeList"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column prop="isShow" label="是否显示">
-              <template slot-scope="scope">
-                <el-switch v-model="scope.row.isShow"> </el-switch>
-              </template>
-            </el-table-column>
-           
-          </el-table>
+            </el-switch>
+          </template>
+        </el-table-column>
+      </el-table>
     </el-card>
+    <!-- 添加依赖关系 -->
+    <RelayDialog ref="relayRef" @saveRelayRes="saveRelayRes"></RelayDialog>
   </div>
 </template>
 
@@ -157,7 +165,13 @@ import {
 import { getTableInfo, editTable } from "@/api/system/table.js";
 import { addDragTable } from "@/api/tablelist/commonTable.js";
 import { getParticMenu, updateMenu } from "@/api/system/menu.js";
-import { addGroup, listGroup, getTable, delGroup, updataGroup} from '@/api/relateTable/index.js'
+import {
+  addGroup,
+  listGroup,
+  getTable,
+  delGroup,
+  updataGroup,
+} from "@/api/relateTable/index.js";
 import { getMenuList, addMenu } from "@/api/menu.js";
 import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
 import { mapState } from "vuex";
@@ -166,13 +180,23 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { v4 as uuidv4 } from "uuid";
 import { listBtn } from "@/api/system/btn";
+import RelayDialog from "../components/RelayDialog.vue";
+
 export default {
   name: "SubList",
   dicts: ["sys_time_format", "table_statistic_type"],
-  props: ['menudata','echoName','echoList'],
-  components: { Queryfrom, Treeselect },
+  props: [
+    "menudata",
+    "echoName",
+    "echoList",
+    "tableList",
+    "btnGroupOptions",
+    "echoData",
+  ],
+  components: { Queryfrom, Treeselect, RelayDialog },
   data() {
     return {
+      row: {}, //记录当前行
       staictitle: "添加统计数据字段",
       isInputInvalid: false,
       // 修改表格时的menuId
@@ -194,7 +218,6 @@ export default {
       // 表格的高度
       tableKey: "",
       // tableHeight: document.documentElement.scrollHeight - 245 + "px",
-      tableList: [], //所有表格列表
       tableFieldList: [], // 当前表格字段数据
       tableName: "", // 当前表名称
 
@@ -202,17 +225,16 @@ export default {
       relationFieldList: [], //关联字段列表
       relationTypeList: [], //关联方式列表
       total: 0, //表格数据总数
-      relyOptions:[
+      relyOptions: [
         {
-         value: '0',
-         label: '自定义依赖值'
+          value: "0",
+          label: "自定义依赖值",
         },
         {
-          value: '1',
-          label: '依赖其他字段'
-        }
+          value: "1",
+          label: "依赖其他字段",
+        },
       ],
-      conditionDefaultValueMap: '',
       relyFileds: {},
       relaTypeList: [
         {
@@ -334,19 +356,22 @@ export default {
       // dragTableStyleList: [],
 
       //操作列按钮组数据
-      btnGroupOptions: [],
+      // btnGroupOptions: [],
     };
   },
   async mounted() {
-    this.getAllTable();
+    // this.getAllTable();
     this.initDragTable();
-    this.getBtnList();
-    if (this.$route.query.tId) {
-      this.tId = this.$route.query.tId;
-      this.initTableData(this.tId);
-    }
+    // this.getBtnList();
+    // if (this.$route.query.tId) {
+    //   this.tId = this.$route.query.tId;
+    //   this.initTableData(this.tId);
+    // }
   },
   computed: {
+    myEchoData() {
+      return this.echoData;
+    },
     ...mapState({
       databaseName: (state) => state.user.dataSource.databaseName,
       databaseType: (state) => state.user.dataSource.databaseType,
@@ -369,7 +394,6 @@ export default {
     primaryKeyList() {
       return this.tableFieldList.filter((item) => !item.isChildren);
     },
-
   },
   watch: {
     tableName: function (val) {
@@ -383,23 +407,29 @@ export default {
             };
           });
 
-          this.$emit('tableNameChange', 
-          this.tableName)
+        this.$emit("tableNameChange", this.tableName);
       } else {
         this.relationTableList = [];
       }
     },
-    "formData.routePath"(nval, oval) {
-      let targetMenu = this.getTargetMenu(this.menus);
-      this.menuOrderNum = targetMenu.children ? targetMenu.children.length : 0;
-    },
-    echoName: function(val){
-      if(val){
+    echoName: function (val) {
+      if (val) {
         console.log(val);
-        this.tableName = this.echoName
-        this.tableFieldList = this.echoList
+        this.tableName = this.echoName;
+        this.tableFieldList = this.echoList;
       }
-    }
+    },
+    myEchoData: {
+      handler(val) {
+        if (val) {
+          let temp = JSON.parse(val);
+          this.tableName = temp.tableName;
+          this.tableFieldList = temp.tableFieldData;
+        }
+      },
+      deep: true,
+      immediate: true,
+    },
   },
   methods: {
     /** 查询列表 */
@@ -427,7 +457,9 @@ export default {
             relationShowField: [],
             relationShowFiledList: [],
             disableRelaType: false,
-            isShow: true,
+            isShow: false,
+            isShowRelaDialog: false, //关联关系弹窗
+            relaData: {}, //关联数据
             isSearch: false,
             isExport: true,
             relationTableList: this.relationTableList,
@@ -437,12 +469,32 @@ export default {
           };
         });
 
-        this.$emit('fieldListChange', 
-          this.tableFieldList)
+        this.$emit("fieldListChange", this.tableFieldList);
 
         // console.log(this.tableFieldList);
       });
     },
+    // 依赖关系改变回调
+    isShowRelaDialogHandler(row) {
+      let isShow = row.isShowRelaDialog;
+      if (isShow) {
+        console.log(isShow);
+        this.row = row;
+        this.$refs.relayRef.openHandlder();
+      } else {
+        this.row = null;
+      }
+      console.log(row);
+    },
+    // 保存依赖结果
+    saveRelayRes(res) {
+      if (res.flag) {
+        this.row.relaData = res.data;
+      } else {
+        this.row.isShowRelaDialog = false;
+      }
+      console.log(this.tableFieldList);
+    },
     // 关联表变化回调
     async ralationTableChange(row) {
       this.tableFieldList = this.tableFieldList.filter((item) => {
@@ -492,6 +544,8 @@ export default {
           relationShowField: [],
           relationShowFiledList: [],
           disableRelaType: false,
+          isShowRelaDialog: false, //关联关系弹窗
+          relaData: {}, //关联数据
           isShow: true,
           isSearch: false,
           isExport: true,
@@ -522,24 +576,23 @@ export default {
       }
       row.disableRelaType = true;
     },
-     // 修改表格回显数据
-     async initTableData(tId) {
-      let res = await getTable({id : tId});
+    // 修改表格回显数据
+    async initTableData(tId) {
+      let res = await getTable({ id: tId });
       if (res.code == 200) {
-        let lists = res.data.dragTables
-        let groupInfo =JSON.parse(res.data.groupTableInfo)
+        let lists = res.data.dragTables;
+        let groupInfo = JSON.parse(res.data.groupTableInfo);
 
-        lists.forEach(item => {
-          if(item.tableKey == groupInfo[1].tableKey){
+        lists.forEach((item) => {
+          if (item.tableKey == groupInfo[1].tableKey) {
             let echoData = JSON.parse(item.echoData);
-              this.tableName = echoData.tableName;
-              this.tableFieldList = echoData.tableFieldData;
-
-              this.$emit('fieldListChange', this.tableFieldList)
-              this.editData = item;
+            this.tableName = echoData.tableName;
+            this.tableFieldList = echoData.tableFieldData;
+            this.$emit("fieldListChange", this.tableFieldList);
+            this.editData = item;
           }
-        })
-        console.log('info', groupInfo)
+        });
+        console.log("info", groupInfo);
       } else {
         this.$message.error("数据回显失败");
       }
@@ -561,26 +614,32 @@ export default {
           : row
       );
     },
+    // 获取表单数据
+    getTableInfo() {
+      return {
+        tableName: this.tableName,
+        fieldInfo: this.tableFieldList,
+      };
+    },
     // 多选框改变回调
     checkedChangeHandle(val) {},
     // 获取所有表格
-    async getAllTable() {
-      let data = {
-        databaseName: this.databaseName,
-        databaseType: this.databaseType,
-      };
-      let res = await getFormName(data);
-
-      const baseTable = await this.getDicts("base_table");
+    // async getAllTable() {
+    //   let data = {
+    //     databaseName: this.databaseName,
+    //     databaseType: this.databaseType,
+    //   };
+    //   let res = await getFormName(data);
 
-      this.tableList = res.data.filter((item) => {
-        return !baseTable.data.some(
-          (value) =>
-            value.dictValue.toLowerCase() == item.tableName.toLowerCase()
-        );
-      });
+    //   const baseTable = await this.getDicts("base_table");
 
-    },
+    //   this.tableList = res.data.filter((item) => {
+    //     return !baseTable.data.some(
+    //       (value) =>
+    //         value.dictValue.toLowerCase() == item.tableName.toLowerCase()
+    //     );
+    //   });
+    // },
     //处理表格行拖拽
     initDragTable() {
       const el = this.$refs.dragTable.$el.querySelectorAll(
@@ -652,31 +711,31 @@ export default {
           msg: "显示的字段数不能为空",
         };
       }
-      if (
-        tableFieldList.filter((item) => item.isExport && !item.isChildren)
-          .length == 0
-      ) {
-        return {
-          val: false,
-          msg: "导出字段中至少应有一个主表字段",
-        };
-      }
-      // 导出的字段的描述不能重复
-      let describeArr = tableFieldList
-        .filter((item) => item.isExport)
-        .map((item) => item.fieldDescription);
-      let isRepeat = false;
-      describeArr.map((item) => {
-        if (describeArr.indexOf(item) != describeArr.lastIndexOf(item)) {
-          isRepeat = true;
-        }
-      });
-      if (isRepeat) {
-        return {
-          val: false,
-          msg: "导出的字段描述不能重复",
-        };
-      }
+      // if (
+      //   tableFieldList.filter((item) => item.isExport && !item.isChildren)
+      //     .length == 0
+      // ) {
+      //   return {
+      //     val: false,
+      //     msg: "导出字段中至少应有一个主表字段",
+      //   };
+      // }
+      // // 导出的字段的描述不能重复
+      // let describeArr = tableFieldList
+      //   .filter((item) => item.isExport)
+      //   .map((item) => item.fieldDescription);
+      // let isRepeat = false;
+      // describeArr.map((item) => {
+      //   if (describeArr.indexOf(item) != describeArr.lastIndexOf(item)) {
+      //     isRepeat = true;
+      //   }
+      // });
+      // if (isRepeat) {
+      //   return {
+      //     val: false,
+      //     msg: "导出的字段描述不能重复",
+      //   };
+      // }
 
       return {
         val: true,
@@ -734,7 +793,6 @@ export default {
         );
       }
     },
-
     // 拼接查询sql语句
     getSQLStr() {
       let prefix = "{DBNAME}.";
@@ -752,9 +810,6 @@ export default {
         relaTypeArr,
         sqlType
       );
-      // if (discriISEmpty) {
-      //   return false;
-      // }
       let styleFieldList = this.$refs.styleTableRef.getStyleTableField();
       styleFieldList = styleFieldList.map((item) => {
         return `${prefix}${item}${asOrSpace}${item.replace(".", "_")}`;
@@ -827,7 +882,6 @@ export default {
       nstr = nstr.replace(nstr[0], nstr[0].toLowerCase());
       return nstr;
     },
-
     // 递归获取列表信息
     getCol(
       tableFieldList,
@@ -883,7 +937,6 @@ export default {
         this.$router.addRoutes(accessRoutes); // 动态添加可访问路由表
       });
     },
-
     // 预览结果回调
     async previewHandle() {
       this.$refs.formData.validate(async (valid) => {
@@ -959,6 +1012,7 @@ export default {
       //   }
       // });
     },
+    // 按钮数据
     getBtnMapList(tableKey) {
       let res = this.formData.btnGroupList.map((item) => {
         return {
@@ -968,7 +1022,6 @@ export default {
       });
       return res;
     },
-
     // tab切换
     tabhandleClick() {
       this.menudata = this.activeName != "menuedit" ? true : false;
@@ -1012,16 +1065,9 @@ export default {
       this.isShowAddData = false;
       this.dataCountFormData = {};
     },
-    // 确定统计
-    countHandle() {
-      addStatistic({
-        dragTableStatisticList: this.dragTableStatisticList,
-        tableSqlList: this.tableSqlList,
-        searchFieldList: this.searchFieldList,
-        dtTableName: this.tableName,
-      }).then((res) => {
-        // console.log(res)
-      });
+    // 解决回显input输入不上去bug
+    iptChange() {
+      this.$forceUpdate(); //强制刷新
     },
     // 修改统计信息
     async handleUpdateStat(row) {
@@ -1043,19 +1089,16 @@ export default {
         }
       });
     },
-
     // 获取当前表描述
     getTableCommont(tableName, tableList) {
       return tableList.find((item) => item.tableName == tableName).tableComment;
     },
-
     // 获取按钮组数据
     async getBtnList() {
       let res = await listBtn({ isEnablePaging: false, btnParentId: 0 });
       this.btnGroupOptions = res.rows;
     },
   },
-
 };
 </script>
 

+ 0 - 465
ruoyi-ui/src/views/dialogMange/styleMange/index.vue

@@ -1,465 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-form
-      :model="queryParams"
-      ref="queryForm"
-      size="small"
-      :inline="true"
-      v-show="showSearch"
-      label-width="68px"
-    >
-      <el-form-item label="样式key" prop="styleKey">
-        <el-input
-          v-model="queryParams.styleKey"
-          placeholder="请输入样式key"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="样式名称" prop="styleName">
-        <el-input
-          v-model="queryParams.styleName"
-          placeholder="请输入样式名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="样式描述" prop="styleDescription">
-        <el-input
-          v-model="queryParams.styleDescription"
-          placeholder="请输入样式描述"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建者ID" prop="createById">
-        <el-input
-          v-model="queryParams.createById"
-          placeholder="请输入创建者ID"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="更新者ID" prop="updateById">
-        <el-input
-          v-model="queryParams.updateById"
-          placeholder="请输入更新者ID"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-          >搜索</el-button
-        >
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >重置</el-button
-        >
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['system:style:add']"
-          >新增</el-button
-        >
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['system:style:edit']"
-          >修改</el-button
-        >
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['system:style:remove']"
-          >删除</el-button
-        >
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['system:style:export']"
-          >导出</el-button
-        >
-      </el-col>
-      <right-toolbar
-        :showSearch.sync="showSearch"
-        @queryTable="getList"
-      ></right-toolbar>
-    </el-row>
-
-    <el-table
-      v-loading="loading"
-      stripe
-      :data="styleList"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="编号" align="center" prop="id" />
-      <!-- <el-table-column label="样式key" align="center" prop="styleKey" /> -->
-      <el-table-column label="样式名称" align="center" prop="styleName" />
-      <el-table-column label="样式类型" align="center" prop="styleType">
-        <template slot-scope="scope">
-          {{ theGetDictLabel(scope.row.styleType, dict.type.table_style_type) }}
-        </template>
-      </el-table-column>
-      <!-- <el-table-column label="样式代码" align="center" prop="styleCode" /> -->
-      <el-table-column
-        label="样式描述"
-        align="center"
-        prop="styleDescription"
-      />
-      <!-- <el-table-column label="样式状态" align="center" prop="styleStatus" /> -->
-      <!-- <el-table-column label="创建者ID" align="center" prop="createById" />
-      <el-table-column label="更新者ID" align="center" prop="updateById" /> -->
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:style:edit']"
-            >修改</el-button
-          >
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['system:style:remove']"
-            >删除</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改动态格样式模板对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <!-- <el-form-item label="样式key" prop="styleKey">
-          <el-input v-model="form.styleKey" placeholder="请输入样式key" />
-        </el-form-item> -->
-        <el-form-item label="样式名称" prop="styleName">
-          <el-input v-model="form.styleName" placeholder="请输入样式名称" />
-        </el-form-item>
-        <el-form-item label="样式类型" prop="styleType">
-          <el-select
-            v-model="form.styleType"
-            placeholder="请选择样式类型"
-            filterable
-          >
-            <el-option
-              v-for="item in dict.type.table_style_type"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="样式代码" prop="styleCode">
-          <el-input
-            v-model="form.styleCode"
-            type="textarea"
-            placeholder="请输入内容"
-          />
-          <!-- <el-button icon="el-icon-edit" @click="drawerOpenHandler"></el-button> -->
-        </el-form-item>
-        <el-form-item label="样式描述" prop="styleDescription">
-          <el-input
-            v-model="form.styleDescription"
-            placeholder="请输入样式描述"
-          />
-        </el-form-item>
-        <!-- <el-form-item label="删除标志" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
-        </el-form-item>
-        <el-form-item label="创建者ID" prop="createById">
-          <el-input v-model="form.createById" placeholder="请输入创建者ID" />
-        </el-form-item>
-        <el-form-item label="更新者ID" prop="updateById">
-          <el-input v-model="form.updateById" placeholder="请输入更新者ID" />
-        </el-form-item> -->
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-    <el-drawer
-      :visible.sync="drawer"
-      direction="rtl"
-      :before-close="drawerHandleClose"
-      :with-header="false"
-    >
-      <div ref="container" class="monaco-container"></div>
-    </el-drawer>
-  </div>
-</template>
-
-<script>
-import {
-  listStyle,
-  getStyle,
-  delStyle,
-  addStyle,
-  updateStyle,
-} from "@/api/system/style";
-import { getDictLabel } from "@/utils/other";
-import * as monaco from "monaco-editor";
-
-export default {
-  name: "StyleMange",
-  dicts: ["table_style_type"],
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 动态格样式模板表格数据
-      styleList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        styleKey: null,
-        styleName: null,
-        styleType: null,
-        styleCode: null,
-        styleDescription: null,
-        styleStatus: null,
-        createById: null,
-        updateById: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        styleName: [
-          { required: true, message: "请输入样式名", trigger: "blur" },
-        ],
-        styleType: [
-          { required: true, message: "请选择样式类型", trigger: "change" },
-        ],
-        styleCode: [
-          { required: true, message: "请输入样式代码", trigger: "blur" },
-        ],
-        styleDescription: [
-          { required: true, message: "请输入样式样式描述", trigger: "blur" },
-        ],
-      },
-      // 代码编辑器
-      monacoEditor: null,
-      drawer: false,
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询动态格样式模板列表 */
-    getList() {
-      this.loading = true;
-      listStyle(this.queryParams).then((response) => {
-        this.styleList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        styleKey: null,
-        styleName: null,
-        styleType: null,
-        styleCode: null,
-        styleDescription: null,
-        styleStatus: null,
-        delFlag: null,
-        createBy: null,
-        createById: null,
-        createTime: null,
-        updateBy: null,
-        updateById: null,
-        updateTime: null,
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加动态格样式模板";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids;
-      getStyle(id).then((response) => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改动态格样式模板";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateStyle(this.form).then((response) => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addStyle(this.form).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal
-        .confirm('是否确认删除动态格样式模板编号为"' + ids + '"的数据项?')
-        .then(function () {
-          return delStyle(ids);
-        })
-        .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
-        })
-        .catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download(
-        "system/style/export",
-        {
-          ...this.queryParams,
-        },
-        `style_${new Date().getTime()}.xlsx`
-      );
-    },
-    theGetDictLabel(value, dictList) {
-      return getDictLabel(value, dictList);
-    },
-    // 抽屉打开回调
-    drawerOpenHandler() {
-      this.monacoEditor?.dispose();
-      this.drawer = true;
-      this.$nextTick(() => {
-        this.monacoEditor = monaco.editor.create(this.$refs.container, {
-          value: this.form.styleCode,
-          language: "css",
-          theme: "vs-dark", // 编辑器主题:vs, hc-black, or vs-dark,更多选择详见官网
-          contextmenu: false, // 禁用右键菜单
-          editorOptions: this.editorOptions, // 同codes
-        });
-      });
-    },
-    // 抽屉关闭前回调
-    drawerHandleClose(done) {
-      this.$confirm("即将关闭编辑器,是否保存代码?")
-        .then(
-          (val) => {
-            this.form.styleCode = this.monacoEditor?.getValue();
-            // this.drawer = false;
-            done();
-          },
-          (res) => {
-            // this.drawer = false;
-            done();
-          }
-        )
-        .catch(() => {});
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.monaco-container {
-  width: 100%;
-  height: 100%;
-}
-</style>

+ 495 - 0
ruoyi-ui/src/views/dialogTemplate/components/NodeInfoDialog.vue

@@ -0,0 +1,495 @@
+<template>
+  <div class="bigBox">
+    <div class="info">
+      <p class="tt">基础信息</p>
+      <div v-for="item in infoData[0]" :key="item.title">
+        <span class="titlestyle">{{ item.value }}</span>
+        <span
+          class="infostyle"
+          v-for="(val, index) in infoData[1]"
+          :key="index"
+          >{{ val[item.key] }}</span
+        >
+      </div>
+    </div>
+    <div class="tableBox">
+      <div class="top">
+        <div class="left" v-if="tableCount[0]">
+          <p>{{ tableCount[0].statisticTitle }}</p>
+          <i>{{ tableCount[0].result }}</i>
+        </div>
+        <div class="right">
+          <p>是否外协</p>
+          <el-checkbox v-model="checked"></el-checkbox>
+        </div>
+      </div>
+      <!-- 按钮组 -->
+      <el-button-group>
+        <el-button v-for="(item, index) in controlBtnArr" :key="index">
+          <template>
+            <span @click="clickHandler(item, row)"
+              ><svg-icon
+                v-if="item.btnIcon"
+                class="pre-icon"
+                slot="prefix"
+                :icon-class="item.btnIcon"
+              />{{ item.btnName }}</span
+            >
+          </template>
+        </el-button>
+      </el-button-group>
+
+      <el-form ref="tableform" :model="tableDataForm">
+        <el-table
+          border
+          :data="tableData[1].data"
+          style="width: 100%; margin-bottom: 20px"
+        >
+          <el-table-column
+            v-for="item in tableData[0].column"
+            :prop="item.key"
+            :label="item.value"
+            :key="item.value"
+            width="180"
+          >
+            <template slot-scope="scope">
+              <el-input
+                :v-if="scope.row[item.key]"
+                v-model="scope.row[item.key]"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            v-if="isShowExcuteCol"
+            label="操作"
+            align="center"
+            class-name="small-padding fixed-width"
+          >
+            <template slot-scope="scope">
+              <Menu
+                :row="scope.row"
+                v-for="btnObj in excuteBtnArr"
+                :key="btnObj.id"
+                :listAll="btnObj"
+                @excuteHandler="excuteHandler"
+              ></Menu>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <div>
+          <b>统计信息 </b>
+          <span v-for="(item, index) in subCount" :key="index"
+            >{{ item.statisticTitle }}: {{ item.result }}</span
+          >
+        </div>
+
+        <el-form-item>
+          <el-button class="addBtn" icon="el-icon-plus" @click="addBtnHandler"
+            >新增</el-button
+          >
+          <el-button
+            class="saveBtn"
+            icon="el-icon-document-checked"
+            @click="saveBtnHandler"
+            >保存</el-button
+          >
+        </el-form-item>
+      </el-form>
+
+      <div></div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  dragGroupTableInfo,
+  getProcessPopupResultInfo,
+} from "@/api/relateTable/index";
+import {
+  btnCommonApi,
+  dragTableInfo,
+  unionListTableData,
+} from "@/api/tablelist/commonTable";
+import { camelCase } from "@/utils";
+import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
+
+export default {
+  name: "NodeInfoDialog",
+  components: { Menu },
+  props: {
+    taskInfo: {
+      type: Object,
+      default: {},
+    },
+  },
+  data() {
+    return {
+      // 基础信息行数据
+      infoData: [],
+      listInfo: {},
+      // 是否外协
+      checked: false,
+      tableData: [],
+      // 动态增加表格数据
+      editData: [],
+      tableDataForm: {},
+      tableLists: [],
+      queryParams: {
+        pageNum: 1, // 第几页
+        pageSize: 10, // 每页大小
+        orderByColumn: "", // 根据某列排序
+        isAsc: "", // desc(降序)或 asc(升序)
+        // 基本查询参数
+        basicMap: {
+          tableName: "drag_form",
+        },
+        // 当前表字段筛选参数
+        queryMap: {
+          // 当前查询基本参数
+          // ... key : value         当前页面的筛选条件
+          // 超级查询的唯一值
+          queryCriteriaValue: "",
+          // tableCondition: ''
+        },
+      },
+      columns: [],
+      // 排序方式 默认降序
+      sortOrder: true,
+      tableName: "",
+      // 当前模版信息
+      templateInfo: {},
+      queryFromWhere: "",
+      condition: [],
+      // 当前点击按钮的数据
+      currentBtnData: {},
+      // 操作列 按钮数据
+      excuteBtnArr: [],
+      // 新增保存的数据
+      addListData: [],
+      controlBtnArr: [],
+    };
+  },
+  props: ["groupKey", "rowobj", "tableCount", "subCount", "subTableName"],
+  computed: {
+    isShowExcuteCol() {
+      return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
+    },
+  },
+  methods: {
+    // 新增
+    addBtnHandler() {
+      let obj = {
+        // id:'',
+      };
+      this.addListData.push(obj);
+      this.tableData[1].data.push(obj);
+    },
+    // 保存
+    saveBtnHandler() {
+      console.log(this.addListData);
+      let data = {
+        addListMap: this.addListData,
+        basicMap: {
+          btnType: 10,
+          tableName: this.subTableName,
+          visible: true,
+        },
+        commMap: {},
+        conditionMap: {},
+      };
+      btnCommonApi(data).then((res) => {
+        console.log("保存", res);
+      });
+    },
+    // 获取弹窗信息
+    async getLists(groupKey) {
+      let res = await dragGroupTableInfo({ queryMap: { groupKey: groupKey } });
+      // 获取表格tablekey 和 sort
+      this.tableLists = JSON.parse(res.msg);
+
+      this.tableLists.forEach(async (item) => {
+        // 基础信息
+        if (item.sort == 0) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
+          this.getTableHandle(res, item.sort).then((result) => {
+            console.log("result:", result);
+            this.infoData.push(result);
+            this.$set(this.infoData);
+          });
+
+          //表格数据
+        } else if (item.sort == 1) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
+          this.excuteBtnArr = res.data.resultMap.button;
+          this.getTableHandle(res, item.sort).then((result) => {
+            // 表头数据
+            this.tableData.push({
+              column: result,
+            });
+          });
+
+          // 统计状态 和 按钮
+        } else if (item.sort == 2) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
+          // 按钮
+          this.controlBtnArr = res.data.resultMap.button[0];
+          this.controlBtnArr = this.controlBtnArr.children;
+        }
+      });
+    },
+    // 获取基础信息 表头数据
+    async getTableHandle(res, sort) {
+      this.columns = [];
+      // 得到当前模版信息 --- sql columns queryWhere
+      this.templateInfo = res.data.resultMap;
+
+      // console.log(res.data.resultMap.querySql);
+      this.queryParams.orderByColumn =
+        res.data.resultMap.querySql.orderByColumn;
+
+      this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
+      // 根据拖拽时设置当前列表排列顺序
+      this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC";
+      this.tableName = this.templateInfo.template.dtTableName;
+      // 得到查询条件
+      this.queryFromWhere = res.data.resultMap.where;
+
+      //  得到当前列表信息
+      this.columns = this.columnsHandler(
+        JSON.parse(this.templateInfo.template.dtColumnName)
+      );
+      if (this.templateInfo) {
+        this.tableCondition = this.templateInfo.querySql.tableCondition;
+        this.tableCondition = this.tableCondition.split("AND");
+        // console.log(this.tableCondition);
+        this.condition = [];
+
+        // 调用查询需要携带当前table的唯一标识
+        this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+
+        this.queryParams.orderByColumn = camelCase(
+          this.queryParams.orderByColumn || ""
+        );
+        // 根据sql语句查询当前表数据
+
+        let k;
+        this.tableCondition.forEach((item, i) => {
+          let val = item.split("=");
+          if (i !== 0) {
+            k = val[0].split(".");
+            let str = k[0].trim() + "." + k[1];
+            this.condition.push({
+              key: k[0].trim(),
+              value: k[1],
+            });
+          }
+        });
+
+        this.getDataHandler(this.tableCondition[1]).then((res) => {
+          // console.log(res);
+          if (sort == 0) {
+            this.infoData.push(res);
+            // this.$set(this.infoData)
+          } else if (sort == 1) {
+            this.tableData.push({
+              data: res,
+            });
+            // this.$set(this.tableData)
+          }
+        });
+        // console.log('columns', this.columns);
+        return this.columns;
+      }
+    },
+    // 获取表数据
+    async getDataHandler(contion) {
+      let con = contion.split("=");
+      let key = con[1].trim();
+
+      let value = key.split(".");
+
+      // 拼接请求数据依赖条件
+      this.queryParams.queryMap[key] = "'" + this.rowobj[value[1]] + "'";
+
+      let tableLists = await unionListTableData(this.queryParams);
+
+      if (tableLists.code == 200) {
+        this.tableList = [];
+        tableLists.rows.forEach((item) => {
+          this.tableList.push(item.resultMap);
+        });
+
+        // 驼峰转换
+        this.tableList = this.tableList.map((item) => {
+          let kv = {};
+          for (let itemKey in item) {
+            kv[camelCase(itemKey)] = item[itemKey];
+          }
+          return kv;
+        });
+
+        return this.tableList;
+      }
+    },
+    // 处理列表信息
+    columnsHandler(columns) {
+      let resArr = [];
+      columns.forEach((item) => {
+        for (const key in item) {
+          let tempObj = {};
+          tempObj.key = camelCase(key);
+          tempObj.value = item[key];
+          resArr.push(tempObj);
+        }
+      });
+      return resArr;
+    },
+    // 操作列回调
+    excuteHandler(btnData, row) {
+      let { btnType, btnParams } = btnData;
+      this.currentBtnData = btnData;
+      switch (
+        btnType //3:内链  6:目录  7:外链  8:修改  9:删除
+      ) {
+        case "3":
+          this.routerHandler(btnData, btnType);
+          break;
+        case "7":
+          this.routerHandler(btnData, btnType);
+          break;
+        case "8":
+          this.handleUpdate(row, btnData);
+          break;
+        case "9":
+          this.handleDelete(row, btnData);
+          break;
+        default:
+          break;
+      }
+    },
+    // 内链页面跳转
+    routerHandler(btnData, type) {
+      let link = btnData.btnParams;
+      if (type == "3") {
+        this.$router.push(link);
+      } else {
+        window.open("http://" + link, "_blank");
+      }
+    },
+    // 删除
+    handleDelete(row, btnData) {},
+    // 修改
+    handleUpdate(row, btnData) {
+      console.log(row);
+    },
+    // 按钮组点击
+    clickHandler(item, row) {},
+  },
+  mounted() {
+    // this.getLists()
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.bigBox {
+  margin: auto;
+  display: flex;
+  ::v-deep .info[data-v-32a636fc] {
+    min-width: 200px !important;
+  }
+  .info {
+    margin-right: 60px;
+    .tt {
+      font-size: 18px;
+      font-weight: 700;
+    }
+    span {
+      display: inline-block;
+    }
+    .titlestyle {
+      background-color: #34bfa3;
+      /* width: 50px; */
+      display: inline-block;
+      /* height: 25px; */
+      line-height: 1;
+      padding: 5px;
+      margin-bottom: 20px;
+      margin-right: 5px;
+      text-align: center;
+      color: white;
+      border-radius: 20px;
+    }
+    .infostyle {
+      background-color: #ebedf2;
+      color: #e84e95;
+    }
+  }
+
+  .tableBox {
+    .svg-icon[data-v-c8a70580] {
+      margin-right: 5px;
+    }
+    min-width: 300px;
+    .addTable {
+      margin: 0px 0px 20px 0px;
+    }
+    .titleitem {
+      text-align: center;
+      font-size: 20px;
+      margin-top: 20px;
+    }
+    .addBtn {
+      background-color: #0275d8;
+      color: white;
+    }
+    .saveBtn {
+      background-color: #34bfa3;
+      color: white;
+    }
+    .top {
+      padding: 20px;
+      box-sizing: border-box;
+      background-color: #53b0f8;
+      display: flex;
+      justify-content: space-around;
+      color: white;
+      flex: 1;
+      /* width: 90%; */
+    }
+    .el-button-group {
+      width: 100%;
+      margin: 10px;
+      background-color: white;
+
+      .el-button:first-child {
+        color: blue;
+        border: 1px solid blue;
+      }
+      .el-button:nth-child(2) {
+        color: palevioletred;
+        border: 1px solid palevioletred;
+      }
+      .el-button:nth-child(3) {
+        color: green;
+        border: 1px solid green;
+      }
+      .el-button:last-child {
+        color: burlywood;
+        border: 1px solid burlywood;
+      }
+      .custom {
+        width: 120px;
+      }
+    }
+  }
+}
+</style>

+ 330 - 347
ruoyi-ui/src/views/dialogTemplate/components/index.vue

@@ -1,28 +1,33 @@
 <template>
   <div class="bigBox">
-   <div class="info">
-    <p class="tt">基础信息</p>
-    <div v-for="(item, index) in infoData[0]" :key="item.title">
-      <span class="titlestyle">{{ item.value }}</span>
-      <span class="infostyle" v-for="(val, index) in infoData[1]">{{ val[item.key] }}</span>
-    </div>
-   </div>
-   <div class="tableBox">
-    <div class="top">
-      <div class="left" v-if="tableCount[0]">
-        <p>{{ tableCount[0].statisticTitle }}</p>
-        <i>{{ tableCount[0].result }}</i>
-      </div>
-      <div class="right">
-        <p>是否外协</p>
-        <el-checkbox v-model="checked"></el-checkbox>
+    <div class="info">
+      <p class="tt">基础信息</p>
+      <div v-for="item in infoData[0]" :key="item.title">
+        <span class="titlestyle">{{ item.value }}</span>
+        <span
+          class="infostyle"
+          v-for="(val, index) in infoData[1]"
+          :key="index"
+          >{{ val[item.key] }}</span
+        >
       </div>
     </div>
-    <!-- 按钮组 -->
-    <el-button-group>
-      <el-button v-for="item in controlBtnArr">
-        <template>
-          <span @click="clickHandler(item, row)"
+    <div class="tableBox">
+      <div class="top">
+        <div class="left" v-if="tableCount[0]">
+          <p>{{ tableCount[0].statisticTitle }}</p>
+          <i>{{ tableCount[0].result }}</i>
+        </div>
+        <div class="right">
+          <p>是否外协</p>
+          <el-checkbox v-model="checked"></el-checkbox>
+        </div>
+      </div>
+      <!-- 按钮组 -->
+      <el-button-group>
+        <el-button v-for="(item, index) in controlBtnArr" :key="index">
+          <template>
+            <span @click="clickHandler(item, row)"
               ><svg-icon
                 v-if="item.btnIcon"
                 class="pre-icon"
@@ -30,98 +35,98 @@
                 :icon-class="item.btnIcon"
               />{{ item.btnName }}</span
             >
-        </template>
-      </el-button>
-    </el-button-group>
-    
-    <el-form ref="tableform" :model="tableDataForm">
-      <el-table
-        border
-        :data="tableData[1].data"
-        style="width: 100%; margin-bottom: 20px">
-        <el-table-column
-          v-for="item in tableData[0].column"
-          v-if="item.key !== 'id'"
-          :prop="item.key"
-          :label="item.value"
-          width="180">
-          <template slot-scope="scope" >
-            <el-input :v-if="scope.row[item.key]" v-model="scope.row[item.key]"></el-input>
           </template>
-        </el-table-column>
-        <el-table-column
+        </el-button>
+      </el-button-group>
+
+      <el-form ref="tableform" :model="tableDataForm">
+        <el-table
+          border
+          :data="tableData[1].data"
+          style="width: 100%; margin-bottom: 20px"
+        >
+          <el-table-column
+            v-for="item in tableData[0].column"
+            :prop="item.key"
+            :label="item.value"
+            :key="item.value"
+            width="180"
+          >
+            <template slot-scope="scope">
+              <el-input
+                :v-if="scope.row[item.key]"
+                v-model="scope.row[item.key]"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
             v-if="isShowExcuteCol"
             label="操作"
             align="center"
             class-name="small-padding fixed-width"
           >
+            <template slot-scope="scope">
+              <Menu
+                :row="scope.row"
+                v-for="btnObj in excuteBtnArr"
+                :key="btnObj.id"
+                :listAll="btnObj"
+                @excuteHandler="excuteHandler"
+              ></Menu>
+            </template>
+          </el-table-column>
+        </el-table>
 
-          <template slot-scope="scope">
-            <Menu
-              :row="scope.row"
-              v-for="btnObj in excuteBtnArr"
-              :key="btnObj.id"
-              :listAll="btnObj"
-              @excuteHandler="excuteHandler"
-            ></Menu>
-          </template>
-        </el-table-column>
-
-      </el-table>
+        <div>
+          <b>统计信息 </b>
+          <span v-for="(item, index) in subCount" :key="index"
+            >{{ item.statisticTitle }}: {{ item.result }}</span
+          >
+        </div>
 
-      <div>
-        <b>统计信息 </b>
-        <span v-for="item in subCount">{{ item.statisticTitle }}: {{ item.result }}</span>
-      </div>
+        <el-form-item>
+          <el-button class="addBtn" icon="el-icon-plus" @click="addBtnHandler"
+            >新增</el-button
+          >
+          <el-button
+            class="saveBtn"
+            icon="el-icon-document-checked"
+            @click="saveBtnHandler"
+            >保存</el-button
+          >
+        </el-form-item>
+      </el-form>
 
-      <el-form-item>
-        <el-button class="addBtn" icon="el-icon-plus"
-        @click="addBtnHandler"
-        >新增</el-button>
-        <el-button 
-        class="saveBtn"
-        icon="el-icon-document-checked"
-        @click="saveBtnHandler"
-        >保存</el-button>
-      </el-form-item>
-    </el-form>
-   
-    <div>
+      <div></div>
     </div>
-   </div>
   </div>
 </template>
 
 <script>
-import { dragGroupTableInfo } from "@/api/relateTable/index"
+import { dragGroupTableInfo } from "@/api/relateTable/index";
 import {
   btnCommonApi,
-  delTableData,
   dragTableInfo,
-  listTable,
   unionListTableData,
-  getInfoBySqlKey,
-  addTableData,
-  batchEdit,
-  getStatisticList
 } from "@/api/tablelist/commonTable";
-import {camelCase} from "@/utils";
+import { camelCase } from "@/utils";
 import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
+
 export default {
   components: { Menu },
-  data () {
-   return {
-    // 基础信息行数据
-    infoData: [],
-    listInfo: {},
-    // 是否外协
-    checked: false,
-    tableData: [],
-    // 动态增加表格数据
-    editData: [],
-    tableDataForm: {},
-    tableLists: [],
-    queryParams: {
+  data() {
+    return {
+      // 基础信息行数据
+      infoData: [],
+      listInfo: {},
+      // 是否外协
+      checked: false,
+      tableData: [],
+      // 动态增加表格数据
+      editData: [],
+      tableDataForm: {},
+      tableLists: [],
+      queryParams: {
         pageNum: 1, // 第几页
         pageSize: 10, // 每页大小
         orderByColumn: "", // 根据某列排序
@@ -138,196 +143,191 @@ export default {
           queryCriteriaValue: "",
           // tableCondition: ''
         },
-    },
-    columns: [],
-    // 排序方式 默认降序
-    sortOrder: true,
-    tableName: "",
-    // 当前模版信息
-    templateInfo: {},
-    queryFromWhere:'',
-    condition: [],
-    // 当前点击按钮的数据
-    currentBtnData: {},
-    // 操作列 按钮数据
-    excuteBtnArr: [],
-    // 新增保存的数据
-    addListData:[],
-    controlBtnArr: [],
-   }
- },
-  props: ['groupKey','rowobj','tableCount','subCount', 'subTableName' ],
+      },
+      columns: [],
+      // 排序方式 默认降序
+      sortOrder: true,
+      tableName: "",
+      // 当前模版信息
+      templateInfo: {},
+      queryFromWhere: "",
+      condition: [],
+      // 当前点击按钮的数据
+      currentBtnData: {},
+      // 操作列 按钮数据
+      excuteBtnArr: [],
+      // 新增保存的数据
+      addListData: [],
+      controlBtnArr: [],
+    };
+  },
+  props: ["groupKey", "rowobj", "tableCount", "subCount", "subTableName"],
   computed: {
     isShowExcuteCol() {
-      // console.log(!this.excuteBtnArr?.every((arr) => arr.children.length == 0));
-      // return true;
       return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
     },
   },
   methods: {
     // 新增
-    addBtnHandler(){
-      // if (this.editData == undefined) {
-      //   this.editData = new Array();
-      // }
-
+    addBtnHandler() {
       let obj = {
         // id:'',
-      }
-      this.addListData.push(obj)
+      };
+      this.addListData.push(obj);
       this.tableData[1].data.push(obj);
     },
     // 保存
-    saveBtnHandler(){
+    saveBtnHandler() {
       console.log(this.addListData);
       let data = {
-        addListMap:this.addListData,
-        basicMap:{
+        addListMap: this.addListData,
+        basicMap: {
           btnType: 10,
           tableName: this.subTableName,
           visible: true,
         },
         commMap: {},
         conditionMap: {},
-      }
-      btnCommonApi(data).then(res => {
-        console.log('保存', res);
-      })
+      };
+      btnCommonApi(data).then((res) => {
+        console.log("保存", res);
+      });
     },
-    async getLists(groupKey){
-      let res = await dragGroupTableInfo({queryMap: {groupKey: groupKey}})
-      this.tableLists = JSON.parse(res.msg)
-      // console.log(this.tableLists);
-
-      this.tableLists.forEach(async item => {
-        if(item.sort == 0){
+    // 获取弹窗信息
+    async getLists(groupKey) {
+      let res = await dragGroupTableInfo({ queryMap: { groupKey: groupKey } });
+      // 获取表格tablekey 和 sort
+      this.tableLists = JSON.parse(res.msg);
 
-          const res = await dragTableInfo({queryMap: {tableKey : item.tableKey }})
-          this.getTableHandle(res,item.sort).then(result => {
-            console.log('result:',result);
-            this.infoData.push(result)
-            this.$set(this.infoData)
-          })
-
-        }else if(item.sort == 1){
+      this.tableLists.forEach(async (item) => {
+        // 基础信息
+        if (item.sort == 0) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
+          this.getTableHandle(res, item.sort).then((result) => {
+            console.log("result:", result);
+            this.infoData.push(result);
+            this.$set(this.infoData);
+          });
 
-          const res = await dragTableInfo({queryMap: {tableKey : item.tableKey }})
+          //表格数据
+        } else if (item.sort == 1) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
           this.excuteBtnArr = res.data.resultMap.button;
-          this.getTableHandle(res,item.sort).then(result => {
+          this.getTableHandle(res, item.sort).then((result) => {
+            // 表头数据
             this.tableData.push({
-              column: result
-            })
-          })
-          // console.log(this.tableData);
-        }else if(item.sort == 2){
+              column: result,
+            });
+          });
 
-          const res = await dragTableInfo({queryMap: {tableKey : item.tableKey }})
-          
-          this.controlBtnArr = res.data.resultMap.button[0]
-          this.controlBtnArr = this.controlBtnArr.children
-          console.log('butt',this.controlBtnArr)
+          // 统计状态 和 按钮
+        } else if (item.sort == 2) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
+          // 按钮
+          this.controlBtnArr = res.data.resultMap.button[0];
+          this.controlBtnArr = this.controlBtnArr.children;
         }
-      })
+      });
     },
-    async getTableHandle(res,sort){
-        this.columns = []
-        // 得到当前模版信息 --- sql columns queryWhere
-        this.templateInfo = res.data.resultMap;
-      
-        // console.log(res.data.resultMap.querySql);
-        this.queryParams.orderByColumn =
-          res.data.resultMap.querySql.orderByColumn;
+    // 获取基础信息 表头数据
+    async getTableHandle(res, sort) {
+      this.columns = [];
+      // 得到当前模版信息 --- sql columns queryWhere
+      this.templateInfo = res.data.resultMap;
+
+      // console.log(res.data.resultMap.querySql);
+      this.queryParams.orderByColumn =
+        res.data.resultMap.querySql.orderByColumn;
+
+      this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
+      // 根据拖拽时设置当前列表排列顺序
+      this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC";
+      this.tableName = this.templateInfo.template.dtTableName;
+      // 得到查询条件
+      this.queryFromWhere = res.data.resultMap.where;
+
+      //  得到当前列表信息
+      this.columns = this.columnsHandler(
+        JSON.parse(this.templateInfo.template.dtColumnName)
+      );
+      if (this.templateInfo) {
+        this.tableCondition = this.templateInfo.querySql.tableCondition;
+        this.tableCondition = this.tableCondition.split("AND");
+        // console.log(this.tableCondition);
+        this.condition = [];
 
-        this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
-        // 根据拖拽时设置当前列表排列顺序
-        this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC"
-        this.tableName = this.templateInfo.template.dtTableName;
-        // 得到查询条件
-        this.queryFromWhere = res.data.resultMap.where;
-        //  得到当前列表信息
-        this.columns = this.columnsHandler(
-          JSON.parse(this.templateInfo.template.dtColumnName)
+        // 调用查询需要携带当前table的唯一标识
+        this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+
+        this.queryParams.orderByColumn = camelCase(
+          this.queryParams.orderByColumn || ""
         );
-        if (this.templateInfo !== {}) {
-            this.tableCondition = this.templateInfo.querySql.tableCondition
-            this.tableCondition = this.tableCondition.split('AND')
-            // console.log(this.tableCondition);
-            this.condition = [];
-              
-            // 调用查询需要携带当前table的唯一标识
-            this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+        // 根据sql语句查询当前表数据
 
-            this.queryParams.orderByColumn = camelCase(
-              this.queryParams.orderByColumn || ""
-            );
-            // 根据sql语句查询当前表数据
+        let k;
+        this.tableCondition.forEach((item, i) => {
+          let val = item.split("=");
+          if (i !== 0) {
+            k = val[0].split(".");
+            let str = k[0].trim() + "." + k[1];
+            this.condition.push({
+              key: k[0].trim(),
+              value: k[1],
+            });
+          }
+        });
 
-            let k;
-            this.tableCondition.forEach((item, i) => {
-              let val = item.split('=')
-              if(i!==0){
-                
-                k =val[0].split('.')
-                let str = k[0].trim() + '.' + k[1]
-                this.condition.push({
-                  key: k[0].trim(),
-                  value: k[1]
-                })
-              }
-            })
-  
-            this.getDataHandler(this.tableCondition[1]).then(res => {
-              console.log(res);
-              if(sort == 0){
-                this.infoData.push(res)
-                // this.$set(this.infoData)
-              }else if(sort ==1){
-                this.tableData.push({
-                  data: res
-                })
-                // this.$set(this.tableData)
-              }
-            })
-            // console.log('columns', this.columns);
-            return this.columns
-        }  
+        this.getDataHandler(this.tableCondition[1]).then((res) => {
+          // console.log(res);
+          if (sort == 0) {
+            this.infoData.push(res);
+            // this.$set(this.infoData)
+          } else if (sort == 1) {
+            this.tableData.push({
+              data: res,
+            });
+            // this.$set(this.tableData)
+          }
+        });
+        // console.log('columns', this.columns);
+        return this.columns;
+      }
     },
     // 获取表数据
-    async getDataHandler(contion){
-      let con = contion.split('=')
-      // console.log(con);
-      let key = con[1].trim()
-      // console.log(this.rowobj);
-      // console.log(key);
-      
-      let value = key.split('.')
+    async getDataHandler(contion) {
+      let con = contion.split("=");
+      let key = con[1].trim();
+
+      let value = key.split(".");
 
-      // console.log(value);
+      // 拼接请求数据依赖条件
       this.queryParams.queryMap[key] = "'" + this.rowobj[value[1]] + "'";
-  
-      let tableLists = await unionListTableData(this.queryParams)
-      // console.log(tableLists.rows);
-      if(tableLists.code == 200){
-          this.tableList = [];
-          tableLists.rows.forEach((item) => {
-            this.tableList.push(item.resultMap);
-          });
-        
-          // 驼峰转换
-          this.tableList = this.tableList.map((item) => {
-            let kv = {};
-            for (let itemKey in item) {
-              kv[camelCase(itemKey)] = item[itemKey];
-            }
-            return kv;
-          })
-          // console.log(this.tableList);
-          // console.log('123', this.tableList);
-          return this.tableList
 
+      let tableLists = await unionListTableData(this.queryParams);
+
+      if (tableLists.code == 200) {
+        this.tableList = [];
+        tableLists.rows.forEach((item) => {
+          this.tableList.push(item.resultMap);
+        });
+
+        // 驼峰转换
+        this.tableList = this.tableList.map((item) => {
+          let kv = {};
+          for (let itemKey in item) {
+            kv[camelCase(itemKey)] = item[itemKey];
+          }
+          return kv;
+        });
+
+        return this.tableList;
       }
-      // this.total = tableLists.total;
-      // this.loading = false; 
     },
     // 处理列表信息
     columnsHandler(columns) {
@@ -342,8 +342,8 @@ export default {
       });
       return resArr;
     },
-     // 操作列回调
-     excuteHandler(btnData, row) {
+    // 操作列回调
+    excuteHandler(btnData, row) {
       let { btnType, btnParams } = btnData;
       this.currentBtnData = btnData;
       switch (
@@ -374,129 +374,112 @@ export default {
         window.open("http://" + link, "_blank");
       }
     },
-    handleDelete(row, btnData){
-      // console.log(row, btnData);
-      // if(row.id){
-      //   this.editData.forEach((item ,index) => {
-      //     if(item.id == row.id){
-      //       this.editData.splice(index, 1);
-      //     }
-      //   })
-      // }else{
-      //   this.$message.error("请输入id");
-      // }
-    },
+    // 删除
+    handleDelete(row, btnData) {},
     // 修改
-    handleUpdate(row, btnData){
+    handleUpdate(row, btnData) {
       console.log(row);
-
     },
     // 按钮组点击
-    clickHandler(item, row){},
+    clickHandler(item, row) {},
   },
   mounted() {
     // this.getLists()
   },
-}
+};
 </script>
 
 <style scoped lang="scss">
-
-  .bigBox{
-    margin: auto;
-    display: flex;
-    ::v-deep .info[data-v-32a636fc]{
-      min-width: 200px !important;
-    }
-    .info{
-      margin-right: 60px;
-      .tt{
+.bigBox {
+  margin: auto;
+  display: flex;
+  ::v-deep .info[data-v-32a636fc] {
+    min-width: 200px !important;
+  }
+  .info {
+    margin-right: 60px;
+    .tt {
       font-size: 18px;
       font-weight: 700;
     }
-      span{
-        display: inline-block;
-      }
-      .titlestyle{
-        background-color: #34bfa3;
-        /* width: 50px; */
-        display: inline-block;
-        /* height: 25px; */
-        line-height: 1;
-        padding: 5px;
-        margin-bottom: 20px;
-        margin-right: 5px;
-        text-align: center;
-        color: white;
-        border-radius: 20px; 
-      }
-      .infostyle{
-        background-color: #ebedf2;
-        color: #e84e95;
-      }
+    span {
+      display: inline-block;
     }
+    .titlestyle {
+      background-color: #34bfa3;
+      /* width: 50px; */
+      display: inline-block;
+      /* height: 25px; */
+      line-height: 1;
+      padding: 5px;
+      margin-bottom: 20px;
+      margin-right: 5px;
+      text-align: center;
+      color: white;
+      border-radius: 20px;
+    }
+    .infostyle {
+      background-color: #ebedf2;
+      color: #e84e95;
+    }
+  }
 
-    .tableBox{
-      .svg-icon[data-v-c8a70580]{
-        margin-right: 5px;
-      }
-      min-width: 300px;
-      .addTable{
-        margin: 0px 0px 20px 0px
-      }
-      .titleitem{
-        text-align: center;
-        font-size: 20px;
-        margin-top: 20px;
+  .tableBox {
+    .svg-icon[data-v-c8a70580] {
+      margin-right: 5px;
+    }
+    min-width: 300px;
+    .addTable {
+      margin: 0px 0px 20px 0px;
+    }
+    .titleitem {
+      text-align: center;
+      font-size: 20px;
+      margin-top: 20px;
+    }
+    .addBtn {
+      background-color: #0275d8;
+      color: white;
+    }
+    .saveBtn {
+      background-color: #34bfa3;
+      color: white;
+    }
+    .top {
+      padding: 20px;
+      box-sizing: border-box;
+      background-color: #53b0f8;
+      display: flex;
+      justify-content: space-around;
+      color: white;
+      flex: 1;
+      /* width: 90%; */
+    }
+    .el-button-group {
+      width: 100%;
+      margin: 10px;
+      background-color: white;
+
+      .el-button:first-child {
+        color: blue;
+        border: 1px solid blue;
       }
-      .addBtn{
-        background-color: #0275d8;
-        color: white;
+      .el-button:nth-child(2) {
+        color: palevioletred;
+        border: 1px solid palevioletred;
       }
-      .saveBtn{
-        background-color: #34bfa3;
-        color: white;
+      .el-button:nth-child(3) {
+        color: green;
+        border: 1px solid green;
       }
-      .top{
-        padding: 20px;
-        box-sizing: border-box;
-        background-color: #53b0f8;
-        display: flex;
-        justify-content: space-around;
-        color: white;
-        flex: 1;
-        /* width: 90%; */
-      
+      .el-button:last-child {
+        color: burlywood;
+        border: 1px solid burlywood;
       }
-      .el-button-group{
-        width: 100%;
-        margin: 10px;
-        background-color: white;
-        
-        .el-button:first-child{
-          color: blue;
-          border: 1px solid blue;
-        }
-        .el-button:nth-child(2){
-          color: palevioletred;
-          border: 1px solid palevioletred;
-        }
-        .el-button:nth-child(3){
-          color:green;
-          border: 1px solid green;
-        }
-        .el-button:last-child{
-          color:burlywood;
-          border: 1px solid burlywood;
-        }
-        .custom{
-          width: 120px;
-
-        }
+      .custom {
+        width: 120px;
       }
-      
     }
-
-    
   }
+}
 </style>

+ 7 - 237
ruoyi-ui/src/views/dialogTemplate/indexTable.vue

@@ -113,24 +113,10 @@
 </template>
 
 <script>
-import { listTable, removeTableList } from "@/api/dragform/tableList";
-import { getFormName, getListName, dragTablePreview, } from "@/api/dragform/form.js";
-import { delMenu } from "@/api/system/menu";
-import { getMenuList, addMenu, getRouters} from "@/api/menu.js";
-import { getParticMenu, updateMenu } from "@/api/system/menu.js";
-import { addGroup, listGroup, getTable, delGroup, updataGroup } from '@/api/relateTable/index.js'
-import { addDragTable } from "@/api/tablelist/commonTable.js";
-import { mapGetters, mapState } from "vuex";
-import DictData from "@/components/DictData";
-import { FastBackwardFill, async } from "@/components/updateModule/k-form-design/lib/k-form-design.common";
-import { v4 as uuidv4 } from "uuid";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import json from "highlight.js/lib/languages/json";
-import { getTableInfo, editTable } from "@/api/system/table.js";
+import { listGroup, delGroup } from '@/api/relateTable/index.js'
+
 export default {
   name: "indexTable",
-  components: { Treeselect },
   dicts: ["sys_time_format", "table_statistic_type"],
   data () {
    return {
@@ -138,7 +124,6 @@ export default {
     isInputInvalid: false,
     // 表格数据
     tableData:[],
-    queryParams: {},
     showSearch: true,
     // 新增弹框
     dialogVisible: false,
@@ -154,38 +139,9 @@ export default {
     multiple: true,
     tableList: [],
      // 遮罩层
-     loading: false,
-
-     tableItemRules: [],
+    loading: false,
     total: 0,
-    // 新增弹框数据
-    tableItemForm: {
-        tId: "",
-        rowId: "",
-        title: "",
-        tableName: "",
-        selectFields: "",
-        isAsc: false,
-        timeFormate: "",
-        orderByColumn: "",
-        routePath: undefined,
-      },
     tableFieldList: [],
-        // 关联方式
-    relaTypeList: [
-      {
-        label: "等值连接",
-        value: "INNER JOIN",
-      },
-      {
-        label: "左连接",
-        value: "LEFT JOIN",
-      },
-      {
-        label: "右连接",
-        value: "RIGHT JOIN",
-      },
-      ],
     queryParams: {
         groupType: 1,
         pageNum: 1,
@@ -201,52 +157,16 @@ export default {
         spare: null,
         spare1: null,
         isSelection: null,
-      },
+    },
    }
  },
  created() {
     this.getLists();
   },
  computed: {
-    selectRelate(){
-      if(this.tableItemForm.tableName =='') return
-      return this.tableList.filter(item => item.tableName !== this.tableItemForm.tableName)
-    },
-    dataArr() {
-      return this.tableFieldList.filter((item) => item.isShow);
-    },
-    ...mapGetters(["addRoutes"]),
-    ...mapState({
-      databaseName: (state) => state.user.dataSource.databaseName,
-      databaseType: (state) => state.user.dataSource.databaseType,
-      username: (state) => state.user.dataSource.username,
-      tenantId: (state) => state.user.tenant.tenantId,
-    }),
-    orderByFieldList() {
-      return this.tableFieldList;
-    },
-  },
-  watch: {
-    'tableItemForm.tableName': function (val) {
-      if (val) {
-        this.relationTableList = this.tableList
-          .filter((item) => item.tableName != val)
-          .map((item) => {
-            return {
-              tableName: item.tableName,
-              tableComment: item.tableComment,
-            };
-          });
-      } else {
-        this.relationTableList = [];
-      }
-    },
-    'groupForm.routePath'(nval, oval) {
-      let targetMenu = this.getTargetMenu(this.menus);
-      this.menuOrderNum = targetMenu.children ? targetMenu.children.length : 0;
-    },
   },
   methods: {
+    //表格列表
     getLists(){
       this.loading = true;
       listGroup(this.queryParams).then((response) => {
@@ -256,8 +176,8 @@ export default {
       });
         
     },
-     // 删除表格组
-     DeleteTableGroup(row){
+    // 删除表格组
+    DeleteTableGroup(row){
       const fIds = row.id || this.ids;
       this.$modal
         .confirm('是否确认删除动态单编号为"' + fIds + '"的数据项?删除后表格中所有的数据都将删除!')
@@ -282,10 +202,7 @@ export default {
       this.$router.push({
         path: "/system/fromModel/index/dialogMange",
       });
-      // this.getAllTable()
-      // await this.getMenuList()
     },
-
     /** 修改按钮操作 */
     async handleUpdate(row) {
       // 兼容勾选单个的修改
@@ -296,23 +213,6 @@ export default {
         },
       });
     },
-    // 获取所有表格
-    async getAllTable() {
-      let data = {
-        databaseName: this.databaseName,
-        databaseType: this.databaseType,
-      };
-      let res = await getFormName(data);
-
-      const baseTable = await this.getDicts("base_table");
-
-      this.tableList = res.data.filter((item) => {
-        return !baseTable.data.some(
-          (value) =>
-            value.dictValue.toLowerCase() == item.tableName.toLowerCase()
-        );
-      });
-    },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map((item) => item.id);
@@ -322,124 +222,6 @@ export default {
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
-
-    // 关联表变化回调
-    async ralationTableChange(row) {
-      this.tableFieldList = this.tableFieldList.filter((item) => {
-        return !row.relationFieldList.some((val) => {
-          return val.id == item.id;
-        });
-      });
-      row.relationFieldName = "";
-      row.relationType = "";
-      row.disableRelaFieldName = false;
-      row.disableRelaType = false;
-      row.relationFieldList = [];
-      if (!row.relationTable) {
-        return;
-      }
-      // 获取关联表的字段
-      let data = {
-        databaseName: this.databaseName,
-        databaseType: this.databaseType,
-        tableName: row.relationTable,
-      };
-      let res = await getListName(data);
-      // 关联字段下拉列表数据
-      row.relaFieldNameList = res.map((item) => {
-        return {
-          fieldName: item.fieldName,
-          fieldDescription: item.fieldDescription,
-        };
-      });
-      let relationTableList = row.relationTableList.filter(
-        (item) => row.relationTable != item.tableName
-      );
-      row.relationFieldList = row.relaFieldNameList.map((item, index) => {
-        return {
-          id: row.relationTable + "_" + item.fieldName,
-          fieldName: item.fieldName,
-          fieldDescription: item.fieldDescription,
-          relationTable: "",
-          relationFieldName: "",
-          relaFieldNameList: [],
-          disableRelaFieldName: false,
-          relationType: "",
-          relationShowField: [],
-          relationShowFiledList: [],
-          disableRelaType: false,
-          isShow: true,
-          isSearch: false,
-          isExport: true,
-          relationTableList,
-          tableName: row.relationTable,
-          relationFieldList: [],
-          isChildren: true,
-        };
-      });
-      row.disableRelaFieldName = true;
-    },
-    // 关联类型变化回调
-    relationTypeChangeHandler(row) {
-      let tempRelationFieldList = row.relationFieldList.filter((item) => {
-        return !this.tableFieldList.find((val) => val.id === item.id);
-      });
-      this.tableFieldList = [...this.tableFieldList, ...tempRelationFieldList];
-    },
-    // 关联字段回调
-    relationFieldChange(row) {
-      if (!row.relationFieldName) {
-        row.relationType = "";
-        row.disableRelaType = false;
-        row.relaFieldNameList = [];
-        return;
-      }
-      row.disableRelaType = true;
-    },
-    // 递归获取列表信息
-    getCol(
-      tableFieldList,
-      columns,
-      searchFieldList = [],
-      tableExportField = {}
-    ) {
-      if (!tableFieldList.length) return;
-      for (let i = 0; i < tableFieldList.length; i++) {
-        let temp = tableFieldList[i];
-        let tempFieldName = "",
-          exportFieldName = "";
-        if (temp.isChildren) {
-          tempFieldName = temp.tableName + "_" + temp.fieldName;
-          exportFieldName = temp.tableName + "@" + temp.fieldName;
-        } else {
-          tempFieldName = temp.fieldName;
-          exportFieldName = temp.fieldName;
-        }
-        if (temp.isShow) {
-          let tempObj = {};
-          tempObj[tempFieldName] = temp.fieldDescription;
-          columns.push(tempObj);
-        }
-        if (temp.isSearch) {
-          searchFieldList.push(temp.tableName + "." + temp.fieldName);
-        }
-
-        if (temp.isExport) {
-          tableExportField[exportFieldName] = temp.fieldDescription;
-        }
-      }
-    },
-    // 获取路由表单数据
-    async getMenuList() {
-      let res = await getMenuList();
-      this.menus = this.handleTree(res.data, "menuId");
-    },
-    // 更新路由
-    reloadRouter() {
-      this.$store.dispatch("GenerateRoutes").then((accessRoutes) => {
-        this.$router.addRoutes(accessRoutes); // 动态添加可访问路由表
-      });
-    },
   }
 }
 </script>
@@ -448,11 +230,6 @@ export default {
 ::v-deep .el-dialog:not(.is-fullscreen){
   width: 900px !important;
 }
-.treeselect{  
-   .vue-treeselect{
-    width: 217px !important;
-  }
-}
 
 .ipt {
   height: 36px;
@@ -475,10 +252,3 @@ export default {
   border-color: #1890ff;
 }
 </style>
-
-<style lang="scss">
- 
-.vue-treeselect{
-  z-index: 9999 !important;
-}
-</style>

+ 63 - 32
ruoyi-ui/src/views/relateTable/components/RelateTableCard.vue

@@ -31,7 +31,6 @@
                     type="text"
                     icon="el-icon-edit"
                     @click="handleUpdate(scope.row)"
-
                   >修改
                   </el-button>
                 </el-dropdown-item>
@@ -92,10 +91,8 @@ import {
   getInfoBySqlKey,
   addTableData,
   batchEdit,
-  getStatisticList
 } from "@/api/tablelist/commonTable";
 import {inputDisableComplete} from "@/utils/other";
-import {dragGroupTableInfo} from "@/api/relateTable/index"
 
 import {camelCase} from "@/utils";
 export default {
@@ -150,9 +147,11 @@ export default {
       dtName: '',
       // 下拉框动态数据
       dynamicData: {},
+      row: null,
+      myContion:null,
+      preRow:{}
     };
   },
-
   computed: {
     // currentValues
     cardDataWatcher: function(){
@@ -194,11 +193,12 @@ export default {
   mounted() {
   },
   methods: {
-    // 请求数据
+    // 根据tablekey请求数据表头数据
     async gettableListHandler(tableKey, paramsContion = [], defaultVal ={}){
       const res = await dragTableInfo({queryMap: {tableKey : tableKey }})
       this.getTableHandle(res, paramsContion = [],defaultVal = {})
     },
+    // 处理表格表头
     async getTableHandle(res){
         this.columns = []
         // 得到当前模版信息 --- sql columns queryWhere
@@ -213,12 +213,12 @@ export default {
 
         // 得到查询条件
         this.queryFromWhere = res.data.resultMap.where;
-        //  得到当前列表信息
+        //  得到当前列表表头信息
         this.columns = this.columnsHandler(
           JSON.parse(this.templateInfo.template.dtColumnName)
         );
       
-        if (this.templateInfo !== {}) {
+        if (this.templateInfo) {
             this.tableCondition = this.templateInfo.querySql.tableCondition
             this.tableCondition = this.tableCondition.split('AND')
 
@@ -231,15 +231,21 @@ export default {
               this.queryParams.orderByColumn || ""
             );
             // 根据sql语句查询当前表数据
-           
-            if(this.newsort == 0){
-              this.getDataHandler()
-              // this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+            this.contion = this.templateInfo.template.dtTableName + '.' + this.templateInfo.template.primaryKey
+
+            this.$nextTick(async ()=>{
+              if(this.newsort == 0){
+                // 第一张表请求表数据不需要条件
+             await this.getDataHandler()
+            }else{
+              if(this.myContion){
+                await this.getDataHandler(this.myContion,this.preRow)
+              }
             }
-            let k;
+            })
             
-            // console.log('conditions', this.tableCondition);
-           this.contion = this.templateInfo.template.dtTableName + '.' + this.templateInfo.template.primaryKey
+            //处理三张不同表的依赖关系
+            // let k;
             // this.tableCondition.forEach((item, i) => {
             //   let val = item.split('=')
             //   if(i!==0){
@@ -255,26 +261,28 @@ export default {
             
         }  
     },
-    // 获取表数据
+    // 获取表数据
     async getDataHandler(contion, list){
       // console.log(contion);
+      this.myContion=contion;
+      this.preRow=list;
       // console.log(list);
+      // 处理请求下一张表数据的依赖条件
       if(contion){
         let key = contion.split('.')
         this.queryParams.queryMap['#{' + contion] = "'" + list[key[1]] + "'";
       }
       this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
       
-      // contion?.forEach(item => {
-      //   this.queryParams.queryMap['#{' + item.key + '.' + item.value] = "'" + list[item.value] + "'";
-      // })
       this.tableList = [];
       let tableLists = await unionListTableData(this.queryParams)
       if(tableLists.code == 200){
-         
-          tableLists.rows.forEach((item) => {
-            this.tableList.push(item.resultMap);
-          });
+        // 默认根据这张表的第一条数据请求下一张表的数据
+        this.$emit('getDefaultCardData', this.index)
+
+        tableLists.rows.forEach((item) => {
+          this.tableList.push(item.resultMap);
+        });
         
           // 驼峰转换
           this.tableList = this.tableList.map((item) => {
@@ -304,6 +312,7 @@ export default {
     },
     // 调用父组件方法更新表格数据
     handleCurrentChange(row,event,column,val) {
+      this.row = row
       // console.log(row);
       this.$emit(
         "updateData",
@@ -334,6 +343,14 @@ export default {
         });
       });
     },
+    // 下一表数据
+    getNextCardData(){
+      this.handleCurrentChange(this.row)
+    },
+    // 根据表格第一条数据请求下一个表格的数据
+    getDefaultCard(){
+      this.handleCurrentChange(this.tableList[0])
+    },
     // 使用提交数据类型的按钮获取数据
     tempSubBtn(getData) {
       getData()
@@ -344,8 +361,8 @@ export default {
           console.log("验证未通过,获取失败");
         });
     },
-     //提交编辑结果按钮回调
-     editConfirmHandler() {
+    //提交编辑结果按钮回调
+    editConfirmHandler() {
       this.$refs.addFromRef
         .getData()
         .then(async (values) => {
@@ -388,38 +405,52 @@ export default {
               this.$modal.msgError("添加失败");
             }
           }
-          this.tableList = []
-          this.gettableListHandler(this.tableKey)
+          // this.tableList = []
+          if(this.index == 0){
+            this.getDataHandler()
+          } else {
+            // 判断修改是否点击了上一表格的数据
+            if(this.row){
+              this.$emit('getChildData', this.index)
+            } else {
+              this.$emit('getEditHandle', this.index)
+            }
+          }
           this.defaultValue = {};
           this.open = false;
+
         })
         .catch((res) => {
-          console.log(res)
           this.$modal.msgError("表单校验失败,请规范填写数据");
         });
     },
     // 取消按钮
     cancel() {
       this.open = false;
+      this.defaultVal = {}
       // this.reset();
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      console.log(row)
+      let obj = {}
+      for(let key in row) {
+        let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase();
+        obj[modifiedTable] = row[key];
+      }
+
       getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({data}) => {
         if (!data || !data.dfVueTemplate) {
           this.$message.error("当前表格未绑定表单!");
           return;
         }
-        Object.assign(this.defaultValue, row);
-
-        // console.log('123', this.defaultValue)
+        Object.assign(this.defaultValue, obj);
+        // console.log(this.defaultValue)
         this.jsonData = JSON.parse(data.dfVueTemplate);
         this.open = true;
         this.title = "修改信息";
         // this.form.password = this.initPassword;
         this.$nextTick(() => {
-          this.$refs.addFromRef.setData(row);
+          this.$refs.addFromRef.setData(obj);
         });
       });
       return;

Diff do ficheiro suprimidas por serem muito extensas
+ 425 - 361
ruoyi-ui/src/views/relateTable/index.vue


+ 0 - 1685
ruoyi-ui/src/views/relateTable/relateMange.vue

@@ -1,1685 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-row :gutter="20">
-      <el-col :span="18" :class="{ edit: menudata }">
-        <el-card shadow="always" :body-style="{ padding: '20px' }">
-          <template #header>
-            <div>
-              <span>字段编辑</span>
-            </div>
-          </template>
-          <!-- <Queryfrom
-            :form-vals="checkedWhere"
-            @getList="getList"
-            ref="mychild"
-          /> -->
-          <el-select
-            v-model="tableName"
-            placeholder="请选择数据表"
-            filterable
-            @change="getList"
-            class="mb10"
-          >
-            <el-option
-              v-for="item in tableList"
-              :key="item.tableName"
-              :label="item.tableComment"
-              :value="item.tableName"
-            >
-              <span style="float: left">{{ item.tableComment }}</span>
-              <span style="float: right; color: #8492a6; font-size: 13px">{{
-                item.tableName
-              }}</span>
-            </el-option>
-          </el-select>
-          <el-table
-            :data="tableFieldList"
-            border
-            ref="dragTable"
-            row-key="id"
-            max-height="500px"
-          >
-            
-            <el-table-column
-              type="index"
-              label="序号"
-              width="50"
-              class-name="allowDrag"
-            >
-            </el-table-column>
-            <el-table-column prop="fieldName" label="数据字段">
-            </el-table-column>
-            <el-table-column prop="fieldDescription" label="字段描述">
-              <template slot-scope="scope">
-                <input
-                  :class="{
-                    isNullDesc:
-                      scope.row.fieldDescription == '' &&
-                      scope.row.isShow &&
-                      isInputInvalid
-                        ? true
-                        : false,
-                    ipt: true,
-                  }"
-                  v-model="scope.row.fieldDescription"
-                />
-              </template>
-            </el-table-column>
-            <el-table-column prop="relationTable" label="关联表">
-              <template slot-scope="scope">
-                <el-select
-                  v-model="scope.row.relationTable"
-                  :disabled="
-                    !scope.row.relationTableList ||
-                    !scope.row.relationTableList.length
-                  "
-                  placeholder="请选择关联的表"
-                  clearable
-                  filterable
-                  @change="ralationTableChange(scope.row)"
-                >
-                  <el-option
-                    v-for="item in scope.row.relationTableList"
-                    :key="item.tableName"
-                    :label="item.tableComment"
-                    :value="item.tableName"
-                  >
-                    <span style="float: left">{{ item.tableComment }}</span>
-                    <span
-                      style="float: right; color: #8492a6; font-size: 13px"
-                      >{{ item.tableName }}</span
-                    >
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column prop="relationFieldName" label="关联条件字段">
-              <template slot-scope="scope">
-                <el-select
-                  v-model="scope.row.relationFieldName"
-                  @change="relationFieldChange(scope.row)"
-                  :disabled="!scope.row.disableRelaFieldName"
-                  placeholder="关联字段"
-                  filterable
-                >
-                  <el-option
-                    v-for="item in scope.row.relaFieldNameList"
-                    :key="item.fieldName"
-                    :label="item.fieldDescription"
-                    :value="item.fieldName"
-                  >
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column prop="isShow" label="是否显示">
-              <template slot-scope="scope">
-                <el-switch v-model="scope.row.isShow"> </el-switch>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-card>
-      </el-col>
-      <el-col :span="6" :class="{ menudata: menudata }">
-        <el-tabs v-model="activeName" @tab-click="tabhandleClick">
-          <el-tab-pane label="菜单编辑" name="menuedit">
-            <el-card shadow="always" :body-style="{ padding: '10px' }">
-              <!-- <template #header>
-                <div>
-                  <span>菜单编辑</span>
-                </div>
-              </template> -->
-              <el-form
-                ref="formData"
-                :model="formData"
-                label-width="100px"
-                :rules="rules"
-              >
-                <el-form-item label="菜单名称" prop="menuName">
-                  <el-input v-model="formData.menuName"></el-input>
-                </el-form-item>
-                <el-form-item label="菜单路由" prop="routePath">
-                  <!-- <el-select v-model="formData.routePath" placeholder="请选择路由">
-                    <el-option label="区域一" value="shanghai"></el-option>
-                    <el-option label="区域二" value="beijing"></el-option>
-                  </el-select> -->
-                  <treeselect
-                    :append-to-body="true"
-                    v-model="formData.routePath"
-                    :options="menus"
-                    :normalizer="normalizer"
-                    @change="treeSelectChange"
-                    :show-count="true"
-                    placeholder="请选择父级路由"
-                  />
-                </el-form-item>
-                <el-form-item label="是否显示列表" v-if="false">
-                  <el-switch v-model="formData.isShowList"></el-switch>
-                </el-form-item>
-                <el-form-item label="时间格式" prop="timeFormate">
-                  <el-select
-                    v-model="formData.timeFormate"
-                    placeholder="请选择时间格式"
-                  >
-                    <el-option
-                      v-for="val in dict.type.sys_time_format"
-                      :key="val.value"
-                      :label="val.label"
-                      :value="val.value"
-                    ></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="表格主键" prop="primaryKey">
-                  <el-select
-                    v-model="formData.primaryKey"
-                    placeholder="请选择表格主键"
-                  >
-                    <el-option
-                      v-for="val in primaryKeyList"
-                      :key="val.fieldName"
-                      :label="val.fieldDescription"
-                      :value="val.fieldName"
-                    ></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="排序依赖字段">
-                  <el-select
-                    v-model="formData.orderByColumn"
-                    placeholder="请选择排序依赖"
-                  >
-                    <el-option
-                      v-for="val in orderByFieldList"
-                      :key="val.fieldName"
-                      :label="val.fieldDescription"
-                      :value="val.tableName + '.' + val.fieldName"
-                    ></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="排序方式" v-show="formData.orderByColumn">
-                  <el-radio v-model="formData.isAsc" :label="false"
-                    >升序</el-radio
-                  >
-                  <el-radio v-model="formData.isAsc" :label="true"
-                    >降序</el-radio
-                  >
-                </el-form-item>
-                <el-form-item>
-                  <el-button size="mini" @click="previewHandle">预览</el-button>
-                  <el-button size="mini" type="primary" @click="createHandle">{{
-                    tId ? "确认修改" : "确认创建"
-                  }}</el-button>
-                </el-form-item>
-              </el-form>
-            </el-card>
-          </el-tab-pane>
-        </el-tabs>
-      </el-col>
-    </el-row>
-
-    <el-dialog title="效果预览" :visible.sync="isShowPreview" width="50%">
-      <div class="cardBox">
-        <el-card
-          shadow="hover"
-          :body-style="{ padding: '20px' }"
-          class="card"
-          v-for="(item, index) in deepragTableStatisticList"
-          :key="index"
-        >
-          <el-tooltip
-            class="item"
-            effect="dark"
-            :content="item.statisticTitle"
-            placement="top-start"
-          >
-            <div class="title">{{ item.statisticTitle ? item.statisticTitle : item.statisticDescription}}</div>
-          </el-tooltip>
-
-          <!-- <el-tooltip
-            class="item"
-            effect="dark"
-            :content="item.statisticDescription"
-            placement="top-start"
-          >
-            <div class="description">{{ item.statisticDescription }}</div>
-          </el-tooltip> -->
-
-          <div class="type">
-            <!-- <div class="statisticType">{{ item.statisticType }}</div> -->
-            <div class="count">统计结果</div>
-          </div>
-        </el-card>
-      </div>
-
-      <el-row :gutter="10" class="mb8">
-        <el-col :span="18">
-          <el-input placeholder="请输入" clearable />
-        </el-col>
-
-        <el-col :span="6" class="previewbtn">
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            size="small"
-            @click="() => {}"
-            >搜索</el-button
-          >
-          <el-button icon="el-icon-refresh" size="small" @click="() => {}"
-            >重置</el-button
-          >
-        </el-col>
-      </el-row>
-
-      <el-row :gutter="10" class="mb8">
-        <el-col :span="1.5">
-          <el-button
-            type="primary"
-            plain
-            icon="el-icon-plus"
-            size="mini"
-            @click="() => {}"
-            >新增
-          </el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            type="success"
-            plain
-            icon="el-icon-edit"
-            size="mini"
-            :disabled="false"
-            @click="() => {}"
-            >修改
-          </el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            type="danger"
-            plain
-            icon="el-icon-delete"
-            size="mini"
-            :disabled="false"
-            @click="() => {}"
-            >删除
-          </el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button plain icon="el-icon-upload2" size="mini" @click="() => {}"
-            >导入
-          </el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            type="warning"
-            plain
-            icon="el-icon-download"
-            size="mini"
-            @click="() => {}"
-            >导出
-          </el-button>
-        </el-col>
-        <!-- <right-toolbar
-          showSearch.sync="true"
-          @queryTable="() => {}"
-        ></right-toolbar> -->
-      </el-row>
-      <el-table :data="tableDataList" @selection-change="() => {}">
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-        ></el-table-column>
-        <!-- <span v-for="(key, val) in columns" :key="key">
-          <el-table-column :label="key" align="center" :prop="val" />
-        </span> -->
-        <el-table-column
-          v-for="item in columns"
-          :key="item.key + item.value"
-          :label="item.value"
-          align="center"
-          :prop="toUpperCase(item.key)"
-        />
-        <el-table-column
-          label="操作"
-          align="center"
-          class-name="small-padding fixed-width"
-        >
-          <!-- <template slot-scope="scope"> -->
-          <template>
-            <!-- <el-button
-              size="mini"
-              type="text"
-              icon="el-icon-edit"
-              @click="() => {}"
-              >修改
-            </el-button>
-            <el-button
-              size="mini"
-              type="text"
-              icon="el-icon-delete"
-              @click="() => {}"
-              >删除
-            </el-button> -->
-            <el-dropdown>
-              <el-button type="warning" plain size="small">
-                处理<i class="el-icon-arrow-down el-icon--right"></i>
-              </el-button>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item
-                  ><el-button
-                    size="mini"
-                    type="text"
-                    icon="el-icon-edit"
-                    @click="() => {}"
-                    >修改</el-button
-                  ></el-dropdown-item
-                >
-                <el-dropdown-item
-                  ><el-button
-                    size="mini"
-                    type="text"
-                    icon="el-icon-delete"
-                    @click="() => {}"
-                    >删除</el-button
-                  >
-                </el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination
-        v-show="total > 0"
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="pageList"
-      />
-      <template #footer>
-        <span>
-          <el-button @click="isShowPreview = false">关闭</el-button>
-          <el-button type="primary" @click="createHandle">{{
-            tId ? "确认修改" : "确认创建"
-          }}</el-button>
-        </span>
-      </template>
-    </el-dialog>
-
-    <!-- 添加数据统计对话框 -->
-    <el-dialog
-      :title="staictitle"
-      :visible.sync="isShowAddData"
-      width="30%">
-      
-      <el-form 
-      label-width="100px" 
-      :model="dataCountFormData">
-        <el-form-item label="统计标题" prop="statisticTitle">
-          <el-input v-model="dataCountFormData.statisticTitle"></el-input>
-        </el-form-item>
-
-        <el-form-item label="统计数据">
-          <el-select
-            v-model="dataCountFormData.statisticField"
-            placeholder="请选择统计字段"
-          >
-            <el-option
-              v-for="item in dataArr"
-              :key="item.id"
-              :label="item.fieldName"
-              :value="item.tableName + '.'  + item.fieldName"
-            >
-            <span style="float: left;margin-right: 5px">{{ item.tableName }}  </span>
-            <span style="float: right; color: #8492a6; font-size: 13px">{{ item.fieldName }}</span>
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <!-- <el-form-item label="类型">
-          <el-select v-model="dataCountFormData.type" placeholder="请选择类型">
-            <el-option label="数量" value="num"></el-option>
-            <el-option label="状态" value="status"></el-option> -->
-        <el-form-item label="统计类型">
-          <el-select 
-          v-model="dataCountFormData.statisticType" 
-          placeholder="请选择统计类型">
-            <el-option v-for="item in dataType" :key="item.dictCode" :label="item.dictLabel" :value="item.dictValue"></el-option>
-            <!-- <el-option label="状态" value="status"></el-option> -->
-          </el-select>
-        </el-form-item>
-
-        <el-form-item label="统计描述" prop="statisticDescription">
-          <el-input v-model="dataCountFormData.statisticDescription"></el-input>
-        </el-form-item>
-        <el-form-item label="统计对象" prop="statisticObject">
-          <el-input v-model="dataCountFormData.statisticObject"></el-input>
-        </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="closeAddDialog">取 消</el-button>
-        <el-button v-if="staictitle == '修改统计数据字段'" type="primary" @click="upadtaData">确 定</el-button>
-
-        <el-button v-else type="primary" @click="addData">确 定</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import {
-  delTableData,
-  dragTableInfo,
-  listTable,
-  unionListTableData,
-  getInfoBySqlKey,
-  addTableData,
-  addStatistic,
-  updateStatistic
-} from "@/api/tablelist/commonTable";
-import { getDicts } from "@/api/system/dict/data";
-import {
-  getFormName,
-  getListName,
-  dragTablePreview,
-} from "@/api/dragform/form.js";
-import { getTableInfo, editTable } from "@/api/system/table.js";
-import { addDragTable } from "@/api/tablelist/commonTable.js";
-import { getParticMenu, updateMenu } from "@/api/system/menu.js";
-import { getMenuList, addMenu } from "@/api/menu.js";
-import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
-import { mapState } from "vuex";
-import Sortable from "sortablejs";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import { v4 as uuidv4 } from "uuid";
-export default {
-  name: "tableMange",
-  dicts: ["sys_time_format", "table_statistic_type"],
-  props: [],
-  components: { Queryfrom, Treeselect },
-  data() {
-    return {
-      staictitle: '添加统计数据字段',
-      isInputInvalid: false,
-      // 修改表格时的menuId
-      menuId: "",
-      // 修改表格的id
-      tId: "",
-      // 当前模板信息
-      templateInfo: {},
-      // 排序方式 默认降序
-      sortState: true,
-      // 列信息
-      columns: {},
-      // 查询条件
-      queryFromWhere: {},
-      // 当前table唯一标识
-      sqlKey: "",
-      // 动态数据sqlkey
-      staticSqlKey: '',
-      // 表格的高度
-      tableKey: "",
-      // tableHeight: document.documentElement.scrollHeight - 245 + "px",
-      tableList: [], //所有表格列表
-      tableFieldList: [], // 当前表格字段数据
-      tableName: "", // 当前表名称
-
-      relationTableList: [], //关联表格列表
-      relationFieldList: [], //关联字段列表
-      relationTypeList: [], //关联方式列表
-      total: 0, //表格数据总数
-      relaTypeList: [
-        {
-          label: "等值连接",
-          value: "INNER JOIN",
-        },
-        {
-          label: "左连接",
-          value: "LEFT JOIN",
-        },
-        {
-          label: "右连接",
-          value: "RIGHT JOIN",
-        },
-      ],
-      headerList: [
-        {
-          prop: "fieldName",
-          label: "数据字段",
-        },
-        {
-          prop: "fieldDescription",
-          label: "字段描述",
-        },
-        {
-          prop: "relationTable",
-          label: "关联表",
-        },
-        {
-          prop: "relationFieldName",
-          label: "关联字段",
-        },
-        {
-          prop: "relationType",
-          label: "关联方式",
-        },
-        {
-          prop: "isShow",
-          label: "是否显示",
-        },
-        {
-          prop: "isSearch",
-          label: "是否包含查询",
-        },
-        {
-          prop: "isExport",
-          label: "是否导出",
-        },
-        {
-          prop: "isCount",
-          label: "是否统计",
-        },
-      ], //表头列表
-
-      // 右侧筛选条件勾选数据
-      // checkedList: [], //勾选的查询框
-      // checkedWhere:[],//需要渲染的查询表单
-
-      // 右侧表单编辑
-      formData: {
-        menuName: "",
-        routePath: undefined,
-        isShowList: true,
-        timeFormate: "",
-        orderByColumn: "",
-        isAsc: false,
-        primaryKey: "",
-      },
-      rules: {
-        menuName: [
-          { required: true, message: "请输入菜单名称", trigger: "blur" },
-        ],
-        routePath: [
-          { required: true, message: "请选择路由", trigger: "change" },
-        ],
-        timeFormate: [
-          { required: true, message: "请选择时间格式", trigger: "change" },
-        ],
-        primaryKey: [
-          { required: true, message: "请选择表格主键", trigger: "blur" },
-        ],
-        fieldDescription: [
-          { required: true, message: "请输入字段描述", trigger: "blur" },
-        ],
-      },
-      menus: [], //路由列表数据
-
-      // 预览弹窗相关
-      isShowPreview: false, //弹窗显示与隐藏
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        orderByColumn: "",
-        isAsc: false,
-        basicMap: {
-          sql: "",
-        },
-      },
-      loading: false, //表格加载
-      tableDataList: [], //数据
-      editData: {},
-      menuOrderNum: 0,
-      // tab动态切换
-      activeName: "menuedit",
-      // 数据统计对象
-      dataCountFormData: {},
-      // 添加数据统计表格
-      dragTableStatisticList: [],
-      deepragTableStatisticList:[],
-      tableSqlList: [],
-      searchFieldList: [],
-      // 是否切换到数据统计
-      menudata: false,
-      // 显示添加字段对话框
-      isShowAddData: false,
-      dataType : [],
-      uuid: '',
-    };
-  },
-  computed: {
-    // 数据字段
-    dataArr() {
-      return this.tableFieldList.filter((item) => item.isShow);
-    },
-    ...mapState({
-      databaseName: (state) => state.user.dataSource.databaseName,
-      databaseType: (state) => state.user.dataSource.databaseType,
-      username: (state) => state.user.dataSource.username,
-    }),
-    searchArr() {
-      if (!this.templateInfo?.where?.length) return [];
-      return this.templateInfo.where.map((item) => item.conditionName);
-    },
-    checkedWhere() {
-      if (!this.templateInfo?.where?.length) return [];
-      return this.templateInfo?.where.filter((item) => {
-        return this.checkedList.includes(item.conditionName);
-      });
-    },
-    orderByFieldList() {
-      // return this.tableFieldList.filter((item) => item.isShow);
-      return this.tableFieldList;
-    },
-    primaryKeyList() {
-      return this.tableFieldList.filter((item) => !item.isChildren);
-    },
-    // menuOrderNum() {
-    //   if (!this.formData.routePath) return 0;
-    //   let targetMenu = this.getTargetMenu(this.menus);
-    //   console.log(targetMenu);
-    //   if (targetMenu.children?.length) {
-    //     return targetMenu.children.length;
-    //   } else {
-    //     return 0;
-    //   }
-    // },
-  },
-  watch: {
-    tableName: function (val) {
-      if (val) {
-        this.relationTableList = this.tableList
-          .filter((item) => item.tableName != val)
-          .map((item) => {
-            return {
-              tableName: item.tableName,
-              tableComment: item.tableComment,
-            };
-          });
-      } else {
-        this.relationTableList = [];
-      }
-    },
-    "formData.routePath"(nval, oval) {
-      let targetMenu = this.getTargetMenu(this.menus);
-      this.menuOrderNum = targetMenu.children ? targetMenu.children.length : 0;
-    },
-  },
-  methods: {
-    // 字段描述验证规则
-    // blurval(value){
-    //   this.isInputInvalid = value == '' ?  true : false;
-    // },
-    // 树形控件change回调
-    treeSelectChange(val) {
-      //没有change事件
-      console.log("val", val);
-    },
-    // 获取目标menu
-    getTargetMenu(menus) {
-      for (let i = 0; i < menus.length; i++) {
-        if (menus[i].menuId == this.formData.routePath) {
-          return menus[i];
-        } else if (menus.children?.length) {
-          return this.getTargetMenu(menus.children);
-        }
-      }
-      return false;
-    },
-
-    /** 查询列表 */
-    getList(queryParams) {
-      if (!this.tableName) return;
-      let data = {
-        databaseName: this.databaseName,
-        databaseType: this.databaseType,
-        tableName: this.tableName,
-      };
-      console.log(data);
-      // 获取当前表单结构信息
-      getListName(data).then((res) => {
-        // console.log(res);
-        this.tableFieldList = res.map((item, index) => {
-          return {
-            id: this.tableName + "_" + item.fieldName,
-            fieldName: item.fieldName,
-            fieldDescription: item.fieldDescription,
-            relationTable: "",
-            relationFieldName: "",
-            relaFieldNameList: [],
-            disableRelaFieldName: false,
-            relationType: "",
-            relationShowField: [],
-            relationShowFiledList: [],
-            disableRelaType: false,
-            isShow: true,
-            isSearch: false,
-            isExport: true,
-            relationTableList: this.relationTableList,
-            tableName: this.tableName,
-            relationFieldList: [],
-          };
-        });
-        // console.log(this.tableFieldList);
-      });
-    },
-    // 关联表变化回调
-    async ralationTableChange(row) {
-      this.tableFieldList = this.tableFieldList.filter((item) => {
-        return !row.relationFieldList.some((val) => {
-          return val.id == item.id;
-        });
-      });
-      row.relationFieldName = "";
-      row.relationType = "";
-      row.disableRelaFieldName = false;
-      row.disableRelaType = false;
-      row.relationFieldList = [];
-      if (!row.relationTable) {
-        return;
-      }
-      // 获取关联表的字段
-      let data = {
-        databaseName: this.databaseName,
-        databaseType: this.databaseType,
-        tableName: row.relationTable,
-      };
-      let res = await getListName(data);
-      // 关联字段下拉列表数据
-      row.relaFieldNameList = res.map((item) => {
-        return {
-          fieldName: item.fieldName,
-          fieldDescription: item.fieldDescription,
-        };
-      });
-      let relationTableList = row.relationTableList.filter(
-        (item) => row.relationTable != item.tableName
-      );
-      row.relationFieldList = row.relaFieldNameList.map((item, index) => {
-        return {
-          id: row.relationTable + "_" + item.fieldName,
-          fieldName: item.fieldName,
-          fieldDescription: item.fieldDescription,
-          relationTable: "",
-          relationFieldName: "",
-          relaFieldNameList: [],
-          disableRelaFieldName: false,
-          relationType: "",
-          relationShowField: [],
-          relationShowFiledList: [],
-          disableRelaType: false,
-          isShow: true,
-          isSearch: false,
-          isExport: true,
-          relationTableList,
-          tableName: row.relationTable,
-          relationFieldList: [],
-          isChildren: true,
-        };
-      });
-      // this.tableFieldList = [...this.tableFieldList, ...row.relationFieldList];
-      row.disableRelaFieldName = true;
-    },
-    // 关联类型变化回调
-    relationTypeChangeHandler(row) {
-      let tempRelationFieldList = row.relationFieldList.filter((item) => {
-        return !this.tableFieldList.find((val) => val.id === item.id);
-      });
-      this.tableFieldList = [...this.tableFieldList, ...tempRelationFieldList];
-    },
-    // 关联字段回调
-    relationFieldChange(row) {
-      if (!row.relationFieldName) {
-        row.relationType = "";
-        row.disableRelaType = false;
-        row.relaFieldNameList = [];
-        return;
-      }
-      row.disableRelaType = true;
-    },
-
-    // 勾选框回调
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
-      // this.single = selection.length != 1;
-      this.multiple = !selection.length;
-    },
-    // 分页查询
-    pageList(row) {
-      this.$refs.mychild.pageList(
-        row == undefined
-          ? {
-              limit: this.queryParams.pageSize,
-              page: this.queryParams.pageNum,
-            }
-          : row
-      );
-    },
-    // 多选框改变回调
-    checkedChangeHandle(val) {},
-    // 获取所有表格
-    async getAllTable() {
-      let data = {
-        databaseName: this.databaseName,
-        databaseType: this.databaseType,
-      };
-      let res = await getFormName(data);
-
-      const baseTable = await this.getDicts("base_table");
-
-      this.tableList = res.data.filter((item) => {
-        return !baseTable.data.some(
-          (value) =>
-            value.dictValue.toLowerCase() == item.tableName.toLowerCase()
-        );
-      });
-    },
-    //处理表格行拖拽
-    initDragTable() {
-      const el = this.$refs.dragTable.$el.querySelectorAll(
-        ".el-table__body-wrapper > table > tbody"
-      )[0];
-      const sortable = Sortable.create(el, {
-        handle: ".allowDrag",
-        onEnd: (evt) => {
-          const targetRow = this.tableFieldList.splice(evt.oldIndex, 1)[0];
-          this.tableFieldList.splice(evt.newIndex, 0, targetRow);
-          for (let index in this.tableFieldList) {
-            this.tableFieldList[index].sort = parseInt(index) + 1;
-          }
-        },
-      });
-    },
-    /** 转换菜单数据结构 */
-    normalizer(node) {
-      if (node.children && !node.children.length) {
-        delete node.children;
-      }
-      return {
-        id: node.menuId,
-        label: node.menuName,
-        children: node.children,
-      };
-    },
-    // 获取路由表单数据
-    async getMenuList() {
-      let res = await getMenuList();
-      this.menus = this.handleTree(res.data, "menuId");
-    },
-    // 校验字段合法性(递归版)
-    validateField(tableFieldList, validateParams) {
-      if (!tableFieldList.length) {
-        return;
-      }
-      for (let i = 0; i < tableFieldList.length; i++) {
-        let temp = tableFieldList[i];
-        if (!temp.fieldDescription?.trim() && temp.isShow) {
-          //描述字段不能为空
-          validateParams.isFieldDescrib = true;
-        }
-        if (
-          temp.relationTable &&
-          (!temp.relationFieldName || !temp.relationType)
-        ) {
-          // 关联条件不足
-          validateParams.isRelationFieldAll = true;
-        }
-        if (temp.relationFieldList.length) {
-          this.validateField(temp.relationFieldList, validateParams);
-        }
-      }
-    },
-    // 校验字段合法性(非递归版)
-    validateTableData(tableFieldList) {
-      if (!tableFieldList.length) {
-        return {
-          val: false,
-          meg: "字段个数不能为空",
-        };
-      }
-      for (let i = 0; i < tableFieldList.length; i++) {
-        let temp = tableFieldList[i];
-        if (!temp.fieldDescription?.trim() && temp.isShow) {
-          return {
-            val: false,
-            msg: "显示的字段,字段描述不能为空",
-          };
-        }
-        if (
-          temp.relationTable &&
-          (!temp.relationFieldName || !temp.relationType)
-        ) {
-          return {
-            val: false,
-            msg: "关联条件不足,请完善关联条件",
-          };
-        }
-      }
-      if (tableFieldList.filter((item) => item.isShow).length == 0) {
-        return {
-          val: false,
-          msg: "显示的字段数不能为空",
-        };
-      }
-      if (
-        tableFieldList.filter((item) => item.isExport && !item.isChildren)
-          .length == 0
-      ) {
-        return {
-          val: false,
-          msg: "导出字段中至少应有一个主表字段",
-        };
-      }
-      // 导出的字段的描述不能重复
-      let describeArr = tableFieldList
-        .filter((item) => item.isExport)
-        .map((item) => item.fieldDescription);
-      let isRepeat = false;
-      describeArr.map((item) => {
-        if (describeArr.indexOf(item) != describeArr.lastIndexOf(item)) {
-          isRepeat = true;
-        }
-      });
-      if (isRepeat) {
-        return {
-          val: false,
-          msg: "导出的字段描述不能重复",
-        };
-      }
-
-      return {
-        val: true,
-        msg: "",
-      };
-    },
-    // 递归拼接查询语句
-    getSQLString(tableFieldList, fieldArr, tableArr, sqlType = "mysql") {
-      let prefix = "{DBNAME}.";
-      let asOrSpace = sqlType == "oracle" ? " " : " AS ";
-      for (let i = 0; i < tableFieldList.length; i++) {
-        let temp = tableFieldList[i];
-        if (temp.isShow) {
-          let tempArr = prefix + temp.tableName + "." + temp.fieldName;
-          if (temp.isChildren) {
-            tempArr += asOrSpace + temp.tableName + "_" + temp.fieldName;
-          }
-          fieldArr.push(tempArr);
-        }
-        if (temp.relationTable && temp.relationFieldName && temp.relationType) {
-          // fieldArr.push(temp.relationTable + "." + temp.relationFieldName);
-          let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
-          tableArr.push(
-            temp.relationType +
-              " " +
-              isNeedUsername +
-              prefix +
-              temp.relationTable +
-              asOrSpace +
-              temp.relationTable +
-              " ON " +
-              prefix +
-              temp.relationTable +
-              "." +
-              temp.relationFieldName +
-              " = " +
-              prefix +
-              temp.tableName +
-              "." +
-              temp.fieldName
-          );
-        }
-        // if (temp.relationFieldList.length) {
-        //   this.getSQLString(temp.relationFieldList, fieldArr, tableArr);
-        // }
-      }
-      // 如果主键不包含显示,则添加至sql语句中
-      let isNotInclude = this.primaryKeyList.find(
-        (val) => !val.isShow && val.fieldName == this.formData.primaryKey
-      );
-      if (isNotInclude) {
-        fieldArr.push(
-          prefix + isNotInclude.tableName + "." + isNotInclude.fieldName
-        );
-      }
-    },
-
-    // 拼接查询sql语句
-    getSQLStr() {
-      let prefix = "{DBNAME}.";
-      let sqlType = this.databaseType; //数据库类型
-      // let sqlType = "oracle";
-      let sql = "";
-      // mysql
-      sql += "SELECT ";
-      let fieldNameArr = [],
-        relaTypeArr = [];
-      this.getSQLString(
-        this.tableFieldList,
-        fieldNameArr,
-        relaTypeArr,
-        sqlType
-      );
-      // if (discriISEmpty) {
-      //   return false;
-      // }
-      let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
-      let asOrSpace = sqlType == "oracle" ? " " : " AS ";
-      sql +=
-        fieldNameArr.join(",") +
-        " FROM " +
-        isNeedUsername +
-        prefix +
-        this.tableName +
-        asOrSpace +
-        this.tableName;
-      if (relaTypeArr.length) {
-        sql += " " + relaTypeArr.join(" ");
-      }
-      return sql;
-    },
-    getStaticSQL(key) {
-      // let prefix = "{DBNAME}.";
-      let sqlType = this.databaseType; //数据库类型
-      // let sqlType = "oracle";
-      let sql = "";
-      // mysql
-      sql += "SELECT ";
-      let fieldNameArr = [],
-        relaTypeArr = [];
-      this.getSQLString(
-        this.tableFieldList,
-        fieldNameArr,
-        relaTypeArr,
-        sqlType
-      );
-      let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
-      let asOrSpace = sqlType == "oracle" ? " " : " AS ";
-
-      sql +=
-        key + 
-        " FROM " +
-        isNeedUsername +
-        // prefix +
-        this.tableName +
-        asOrSpace +
-        this.tableName;
-      if (relaTypeArr.length) {
-        sql += " " + relaTypeArr.join(" ");
-      }
-      return sql;
-    },
-    // 处理列表信息
-    columnsHandler(columns) {
-      let resArr = [];
-      columns.forEach((item) => {
-        for (const key in item) {
-          let tempObj = {};
-          tempObj.key = key;
-          tempObj.value = item[key];
-          resArr.push(tempObj);
-        }
-      });
-      return resArr;
-    },
-    // 下划线命名转驼峰命名
-    toUpperCase(str) {
-      let nstr = str.replace(/(?:_)+([^_])/g, function ($0, $1) {
-        return $1.toUpperCase();
-      });
-      nstr = nstr.replace(nstr[0], nstr[0].toLowerCase());
-      return nstr;
-    },
-
-    // 递归获取列表信息
-    getCol(
-      tableFieldList,
-      columns,
-      searchFieldList = [],
-      tableExportField = {}
-    ) {
-      if (!tableFieldList.length) return;
-      for (let i = 0; i < tableFieldList.length; i++) {
-        let temp = tableFieldList[i];
-        let tempFieldName = "",
-          exportFieldName = "";
-        if (temp.isChildren) {
-          tempFieldName = temp.tableName + "_" + temp.fieldName;
-          exportFieldName = temp.tableName + "@" + temp.fieldName;
-        } else {
-          tempFieldName = temp.fieldName;
-          exportFieldName = temp.fieldName;
-        }
-        if (temp.isShow) {
-          let tempObj = {};
-          // if (temp.isChildren) {
-          //   tempObj[temp.tableName + "_" + temp.fieldName] =
-          //     temp.fieldDescription;
-          // } else {
-          //   tempObj[temp.fieldName] = temp.fieldDescription;
-          // }
-          tempObj[tempFieldName] = temp.fieldDescription;
-          columns.push(tempObj);
-        }
-        if (temp.isSearch) {
-          searchFieldList.push(temp.tableName + "." + temp.fieldName);
-        }
-
-        if (temp.isExport) {
-          tableExportField[exportFieldName] = temp.fieldDescription;
-        }
-        // 递归
-        // if (temp.relationFieldList) {
-        //   this.getCol(
-        //     temp.relationFieldList,
-        //     columns,
-        //     searchFieldList,
-        //     tableExportField
-        //   );
-        // }
-      }
-    },
-    // 更新路由
-    reloadRouter() {
-      this.$store.dispatch("GenerateRoutes").then((accessRoutes) => {
-        this.$router.addRoutes(accessRoutes); // 动态添加可访问路由表
-      });
-    },
-
-    // 预览结果回调
-    async previewHandle() {
-      this.$refs.formData.validate(async (valid) => {
-        // 至少包含一个查询项
-        if (valid) {
-          if (!this.tableName) {
-            this.$message.error("请选择数据表");
-            return;
-          }
-          // 检验表单合法性
-          let validRes = this.validateTableData(this.tableFieldList);
-          if (!validRes.val) {
-            this.$message.error(validRes.msg);
-            return;
-          }
-          // let validateParams = {
-          //   isFieldDescrib: false,
-          //   isRelationFieldAll: false,
-          // };
-          // this.validateField(this.tableFieldList, validateParams);
-          // console.log(validateParams);
-          // if (validateParams.isFieldDescrib) {
-          //   this.$message.error("需要显示的字段描述不能为空");
-          //   return;
-          // }
-          // if (validateParams.isRelationFieldAll) {
-          //   this.$message.error("请补全关联条件");
-          //   return;
-          // }
-          // 拼接预览的sql查询语句
-          this.queryParams.basicMap.sql = this.getSQLStr();
-          // 获取表头信息
-          let tempColumns = [],
-            searchFieldList = [];
-          this.getCol(this.tableFieldList, tempColumns, searchFieldList);
-          if (!searchFieldList.length) {
-            this.$message.warning("请至少选择一个包含查询字段");
-            return false;
-          }
-          const dataType = await this.getDicts("table_statistic_type")
-          this.deepragTableStatisticList = JSON.parse(JSON.stringify(this.dragTableStatisticList))
-          this.deepragTableStatisticList.forEach(item => {
-            dataType.data.forEach(val => {
-              if(val.dictValue ==  item.statisticType){
-                item.statisticType = val.dictLabel
-              }
-            })
-          })
-          this.columns = this.columnsHandler(tempColumns);
-          this.queryParams.isAsc = this.formData.isAsc;
-          // 发送请求获取预览数据
-          let res = await dragTablePreview(this.queryParams);
-          this.tableDataList = [];
-          res.rows.forEach((item) => {
-            this.tableDataList.push(item.resultMap);
-          });
-          this.total = res.total;
-          this.isShowPreview = true;
-        } else {
-          this.$message.warning("请完善表单");
-          return false;
-        }
-      });
-
-      // this.$refs.tableForm.validate((val) => {
-      //   if (val) {
-
-      //   } else {
-      //     this.$message.warning("请完善表单");
-      //     return false;
-      //   }
-      // });
-    },
-    // 创建回调
-    async createHandle() {
-      // console.log(123);
-      // this.sqlKey = uuidv4();
-      this.isInputInvalid = true
-      this.$refs.formData.validate(async (valid) => {
-        if (valid) {
-          // 检验表单合法性
-          let validRes = this.validateTableData(this.tableFieldList);
-          if (!validRes.val) {
-            this.$message.error(validRes.msg);
-            return;
-          }
-          let columns = [],
-            searchFieldList = [],
-            tableExportField = {};
-          this.getCol(
-            this.tableFieldList,
-            columns,
-            searchFieldList,
-            tableExportField
-          );
-
-          let echoData = {
-            tableName: this.tableName,
-            tableFieldData: this.tableFieldList,
-            formData: this.formData,
-          };
-          if (!searchFieldList.length) {
-            this.$message.warning("请至少选择一个包含查询字段");
-            return false;
-          }
-          // let validateParams = {
-          //   isFieldDescrib: false,
-          //   isRelationFieldAll: false,
-          // };
-          // this.validateField(this.tableFieldList, validateParams);
-          // console.log(validateParams);
-          // if (validateParams.isFieldDescrib) {
-          //   this.$message.error("需要显示的字段描述不能为空");
-          //   return;
-          // }
-          // if (validateParams.isRelationFieldAll) {
-          //   this.$message.error("请补全关联条件");
-          //   return;
-          // }
-          this.uuid = uuidv4();
-          this.tableKey = uuidv4();
-          // 表单
-          let result;
-          if (this.tId) {
-            let payLoad = {
-              menuId: this.menuId,
-              menuName: this.formData.menuName,
-              parentId: this.formData.routePath,
-              component: "tablelist/commonTable/listInfo",
-              icon: "",
-              isCache: "0",
-              isFrame: "1",
-              menuType: "C",
-              orderNum: this.menuOrderNum,
-              status: "0",
-              visible: "0",
-            };
-            result = await updateMenu(payLoad);
-          } else {
-            let sqlKeyObj = {
-              sqlkey: this.uuid,
-            };
-            let payLoad = {
-              component: "tablelist/commonTable/listInfo",
-              icon: "",
-              isCache: "0",
-              isFrame: "1",
-              menuName: this.formData.menuName,
-              menuType: "C",
-              orderNum: this.menuOrderNum,
-              parentId: this.formData.routePath,
-              path: this.uuid,
-              query: JSON.stringify(sqlKeyObj),
-              status: "0",
-              visible: "0",
-            };
-            result = await addMenu(payLoad);
-          }
-
-          if (result.code == 200) {
-            // 更新路由
-            this.reloadRouter();
-
-            // let isAsc = this.formData.isAsc == "ASC" ? 0 : 1;
-            let data = {
-              tId: this.tId,
-              dtName: this.formData.menuName,
-              // menuId: this.formData.routePath,
-              tableKey: this.tableKey, //  暂定
-              dtTableName: this.tableName,
-              primaryKey: this.formData.primaryKey,
-              orderByColumn: this.formData.orderByColumn,
-              sortOrder: this.formData.isAsc,
-              sqlKey: this.uuid,
-              dtColumnName: columns, //列字段标题名称(存储显示字段信息
-              // dtColumnName: JSON.stringify(columns).replace(/"/g, "'"), //列字段标题名称(存储显示字段信息
-              timeFormat: this.formData.timeFormate,
-              searchFieldList: searchFieldList, //搜索字段数组
-              tableSql: this.getSQLStr(), //  暂定
-              tableExportField: tableExportField, //导出字段名及列名
-              echoData: JSON.stringify(echoData),
-            };
-            // this.tableFieldList.forEach((item) => {
-            //   if (item.isShow) {
-            //     let tempObj = {};
-            //     tempObj[item.fieldName] = item.fieldDescription;
-            //     data.dtColumnName.push(tempObj);
-            //     if (item.children.length) {
-            //       item.children.map((child) => {
-            //         let tempObj = {};
-            //         tempObj[child.fieldName] = child.fieldDescription;
-            //         data.dtColumnName.push(tempObj);
-            //       });
-            //     }
-            //   }
-            //   if (item.isSearch) {
-            //     data.searchFieldList.push(item.fieldName);
-            //   }
-            //   if (item.isExport) {
-            //     data.tableExportField[item.fieldName] = item.fieldDescription;
-            //   }
-            // });
-
-            let res;
-            if (this.tId) {
-              data.menuId = this.menuId;
-              data.sqlKey = this.editData.sqlKey;
-              res = await editTable(data);
-            } else {
-              data.menuId = result.data;
-              res = await addDragTable(data);
-            }
-            this.dragTableStatisticList?.forEach(item => {
-              this.staticSqlKey = uuidv4()
-              // console.log(item)
-              let key = item.statisticType + '(' + item.statisticField + ')'+ ' as result'
-              this.tableSqlList.push({
-                tableSql: this.getStaticSQL(key), 
-                sqlKey: this.staticSqlKey, 
-              })
-              this.searchFieldList = searchFieldList
-              item.sqlKey = this.staticSqlKey
-              item.tableKey = this.tableKey
-            })
-
-            if(res.code == 200 && this.dragTableStatisticList.length !== 0){
-              this.countHandle()
-            }
-            // 关闭当前页面
-            if (this.tId) {
-              if (res.code == 200) {
-                this.$message.success("修改成功");
-              } else {
-                this.$message.warning("修改失败");
-              }
-              this.$tab.closePage();
-              this.$router.push({
-                path: "/system/fromModel/index/tablelist",
-              });
-            } else {
-              if (res.code == 200) {
-                this.$message.success("创建成功");
-              } else {
-                this.$message.warning("创建失败");
-              }
-              this.isShowPreview = false;
-            }
-          }
-        } else {
-          this.$message.warning("请完善表单");
-          return false;
-        }
-      });
-    },
-    // 修改表格回显数据
-    async initTableData(tId) {
-      let res = await getTableInfo(tId);
-      if (res.code == 200) {
-        this.dragTableStatisticList = res.data.dragTableStatisticList
-        let echoData = JSON.parse(res.data.echoData);
-        this.tableName = echoData.tableName;
-        this.tableFieldList = echoData.tableFieldData;
-        let {
-          isShowList,
-          timeFormate,
-          orderByColumn,
-          isAsc,
-          primaryKey,
-          menuName,
-        } = echoData.formData;
-        Object.assign(this.formData, {
-          menuName,
-          isShowList,
-          timeFormate,
-          orderByColumn,
-          isAsc,
-          primaryKey,
-        });
-        this.formData.routePath = this.getParentMenuId(
-          res.data.menuId,
-          this.menus,
-          {}
-        );
-
-        if (!this.formData.routePath) {
-          this.$message.warning("该表格菜单路由已经删除,请重新配置");
-        }
-        // this.formData.routePath
-        this.editData = res.data;
-        let val = await getParticMenu(res.data.sqlKey);
-        if (val.code == 200) {
-          this.menuId = val.data.menuId;
-        }
-      } else {
-        this.$message.error("数据回显失败");
-      }
-    },
-    // 获取父级menuId
-    getParentMenuId(menuId, menus) {
-      let res;
-      for (let i = 0; i < menus.length; i++) {
-        let item = menus[i];
-        if (item.menuId == menuId) {
-          res = item.parentId;
-          break;
-        } else if (item.children?.length) {
-          if (
-            this.getParentMenuId(
-              menuId,
-              JSON.parse(JSON.stringify(item.children))
-            )
-          ) {
-            res = this.getParentMenuId(
-              menuId,
-              JSON.parse(JSON.stringify(item.children))
-            );
-          }
-        }
-      }
-      return res;
-    },
-    // tab切换
-    tabhandleClick() {
-      this.menudata = this.activeName === "datacount" ? true : false;
-    },
-    // 添加数据字段对话框
-    async addDataDialog() {
-      this.staictitle = '添加统计数据字段'
-      this.isShowAddData = true;
-      this.dataType = await this.getDicts("table_statistic_type");
-      this.dataType = this.dataType.data;
-      // console.log(this.dataType)
-    },
-    async updataDialog() {
-      
-      // console.log(this.dataType)
-    },
-    // 修改数据字段
-    upadtaData(){
-      this.dragTableStatisticList.forEach((item, index) => {
-        // console.log(this.dataCountFormData);
-        if(item.id !== undefined && item.id == this.dataCountFormData.id){
-          this.dragTableStatisticList[index] = this.dataCountFormData
-        }else if(item.xid == this.dataCountFormData.xid){
-          this.dragTableStatisticList[index] = this.dataCountFormData
-        }
-      })
-      this.isShowAddData = false
-      // console.log(this.dragTableStatisticList)
-      this.dataCountFormData = {}
-    },
-    // 添加数据字段
-    addData(){
-      // console.log(this.dataCountFormData);
-      this.dataCountFormData.xid = Date.now()
-      this.dataCountFormData.tableKey = this.tableKey
-      this.dragTableStatisticList.push(this.dataCountFormData)
-      this.isShowAddData = false
-      this.dataCountFormData = {}
-    },
-    // 关闭添加数据字段
-    closeAddDialog() {
-      this.isShowAddData = false;
-      this.dataCountFormData = {};
-    },
-    // 确定统计
-    countHandle(){
-      addStatistic({
-        dragTableStatisticList: this.dragTableStatisticList,
-        tableSqlList: this.tableSqlList,
-        searchFieldList: this.searchFieldList,
-        dtTableName: this.tableName
-      }).then(res=> {
-        // console.log(res)
-      })
-    },
-    // 修改统计信息
-    async handleUpdateStat(row){
-      // console.log(row);
-      this.dataCountFormData = row
-      this.dataCountFormData.xid = Date.now()
-      this.staictitle = '修改统计数据字段'
-      this.dataType = await this.getDicts("table_statistic_type");
-      this.dataType = this.dataType.data;
-      this.isShowAddData = true
-      // console.log(this.dataCountFormData)
-      // console.log(this.dragTableStatisticList);
-    },
-    // 删除统计信息
-    handleDeleteStat(row){
-      this.dragTableStatisticList.forEach((item, index) => {
-        // console.log(item);
-        if(item.id == row.id){
-          this.dragTableStatisticList.splice(index, 1);
-        }
-      })
-    },
-  },
-  created() {},
-    async mounted() {
-      this.getAllTable();
-      this.initDragTable();
-      await this.getMenuList();
-      if (this.$route.query.tId) {
-        this.tId = this.$route.query.tId;
-        this.initTableData(this.tId);
-      }
-  },
-};
-</script>
-
-<style scoped lang="scss">
-.ipt {
-  height: 36px;
-  line-height: 36px;
-  font-size: 14px;
-  width: 100%;
-  outline: none;
-  text-align: center;
-  background-color: #fff;
-  border: 1px solid #dcdfe6;
-  color: #606266;
-  display: inline-block;
-  border-radius: 4px;
-}
-.isNullDesc {
-  border-color: #ff4949 !important;
-}
-
-.ipt:focus {
-  border-color: #1890ff;
-}
-::v-deep .right_card {
-  min-height: 500px !important;
-}
-::v-deep .vue-treeselect--has-value .vue-treeselect__input {
-  vertical-align: middle !important;
-}
-.menudata {
-  width: 30% !important;
-}
-.edit {
-  width: 70% !important;
-}
-.mb10 {
-  margin-top: 10px;
-}
-.cardBox {
-  display: flex;
-  align-content: space-between;
-  flex-wrap: wrap;
-  align-content: flex-start;
-}
-.card {
-  /* width:15%; */
-  height:150px;
-  flex-basis: 15%;
-  margin-bottom: 10px;
-  margin-right: 15px;
-  min-width: 180px;
-  .title {
-    /* width:20%; */
-    font-size: 18px;
-    margin-bottom: 5px;
-    white-space: nowrap;
-    overflow: hidden;
-    text-overflow: ellipsis;
-  }
-  .description {
-    width: 70%;
-    font-size: 13px;
-    color: #9699a2;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    display: -webkit-box;
-    -webkit-box-orient: vertical;
-    -webkit-line-clamp: 3;
-    word-break: break-all;
-    float: left;
-  }
-  .type {
-    float: right;
-    margin-top: 40px;
-    .statisticType{
-      font-size: 18px;
-    }
-  }
-  .count {
-    font-size: 25px;
-  }
-}
-.mb8{
-  ::v-deep .el-col-18{
-    width: 30% !important;
-    min-width: 220px !important;
-  }
-  ::v-deep .previewbtn{
-    min-width: 190px !important;
-  }
-}
-</style>

+ 51 - 100
ruoyi-ui/src/views/relateTable/relateTableEdit.vue

@@ -11,6 +11,9 @@
             <TableCard
               :ref="'childComponent' + index"
               @updateData="updateDataList"
+              @getChildData="getChildData"
+              @getDefaultCardData="getDefaultCardData"
+              @getEditHandle="getEditHandle"
               :tableKey="cardData.tableKey"
               :sort="cardData.sort"
               :cardData="cardData"
@@ -27,17 +30,6 @@
 <script>
 import TableCard from "./components/RelateTableCard.vue";
 import {dragGroupTableInfo} from "@/api/relateTable/index"
-import {
-  delTableData,
-  dragTableInfo,
-  listTable,
-  unionListTableData,
-  getInfoBySqlKey,
-  addTableData,
-  batchEdit,
-  getStatisticList
-} from "@/api/tablelist/commonTable";
-import {camelCase} from "@/utils";
 
 export default {
   name: "relateTableEdit",
@@ -46,86 +38,6 @@ export default {
   data() {
     return {
       tableLists:[],
-      // dataList: [
-      //   {
-      //     tableId: "1",
-      //     title: "一级表格",
-      //     tableData: [
-      //       {
-      //         date: "2016-05-02",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1518 弄",
-      //       },
-      //       {
-      //         date: "2016-05-04",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1517 弄",
-      //       },
-      //       {
-      //         date: "2016-05-01",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1519 弄",
-      //       },
-      //       {
-      //         date: "2016-05-03",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1516 弄",
-      //       },
-      //     ],
-      //   },
-      //   {
-      //     tableId: "2",
-      //     title: "二级表格",
-      //     tableData: [
-      //       {
-      //         date: "2016-05-02",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1518 弄",
-      //       },
-      //       {
-      //         date: "2016-05-04",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1517 弄",
-      //       },
-      //       {
-      //         date: "2016-05-01",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1519 弄",
-      //       },
-      //       {
-      //         date: "2016-05-03",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1516 弄",
-      //       },
-      //     ],
-      //   },
-      //   {
-      //     tableId: "3",
-      //     title: "三级表格三级表格三级表格三级表格",
-      //     tableData: [
-      //       {
-      //         date: "2016-05-02",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1518 弄",
-      //       },
-      //       {
-      //         date: "2016-05-04",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1517 弄",
-      //       },
-      //       {
-      //         date: "2016-05-01",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1519 弄",
-      //       },
-      //       {
-      //         date: "2016-05-03",
-      //         name: "王小虎",
-      //         address: "上海市普陀区金沙江路 1516 弄",
-      //       },
-      //     ],
-      //   },
-      // ],
       // 共通查询参数接受子组件的参数
       queryParams: {
         pageNum: 1, // 第几页
@@ -155,23 +67,62 @@ export default {
     this.getLists()
   },
   methods: { 
+    // 获取相关表格信息
     async getLists(){
       let res = await dragGroupTableInfo({queryMap: {groupKey: this.groupKey}})
       this.tableLists = JSON.parse(res.msg)
     },
+    // 子组件触发点击事件 获得下一表格数据
     updateDataList(row,index) {
-      // let tableKey = this.tableLists[index+1].tableKey
+      if(index == 0){
+        this.tableLists.forEach((item, i) => {
+          if(i !== 0){
+            this.$refs['childComponent'+i][0].tableList = []
+            this.$refs['childComponent'+i][0].total = 0
+          }
+        })
+      }
       let beforeChild = this.$refs['childComponent'+index][0]
       index++
-      console.log(beforeChild);
-      const chlid = this.$refs['childComponent'+index][0]
-      // console.log(chlid);
-      if(!chlid) return
-      // let contion = beforeChild.condition
-      // let tableList = beforeChild.tableList[0]
-      // console.log(contion,tableList);
-      chlid.getDataHandler(beforeChild.contion,row)
+      // 判断是不是最后一个表格触发点击事件
+      if(this.$refs['childComponent'+index]){
+        const chlid = this.$refs['childComponent'+index][0]
+        if(!chlid) return
+        chlid.getDataHandler(beforeChild.contion,row)
+      }
     },
+    // 新增数据调用
+    getChildData(index) {
+      // console.log(index);
+      let targetRef = 'childComponent'
+      if(index == 0){
+        targetRef += index
+      }else{
+        targetRef += (index - 1)
+      }
+      this.$nextTick(()=>{
+        this.$refs[targetRef][0].getNextCardData()
+      })
+    },
+    // 默认不点击获取表格数据
+    getDefaultCardData(index){
+      let currentChild = this.$refs['childComponent'+index][0]
+      this.$nextTick(() => {
+        if(this.$refs['childComponent' + (index+1)]){
+          let nextChild = this.$refs['childComponent' + (index+1)][0]
+          nextChild.getDataHandler(currentChild.contion, currentChild.tableList[0])
+        }
+
+      })
+    },
+    // 不点击上一表格数据时修改调用函数
+    getEditHandle(index){
+      let beforeChild = this.$refs['childComponent'+(index - 1)][0]
+
+      let currentRef = this.$refs['childComponent'+index][0]
+
+      currentRef.getDataHandler(beforeChild.contion, beforeChild.tableList[0])
+    }
   },
 };
 </script>

+ 47 - 8
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementExecuteForm.vue

@@ -12,7 +12,7 @@
           maxlength="32"
           @change="setExternalTaskPriority"
         /> -->
-        <el-select
+        <!-- <el-select
           v-model="formKey"
           value-key="value"
           placeholder="请选择执行表单"
@@ -27,7 +27,12 @@
             :value="item.fId"
           >
           </el-option>
-        </el-select>
+        </el-select> -->
+        <el-cascader
+          v-model="formKey"
+          :options="formList"
+          @change="updateFormKey"
+        ></el-cascader>
       </edit-item>
     </div>
   </el-collapse-item>
@@ -35,10 +40,15 @@
 
 <script>
 import EventEmitter from "@utils/EventEmitter";
-import { setFormKey, getFormKey } from "@packages/bo-utils/myFieldUtil";
+import {
+  setFormKey,
+  getFormKey,
+  setNodeFormType,
+  getNodeFormType,
+} from "@packages/bo-utils/myFieldUtil";
 import { getActive } from "@packages/bpmn-utils/BpmnDesignerUtils";
 import { listForm } from "@/api/dragform/form";
-
+import { listGroup } from "@/api/relateTable/index.js";
 export default {
   name: "ElementExecuteUser",
   data() {
@@ -57,16 +67,45 @@ export default {
   },
   methods: {
     async initFormData() {
-      this.formKey = getFormKey(getActive());
+      this.formKey = [getNodeFormType(getActive()), getFormKey(getActive())];
     },
     updateFormKey(value) {
-      setFormKey(getActive(), value);
+      setNodeFormType(getActive(), value[0]);
+      setFormKey(getActive(), value[1]);
     },
     async getFormList() {
+      let list = [];
+      list.push({
+        label: "拖拽表单",
+        value: "dragForm",
+        children: [],
+      });
+      list.push({
+        label: "组合表单",
+        value: "composeForm",
+        children: [],
+      });
       try {
         let res = await listForm({ isEnablePaging: false });
-        if (res.code == 200) {
-          this.formList = res.rows;
+        let dialogList = await listGroup({
+          isEnablePaging: false,
+          groupType: 1,
+        });
+        if (res.code == 200 && dialogList.code == 200) {
+          // this.formList = res.rows;
+          list[0].children = res.rows.map((item) => {
+            return {
+              label: item.dfName,
+              value: item.fId,
+            };
+          });
+          list[1].children = dialogList.rows.map((item) => {
+            return {
+              label: item.groupName,
+              value: item.groupKey,
+            };
+          });
+          this.formList = list;
         }
       } catch (error) {
         console.log(error);

+ 2 - 0
ruoyi-ui/src/views/system/bpmnPro/components/Toolbar/tools/Save.vue

@@ -205,6 +205,8 @@ export default {
     async updateNodeMsg(obj) {
       let data = getNodeMsg(obj);
       let theData = filterNodeMsg(this.nodeData(), data);
+      // console.log(theData);
+      // return;
       if (!theData.bpmProcessConfigurationList.length) return;
       theData.bpmProcessConfigurationList.forEach((item) => {
         // item.updateBy = this.$store.state.user.name;

+ 6 - 2
ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/getNodeMsg.js

@@ -38,7 +38,7 @@ export function getNodeMsg(xmlObj) {
   let prefix = getProcessEngine();
   let { attributes, childNodes } = xmlObj
     .getElementsByTagName("bpmn:process")[0];
-  let bpmProcessConfigurationList = [], bpmNodeHandleUserList = [], bpmNodeScriptRelevanceList = [], attributeArray = ['nodeKey', 'nodeFormKey', 'nodeProcessKey', 'nodeRolePremission', 'spare1', 'spare2', 'spare3', 'createBy', 'updateBy', 'remark', 'nodeExecuteType'];
+  let bpmProcessConfigurationList = [], bpmNodeHandleUserList = [], bpmNodeScriptRelevanceList = [], attributeArray = ['nodeKey', 'nodeFormKey', 'nodeFormType', 'nodeProcessKey', 'nodeRolePremission', 'spare1', 'spare2', 'spare3', 'createBy', 'updateBy', 'remark', 'nodeExecuteType'];
   childNodes.forEach((node) => {
     // let uuid = uuidv4();
 
@@ -46,6 +46,7 @@ export function getNodeMsg(xmlObj) {
       nodeKey: '',
       nodeName: '',
       nodeFormKey: '', //节点表单别名
+      nodeFormType: '',//节点表单类型
       nodeProcessKey: '', //流程别名
       nodeType: '',   //节点类型(判断节点,正常节点..)根据字典维护
       nodeBefore: 'false',
@@ -159,9 +160,10 @@ function getBpmNodeHandleUser(node, nodeObj) {
   return [res]
 }
 
-
+// 处理节点数据更新
 export function filterNodeMsg(oldMsg, newMsg) {
   let keys = ['bpmProcessConfigurationList', 'bpmNodeScriptRelevanceList', 'bpmNodeHandleUserList', 'removeNodeIds']
+
   newMsg[keys[0]].forEach(item => {
     let sameNode = oldMsg[keys[0]].find((oldItem) => oldItem.nodeKey == item.nodeKey)
     if (sameNode) {
@@ -187,6 +189,8 @@ export function filterNodeMsg(oldMsg, newMsg) {
     })
   }).map(item => item.id)
 
+
+
   return newMsg;
 }
 

+ 18 - 0
ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/myFieldUtil.js

@@ -90,6 +90,24 @@ export function getFormKey(element) {
   return businessObject.get(`${prefix}:nodeFormKey`);
 }
 
+// 表单类型
+export function setNodeFormType(element, value) {
+  const prefix = getProcessEngine();
+  const modeling = getModeler.getModeling();
+  const businessObject = getBusinessObject(element);
+  modeling.updateModdleProperties(element, businessObject, {
+    [`${prefix}:nodeFormType`]: value
+  });
+}
+
+
+export function getNodeFormType(element) {
+  const prefix = getProcessEngine();
+  const businessObject = getBusinessObject(element);
+
+  return businessObject.get(`${prefix}:nodeFormType`);
+}
+
 // 执行用户
 export function isUserTask(element) {
   return is(element, 'bpmn:UserTask');

+ 1 - 0
ruoyi-ui/src/views/system/bpmnPro/index.vue

@@ -83,6 +83,7 @@ export default {
         let response = await getNodeData(this.formData.processKey);
         if (response.code == 200) {
           this.nodeData = response.data;
+          console.log(this.nodeData);
         }
       } else {
       }

+ 1 - 1
ruoyi-ui/src/views/system/tenant/dict/data.vue

@@ -326,7 +326,7 @@ export default {
     },
     /** 返回按钮操作 */
     handleClose() {
-      const obj = { path: "/system/dict" };
+      const obj = { path: "/system/tenantDict" };
       this.$tab.closeOpenPage(obj);
     },
     /** 重置按钮操作 */

+ 57 - 31
ruoyi-ui/src/views/system/tenant/index.vue

@@ -183,7 +183,8 @@
             icon="el-icon-edit"
             @click="openTenantExpirationTime(scope.row)"
             v-hasPermi="['system:tenant:remove']"
-            style="margin-left:5px">激活租户
+            style="margin-left: 5px"
+            >激活租户
           </el-button>
         </template>
       </el-table-column>
@@ -316,13 +317,34 @@
     </el-dialog>
 
     <!-- 激活租户弹出层-->
-    <el-dialog title="激活租户" :visible.sync="tenantExpirationTimeOpen" width="500px" append-to-body>
-      <el-form ref="tenantExpirationTimeFrom" :model="tenantExpirationTimeFrom" :rules="rulesTenantExpirationTime" label-width="80px">
-        <el-form-item label="激活租户" prop="tenantExpirationTime" label-width="110px">
-          <el-input v-model="tenantExpirationTimeFrom.tenantExpirationTime" placeholder="请输入激活码" />
+    <el-dialog
+      title="激活租户"
+      :visible.sync="tenantExpirationTimeOpen"
+      width="500px"
+      append-to-body
+    >
+      <el-form
+        ref="tenantExpirationTimeFrom"
+        :model="tenantExpirationTimeFrom"
+        :rules="rulesTenantExpirationTime"
+        label-width="80px"
+      >
+        <el-form-item
+          label="激活租户"
+          prop="tenantExpirationTime"
+          label-width="110px"
+        >
+          <el-input
+            v-model="tenantExpirationTimeFrom.tenantExpirationTime"
+            placeholder="请输入激活码"
+          />
         </el-form-item>
         <el-form-item class="btn">
-          <el-button type="primary" @click="activationOperationMethod('tenantExpirationTimeFrom')">确 定</el-button>
+          <el-button
+            type="primary"
+            @click="activationOperationMethod('tenantExpirationTimeFrom')"
+            >确 定</el-button
+          >
           <el-button @click="tanentCancel">取 消</el-button>
         </el-form-item>
       </el-form>
@@ -341,11 +363,10 @@ import {
   selectAllUser,
   createTenant,
   initTenantMenuData,
-  activationOperation
+  activationOperation,
 } from "@/api/system/tenant";
 import { getDataSourceInfo, insertDataSource } from "@/api/system/data";
 import { servicesLoading } from "@/utils/ruoyi";
-import { async } from "@/components/updateModule/k-form-design/lib/k-form-design.common";
 
 export default {
   name: "Tenant",
@@ -423,10 +444,14 @@ export default {
         ],
         databaseName: [
           { required: true, message: "数据库名不能为空", trigger: "blur" },
-          { validator: this.databaseNameValidator, trigger: "blur"  }
+          { validator: this.databaseNameValidator, trigger: "blur" },
         ],
         tenantAccount: [
-          { required: true, message: "租户管理员账号不能为空", trigger: "change" },
+          {
+            required: true,
+            message: "租户管理员账号不能为空",
+            trigger: "change",
+          },
           { validator: this.tenantAccountValidator, trigger: "blur" },
         ],
         databaseIp: [
@@ -443,12 +468,12 @@ export default {
         ],
       },
       //租户激活码弹窗表单
-      tenantExpirationTimeFrom:{
+      tenantExpirationTimeFrom: {
         tenantId: null,
-        tenantExpirationTime: '',
+        tenantExpirationTime: "",
       },
       //租户激活码弹窗标题
-      tenantExpirationTimeOpen:false,
+      tenantExpirationTimeOpen: false,
       //租户激活码规则验证
       rulesTenantExpirationTime: {
         tenantExpirationTime: [
@@ -486,7 +511,7 @@ export default {
       }
     },
     // 数据库名称校验规则
-    databaseNameValidator(rule, value, callback){
+    databaseNameValidator(rule, value, callback) {
       let regex = /^[a-z][a-z0-9]*$/;
       if (regex.test(value)) {
         callback(); // 输入内容符合规则
@@ -742,7 +767,7 @@ export default {
     restTenantExpirationTime() {
       this.tenantExpirationTimeFrom = {
         tenantId: null,
-        tenantExpirationTime: '',
+        tenantExpirationTime: "",
       };
       this.resetForm("tenantExpirationTimeFrom");
     },
@@ -750,37 +775,38 @@ export default {
     openTenantExpirationTime(row) {
       // this.reset();
       const tenantId = row.tenantId || this.ids;
-      this.tenantExpirationTimeFrom.tenantId = row.tenantId
+      this.tenantExpirationTimeFrom.tenantId = row.tenantId;
       this.tenantExpirationTimeOpen = true;
       // this.title="激活租户";
     },
     /**激活租户操作*/
-    activationOperationMethod(form){
+    activationOperationMethod(form) {
       this.$refs[form].validate(async (valid) => {
         if (valid) {
-          let response = await activationOperation(this.tenantExpirationTimeFrom)
-            if(response.code == 200){
-              this.$message.success("激活成功");
-            } else {
-              this.$message.error("激活失败");
-            }
-            this.tenantExpirationTimeOpen = false;
-            this.tenantExpirationTimeFrom = {
-              tenantId: null,
-              tenantExpirationTime: null,
-            };
-   
+          let response = await activationOperation(
+            this.tenantExpirationTimeFrom
+          );
+          if (response.code == 200) {
+            this.$message.success("激活成功");
+          } else {
+            this.$message.error("激活失败");
+          }
+          this.tenantExpirationTimeOpen = false;
+          this.tenantExpirationTimeFrom = {
+            tenantId: null,
+            tenantExpirationTime: null,
+          };
         }
       });
     },
     // 激活租户对话框取消按钮
-    tanentCancel(){
+    tanentCancel() {
       this.tenantExpirationTimeOpen = false;
       this.tenantExpirationTimeFrom = {
         tenantId: null,
         tenantExpirationTime: null,
       };
-    }
+    },
   },
 };
 </script>

+ 120 - 57
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -86,7 +86,7 @@
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
-          @click="handleDelete"
+          @click="handleBatchDelete"
           >删除
         </el-button>
       </el-col>
@@ -121,6 +121,7 @@
       :data="tableList"
       @selection-change="handleSelectionChange"
       row-key="id"
+      ref="tableRef"
       :cell-style="cellStyle"
     >
       <el-table-column
@@ -260,16 +261,17 @@
     <el-dialog
       title="提示"
       :visible.sync="btnDialogVisible"
-      :before-close="handleClose">
+      :before-close="handleClose"
+    >
       <DialogTemplate
-       ref="dialogRef"
+        ref="dialogRef"
         :groupKey="groupKey"
         :rowobj="rowobj"
         :subCount="subCount"
         :tableCount="tableCount"
         :subTableName="subTableName"
         @addList="addListHandler"
-        >
+      >
       </DialogTemplate>
       <span slot="footer" class="dialog-footer">
         <el-button @click="btnDialogVisible = false">取 消</el-button>
@@ -281,16 +283,17 @@
     <el-dialog
       title="提示"
       :visible.sync="btnDialogVisible"
-      :before-close="handleClose">
+      :before-close="handleClose"
+    >
       <DialogTemplate
-       ref="dialogRef"
+        ref="dialogRef"
         :groupKey="groupKey"
         :rowobj="rowobj"
         :subCount="subCount"
         :tableCount="tableCount"
         :subTableName="subTableName"
         @addList="addListHandler"
-        >
+      >
       </DialogTemplate>
       <span slot="footer" class="dialog-footer">
         <el-button @click="btnDialogVisible = false">取 消</el-button>
@@ -328,7 +331,7 @@ export default {
       // 绑定按钮dialog
       btnDialogVisible: false,
       // 绑定修改dialog
-      groupKey: '',
+      groupKey: "",
       // 遮罩层
       loading: true,
       // 选中数组
@@ -418,13 +421,13 @@ export default {
       // 当前点击按钮的数据
       currentBtnData: {},
       // 修改选中行
-      rowobj:{},
+      rowobj: {},
       // 该行的统计信息
-      subCount:[],
-      tableCount:[],
+      subCount: [],
+      tableCount: [],
       // 弹窗新增数据
-      addLists:[],
-      subTableName: '',
+      addLists: [],
+      subTableName: "",
       // 当前点击行的数据
       currentRow: {},
     };
@@ -510,6 +513,9 @@ export default {
             // });
             this.tableList = await this.setFieldStyleData(tempTableList);
             this.total = res.total;
+            this.$nextTick(() => {
+              this.$refs.tableRef?.clearSelection();
+            });
             this.loading = false;
           });
 
@@ -601,7 +607,12 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(
-        (item) => item[camelCase(this.templateInfo.template?.primaryKey)]
+        (item) =>
+          item[
+            camelCase(
+              this.tableName + "_" + this.templateInfo.template?.primaryKey
+            )
+          ]
       );
       this.single = selection.length != 1;
       this.multiple = !selection.length;
@@ -659,8 +670,8 @@ export default {
       return strs[0];
     },
     // 绑定dialog对话框关闭
-    handleClose(){
-      this.btnDialogVisible = false
+    handleClose() {
+      this.btnDialogVisible = false;
     },
     getLastUppercaseWord(text) {
       const pattern = /\b[A-Z][a-z]*\b/g;
@@ -676,26 +687,27 @@ export default {
     async handleUpdate(row, btnData) {
       // console.log(this.currentBtnData);
 
-      let nameTable = this.templateInfo.template.dtTableName
+      let nameTable = this.templateInfo.template.dtTableName;
       // console.log(nameTable);
       // console.log('row', row);
-      this.rowobj = {}
-      let obj = {}
-      for(let key in row) {
-
-        let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase();
+      this.rowobj = {};
+      let obj = {};
+      for (let key in row) {
+        let modifiedTable = key
+          .replace(/[A-Z]/g, (match) => `_${match}`)
+          .toLowerCase();
 
         this.rowobj[modifiedTable] = row[key];
 
-        let str = modifiedTable.substring(nameTable.length+1)
+        let str = modifiedTable.substring(nameTable.length + 1);
         obj[str] = row[key];
       }
       // console.log("row", row);
-    // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
-    //   if (!data || !data.dfVueTemplate) {
-    //     this.$message.error("当前表格未绑定表单!");
-    //     return;
-    //   }});
+      // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
+      //   if (!data || !data.dfVueTemplate) {
+      //     this.$message.error("当前表格未绑定表单!");
+      //     return;
+      //   }});
 
       // 新的修改请求
       try {
@@ -723,8 +735,8 @@ export default {
           }
 
           res.data.template.dfFormSql &&
-          (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
-           this.addRealFieldName(res.data.result.resultMap);
+            (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
+          this.addRealFieldName(res.data.result.resultMap);
           let resultMap = res.data.result.resultMap;
 
           Object.assign(this.defaultValue, resultMap);
@@ -735,18 +747,18 @@ export default {
           this.$nextTick(() => {
             this.$refs.addFromRef.setData(res.data.result.resultMap);
           });
-        }else{
-          this.subTableName = res.data.result.dragTables[1].dtTableName
-          this.btnDialogVisible = true
-          this.groupKey = this.currentBtnData.btnTableFormGroupKey
-          this.$nextTick(()=>{
-            let refChild = this.$refs.dialogRef
+        } else {
+          this.subTableName = res.data.result.dragTables[1].dtTableName;
+          this.btnDialogVisible = true;
+          this.groupKey = this.currentBtnData.btnTableFormGroupKey;
+          this.$nextTick(() => {
+            let refChild = this.$refs.dialogRef;
 
             // console.log(this.$refs.dialogRef);
-            refChild.getLists(this.groupKey)
-          })
+            refChild.getLists(this.groupKey);
+          });
 
-          let tablesubKey = res.data.result.dragTables[1].tableKey
+          let tablesubKey = res.data.result.dragTables[1].tableKey;
 
           // 查询统计信息
           getStatisticList({
@@ -755,25 +767,32 @@ export default {
             },
           }).then((res) => {
             // console.log('统计', res);
-            this.subCount = res.data
+            this.subCount = res.data;
           });
 
-          let prmKey = this.templateInfo.template.primaryKey
-          let pkey = prmKey.replace(/_([a-z])/g, (match, p1) => p1.toUpperCase());
+          let prmKey = this.templateInfo.template.primaryKey;
+          let pkey = prmKey.replace(/_([a-z])/g, (match, p1) =>
+            p1.toUpperCase()
+          );
 
           let data = {
-            queryMap:{
-              tableKey:res.data.result.dragTables[2].tableKey,
-            }
-          }
+            queryMap: {
+              tableKey: res.data.result.dragTables[2].tableKey,
+            },
+          };
 
-          let key = '#{' + this.templateInfo.template.dtTableName + '.' + this.templateInfo.template.primaryKey
+          let key =
+            "#{" +
+            this.templateInfo.template.dtTableName +
+            "." +
+            this.templateInfo.template.primaryKey;
 
-          data.queryMap[key] = "'" + obj[this.templateInfo.template.primaryKey] + "'";
+          data.queryMap[key] =
+            "'" + obj[this.templateInfo.template.primaryKey] + "'";
 
           getStatisticList(data).then((res) => {
             // console.log('统计', res);
-            this.tableCount = res.data
+            this.tableCount = res.data;
           });
         }
 
@@ -784,7 +803,6 @@ export default {
         //   realField = realField[0].toLocaleLowerCase() + realField.substring(1);
         //   resultMap[realField] = resultMap[field];
         // });
-
       } catch (error) {
         this.$message.error("网络异常,请稍后再试");
         console.log(error);
@@ -828,8 +846,11 @@ export default {
     },
     // 添加真正的字段名
     addRealFieldName(row) {
+      console.log(row);
       let fieldList = Object.keys(row);
-      let tableName = this.longestCommonSubstring(fieldList);
+      // let tableName = this.longestCommonSubstring(fieldList);
+      let tableName = camelCase(this.tableName);
+      console.log(this.tableName);
       fieldList.forEach((field) => {
         let realField = field.replace(tableName, "");
         realField = realField[0].toLocaleLowerCase() + realField.substring(1);
@@ -866,6 +887,7 @@ export default {
       let primary = camelCase(this.templateInfo.template?.primaryKey);
       this.addRealFieldName(row);
       if (row[primary] != undefined && row[primary] != null) {
+        console.log(row[primary]);
         delIds = [];
         delIds.push(row[primary]);
       }
@@ -904,6 +926,47 @@ export default {
         })
         .catch(() => {});
     },
+    // 批量删除接口
+    handleBatchDelete() {
+      let delIds = this.ids;
+      console.log(this.ids);
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
+      // if (row && row[primary] != undefined && row[primary] != null) {
+      //   delIds = [];
+      //   delIds.push(row[primary]);
+      // }
+      let data = {
+        basicMap: {
+          tableName: this.tableName,
+        },
+        conditionMap: {
+          // id: delIds,
+        },
+      };
+      // if (this.currentBtnData.btnParams) {
+      //   let btnParams = JSON.parse(this.currentBtnData.btnParams);
+      //   btnParams.forEach((item) => {
+      //     data.btnParametersMap[
+      //       this.formatField(item.fieldName, camelCase(this.tableName))
+      //     ] = item.fieldValue
+      //       ? item.fieldValue
+      //       : this.currentRow[item.fieldName];
+      //   });
+      // }
+      data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
+      this.$modal
+        .confirm('是否确认删除"' + delIds + '"的数据项?')
+        .then(function () {
+          return delTableData(data);
+          // return btnCommonApi(data);
+        })
+        .then(() => {
+          // 调用子组件查询方法 目的是携带上子组件中的查询参数
+          this.$refs.mychild.pageList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
     /** 导出按钮操作 */
     handleExport() {
       let primary = camelCase(this.templateInfo.template?.primaryKey);
@@ -977,12 +1040,12 @@ export default {
       this.$refs.upload.submit();
     },
     // 弹窗新增的数
-    addListHandler(val){
-      this.addLists.push(...val)
+    addListHandler(val) {
+      this.addLists.push(...val);
       // console.log(this.addLists);
     },
     // 绑定弹窗Dialog确定按钮
-    btnComfirm(){
+    btnComfirm() {
       // let data = {
       //   addListMap:[],
       //   basicMap:{
@@ -1287,7 +1350,7 @@ export default {
 </script>
 
 <style scoped lang="scss">
-  ::v-deep .el-dialog:not(.is-fullscreen){
-    min-width: 610px !important;
-  }
+::v-deep .el-dialog:not(.is-fullscreen) {
+  min-width: 610px !important;
+}
 </style>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff