Преглед изворни кода

Merge remote-tracking branch 'origin/master'

侯茂昌 пре 1 година
родитељ
комит
cd4b79ffea
23 измењених фајлова са 920 додато и 239 уклоњено
  1. 21 21
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
  2. 18 18
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysTenant.java
  3. 27 27
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  4. 2 1
      ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
  5. 4 1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/SysActivationCodeLog.java
  6. 19 0
      ruoyi-ui/src/api/tablelist/commonTable.js
  7. 0 1
      ruoyi-ui/src/utils/request.js
  8. 21 9
      ruoyi-ui/src/views/bussiness/processMange.vue
  9. 14 1
      ruoyi-ui/src/views/dialogMange/components/relayTable.vue
  10. 87 22
      ruoyi-ui/src/views/dialogMange/index.vue
  11. 315 38
      ruoyi-ui/src/views/dialogTemplate/components/index.vue
  12. 7 4
      ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementAsyncContinuations.vue
  13. 1 1
      ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementExcuteType.vue
  14. 50 23
      ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementExecuteUser.vue
  15. 15 9
      ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementNormalTask.vue
  16. 179 18
      ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementUnusualTasks.vue
  17. 83 3
      ruoyi-ui/src/views/system/bpmnPro/components/Panel/index.vue
  18. 0 2
      ruoyi-ui/src/views/system/bpmnPro/components/Toolbar/tools/Save.vue
  19. 18 0
      ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/filterUtil.js
  20. 13 2
      ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/getNodeMsg.js
  21. 16 1
      ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/myFieldUtil.js
  22. 2 2
      ruoyi-ui/src/views/system/excuteBtnMange/index.vue
  23. 8 35
      ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

+ 21 - 21
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java

@@ -240,25 +240,25 @@ public class SysRole extends BaseEntity
         this.tenantName = tenantName;
     }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("roleId", getRoleId())
-            .append("roleName", getRoleName())
-            .append("roleKey", getRoleKey())
-            .append("roleSort", getRoleSort())
-            .append("dataScope", getDataScope())
-            .append("menuCheckStrictly", isMenuCheckStrictly())
-            .append("deptCheckStrictly", isDeptCheckStrictly())
-            .append("status", getStatus())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .append("tenantId", getTenantId())
-            .append("tenantName",getTenantName())
-            .toString();
-    }
+//    @Override
+//    public String toString() {
+//        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+//            .append("roleId", getRoleId())
+//            .append("roleName", getRoleName())
+//            .append("roleKey", getRoleKey())
+//            .append("roleSort", getRoleSort())
+//            .append("dataScope", getDataScope())
+//            .append("menuCheckStrictly", isMenuCheckStrictly())
+//            .append("deptCheckStrictly", isDeptCheckStrictly())
+//            .append("status", getStatus())
+//            .append("delFlag", getDelFlag())
+//            .append("createBy", getCreateBy())
+//            .append("createTime", getCreateTime())
+//            .append("updateBy", getUpdateBy())
+//            .append("updateTime", getUpdateTime())
+//            .append("remark", getRemark())
+//            .append("tenantId", getTenantId())
+//            .append("tenantName",getTenantName())
+//            .toString();
+//    }
 }

+ 18 - 18
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysTenant.java

@@ -135,24 +135,24 @@ public class SysTenant extends BaseEntity
         this.dataSource = dataSource;
     }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("tenantId", getTenantId())
-            .append("tenantName", getTenantName())
-            .append("tenantCode", getTenantCode())
-            .append("owner", getOwner())
-            .append("contactInfo", getContactInfo())
-            .append("address", getAddress())
-            .append("isDel", getIsDel())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("datasourceId",getTenantId())
-            .append("dataSource",getDataSource())
-            .toString();
-    }
+//    @Override
+//    public String toString() {
+//        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+//            .append("tenantId", getTenantId())
+//            .append("tenantName", getTenantName())
+//            .append("tenantCode", getTenantCode())
+//            .append("owner", getOwner())
+//            .append("contactInfo", getContactInfo())
+//            .append("address", getAddress())
+//            .append("isDel", getIsDel())
+//            .append("createBy", getCreateBy())
+//            .append("createTime", getCreateTime())
+//            .append("updateBy", getUpdateBy())
+//            .append("updateTime", getUpdateTime())
+//            .append("datasourceId",getTenantId())
+//            .append("dataSource",getDataSource())
+//            .toString();
+//    }
 
 
 

+ 27 - 27
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -342,31 +342,31 @@ public class SysUser extends BaseEntity
         this.tenantName = tenantName;
     }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("userId", getUserId())
-            .append("deptId", getDeptId())
-                .append("tenantId", getTenantId())
-            .append("userName", getUserName())
-            .append("nickName", getNickName())
-            .append("email", getEmail())
-            .append("phonenumber", getPhonenumber())
-            .append("sex", getSex())
-            .append("avatar", getAvatar())
-            .append("password", getPassword())
-            .append("status", getStatus())
-            .append("delFlag", getDelFlag())
-            .append("loginIp", getLoginIp())
-            .append("loginDate", getLoginDate())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .append("dept", getDept())
-            .append("tenant", getTenant())
-            .append("tenantName",getTenantName())
-            .toString();
-    }
+//    @Override
+//    public String toString() {
+//        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+//            .append("userId", getUserId())
+//            .append("deptId", getDeptId())
+//                .append("tenantId", getTenantId())
+//            .append("userName", getUserName())
+//            .append("nickName", getNickName())
+//            .append("email", getEmail())
+//            .append("phonenumber", getPhonenumber())
+//            .append("sex", getSex())
+//            .append("avatar", getAvatar())
+//            .append("password", getPassword())
+//            .append("status", getStatus())
+//            .append("delFlag", getDelFlag())
+//            .append("loginIp", getLoginIp())
+//            .append("loginDate", getLoginDate())
+//            .append("createBy", getCreateBy())
+//            .append("createTime", getCreateTime())
+//            .append("updateBy", getUpdateBy())
+//            .append("updateTime", getUpdateTime())
+//            .append("remark", getRemark())
+//            .append("dept", getDept())
+//            .append("tenant", getTenant())
+//            .append("tenantName",getTenantName())
+//            .toString();
+//    }
 }

+ 2 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java

@@ -68,7 +68,8 @@ public class SecurityUtils {
      **/
     public static LoginUser getLoginUser() {
         try {
-            return (LoginUser) getAuthentication().getPrincipal();
+            LoginUser llo = (LoginUser) getAuthentication().getPrincipal();
+            return llo;
         } catch (Exception e) {
             throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
         }

+ 4 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysActivationCodeLog.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.domain;
 
 import com.ruoyi.common.core.domain.BaseEntity;
 
+import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -9,7 +10,9 @@ import java.util.Date;
  * @date 2023-10-24 13:19
  * @Description:
  */
-public class SysActivationCodeLog extends BaseEntity {
+public class SysActivationCodeLog extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 1123123L;
 
     /** 日志id */
     private int logId;

+ 19 - 0
ruoyi-ui/src/api/tablelist/commonTable.js

@@ -159,6 +159,25 @@ export function updateStatistic(data) {
     baseURL: process.env.VUE_APP_BASE_API3
   })
 }
+// 新增动态表格统计
+export function addGroupTableStatistic(data) {
+  return request({
+    url: '/system/statistic/addGroupTableStatistic',
+    method: 'post',
+    data: data,
+    baseURL: process.env.VUE_APP_BASE_API3
+  })
+}
+
+// 修改动态格统计
+export function updateGroupTableStatistic(data) {
+  return request({
+    url: '/system/statistic/updateGroupTableStatistic',
+    method: 'put',
+    data: data,
+    baseURL: process.env.VUE_APP_BASE_API3
+  })
+}
 
 // 获取动态统计详细信息
 export function getStatistic(id) {

+ 0 - 1
ruoyi-ui/src/utils/request.js

@@ -6,7 +6,6 @@ import errorCode from '@/utils/errorCode'
 import { tansParams, blobValidate } from "@/utils/ruoyi";
 import cache from '@/plugins/cache'
 import { saveAs } from 'file-saver'
-import { throttle } from '@/utils/index'
 
 let downloadLoadingInstance;
 // 是否显示重新登录

+ 21 - 9
ruoyi-ui/src/views/bussiness/processMange.vue

@@ -40,9 +40,14 @@
               <el-radio-button :label="1">我的处理</el-radio-button>
               <el-radio-button :label="2">其他处理</el-radio-button>
             </el-radio-group>
-            <el-radio-group class="btn-list-two" v-model="taskStatus">
-              <el-radio-button :label="3">已完成</el-radio-button>
-              <el-radio-button :label="4">进行中</el-radio-button>
+            <el-radio-group
+              class="btn-list-two"
+              v-model="queryParams.bepTaskProcessState"
+              @change="getList"
+            >
+              <el-radio-button label="3">已完成</el-radio-button>
+              <el-radio-button label="0">进行中</el-radio-button>
+              <el-radio-button label="">所有</el-radio-button>
             </el-radio-group>
           </div>
           <div class="search-input">
@@ -218,12 +223,13 @@ export default {
       commonData: {},
       taskType: 1,
       queryString: "",
-      taskStatus: 3,
+      taskStatus: "",
       tableData: [], //表格数据
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        bepTaskProcessState: "",
       },
       total: 0,
       columns: [
@@ -286,7 +292,6 @@ export default {
     // 获取列表数据
     getList() {
       processList(this.queryParams).then((res) => {
-        console.log(res);
         if (res.code == 200) {
           this.tableData = res.rows.map((item) => item.resultMap);
           this.total = res.total;
@@ -353,9 +358,7 @@ export default {
           this.formType = "composeForm";
           this.groupKey = benTaskNodeFormKey;
           let queryPayload = {
-            "${task_plan_key": bepTaskPlanKey,
-            "${task_key": bepTaskKey,
-            "${task_node_key": bepTaskNodeKey,
+            row,
             groupKey: benTaskNodeFormKey,
           };
           this.$nextTick(() => {
@@ -380,6 +383,15 @@ export default {
         benTaskNodeKey,
         bepTaskProcessXmlContent
       );
+      // 只有完成状态的可以运行
+      if (this.formType == "composeForm") {
+        let res = this.$refs.dialogRef.getComposeFormData();
+        if (!res.isSuccess) {
+          this.$message.warning("非完成状态节点不能运行!");
+          return;
+        }
+      }
+      // return;
       let formData = await this.getFormData();
       formData.taskPlanKey = this.row.bepTaskPlanKey;
       let payLoad = {
@@ -387,7 +399,7 @@ export default {
         taskNodeKey: nodeId, //当前执行节点唯一编码
         nextNodeKey: nextNodeId, //下一节点编码
         implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
-        taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
+        // taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
         tableName: this.tableName,
         formDataMap: JSON.stringify(formData), //自定义表单组件收集的表单数据
       };

+ 14 - 1
ruoyi-ui/src/views/dialogMange/components/relayTable.vue

@@ -254,7 +254,20 @@ export default {
   watch: {
     formData: {
       handler(nval) {
-        this.$emit("subFormData", this.formData);
+        this.$emit("subFormData", {
+          ...this.formData,
+          primaryKeyList: this.primaryKeyList,
+        });
+      },
+      immediate: true,
+      deep: true,
+    },
+    primaryKeyList: {
+      handler(nval) {
+        this.$emit("subFormData", {
+          ...this.formData,
+          primaryKeyList: this.primaryKeyList,
+        });
       },
       immediate: true,
       deep: true,

+ 87 - 22
ruoyi-ui/src/views/dialogMange/index.vue

@@ -785,6 +785,8 @@ import {
   dragTableInfo,
   addStatistic,
   updateStatistic,
+  addGroupTableStatistic,
+  updateGroupTableStatistic,
 } from "@/api/tablelist/commonTable";
 import { listTable } from "@/api/dragform/tableList";
 import {
@@ -1581,7 +1583,13 @@ export default {
       };
     },
     // 递归拼接查询语句
-    getSQLString(tableFieldList, fieldArr, tableArr, sqlType = "mysql") {
+    getSQLString(
+      tableFieldList,
+      fieldArr,
+      tableArr,
+      sqlType = "mysql",
+      formData
+    ) {
       let prefix = "{DBNAME}.";
       let asOrSpace = sqlType == "oracle" ? " " : " AS ";
       for (let i = 0; i < tableFieldList.length; i++) {
@@ -1617,8 +1625,8 @@ export default {
         }
       }
       // 如果主键不包含显示,则添加至sql语句中
-      let isNotInclude = this.primaryKeyList.find(
-        (val) => !val.isShow && val.fieldName == this.formData.primaryKey
+      let isNotInclude = formData.primaryKeyList.find(
+        (val) => !val.isShow && val.fieldName == formData.primaryKey
       );
       if (isNotInclude) {
         fieldArr.push(
@@ -1686,7 +1694,11 @@ export default {
         this.tableFieldList,
         fieldNameArr,
         relaTypeArr,
-        sqlType
+        sqlType,
+        {
+          ...this.formData,
+          primaryKeyList: this.primaryKeyList,
+        }
       );
       let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
       let asOrSpace = sqlType == "oracle" ? " " : " AS ";
@@ -1713,7 +1725,15 @@ export default {
       sql += "SELECT ";
       let fieldNameArr = [],
         relaTypeArr = [];
-      this.getSQLString(this.subFiledList, fieldNameArr, relaTypeArr, sqlType);
+      console.log(this.subFiledList);
+      this.getSQLString(
+        this.subFiledList,
+        fieldNameArr,
+        relaTypeArr,
+        sqlType,
+        this.subformData
+      );
+      console.log(fieldNameArr);
       let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
       let asOrSpace = sqlType == "oracle" ? " " : " AS ";
       sql +=
@@ -1729,6 +1749,42 @@ export default {
       }
       return sql;
     },
+    // 拼接数据统计查询sql
+    getSQLStr3(fieldList, tableName) {
+      let prefix = "{DBNAME}.";
+      let sqlType = this.databaseType; //数据库类型
+      // let sqlType = "oracle";
+      let sql = "";
+      // mysql
+      sql += "SELECT ";
+      let fieldNameArr = [],
+        relaTypeArr = [];
+      this.countData.primaryKeyList = fieldList.filter(
+        (item) => !item.isChildren
+      );
+      this.getSQLString(
+        fieldList,
+        fieldNameArr,
+        relaTypeArr,
+        sqlType,
+        this.countData
+      );
+      console.log(fieldNameArr);
+      let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
+      let asOrSpace = sqlType == "oracle" ? " " : " AS ";
+      sql +=
+        fieldNameArr.join(",") +
+        " FROM " +
+        isNeedUsername +
+        prefix +
+        tableName +
+        asOrSpace +
+        tableName;
+      if (relaTypeArr.length) {
+        sql += " " + relaTypeArr.join(" ");
+      }
+      return sql;
+    },
     // 数据统计sql
     countGetSQLStr(countByFieldList, tableName) {
       let prefix = "{DBNAME}.";
@@ -1771,7 +1827,10 @@ export default {
       sql += "SELECT ";
       let fieldNameArr = [],
         relaTypeArr = [];
-      this.getSQLString(this.subFiledList, fieldNameArr, relaTypeArr, sqlType);
+      this.getSQLString(this.subFiledList, fieldNameArr, relaTypeArr, sqlType, {
+        ...this.countData,
+        primaryKeyList: this.primaryKeyList,
+      });
       let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
       let asOrSpace = sqlType == "oracle" ? " " : " AS ";
 
@@ -1798,7 +1857,10 @@ export default {
       sql += "SELECT ";
       let fieldNameArr = [],
         relaTypeArr = [];
-      this.getSQLString(this.subFiledList, fieldNameArr, relaTypeArr, sqlType);
+      this.getSQLString(this.subFiledList, fieldNameArr, relaTypeArr, sqlType, {
+        ...this.formData,
+        primaryKeyList: this.primaryKeyList,
+      });
       let isNeedUsername = sqlType == "oracle" ? this.username + "." : "";
       let asOrSpace = sqlType == "oracle" ? " " : " AS ";
 
@@ -2035,6 +2097,7 @@ export default {
 
           // 关联子表回显
           let subTableData = this.$refs.subList.getTableInfo();
+          this.subFiledList = subTableData.fieldInfo;
           let echoData2 = {
             tableName: subTableData.tableName,
             tableFieldData: subTableData.fieldInfo,
@@ -2072,7 +2135,7 @@ export default {
           let tableList2 = {
             tId: this.tId,
             tableKey: table2tableKey, //  暂定
-            dtTableName: this.subTableName,
+            dtTableName: subTableData.tableName,
             primaryKey: this.subformData.primaryKey,
             orderByColumn: this.subformData.orderByColumn,
             sortOrder: this.subformData.isAsc,
@@ -2114,7 +2177,8 @@ export default {
           let countTableKey = uuidv4();
 
           let conutCondition = tempconut.relaObj;
-
+          let countColumnName = [];
+          this.getCol(countData.fieldInfo, countColumnName);
           // 数据统计表格参数
           let countTableList = {
             tId: this.tId,
@@ -2124,13 +2188,14 @@ export default {
             orderByColumn: "",
             sortOrder: "",
             sqlKey: uuidv4(),
-            dtColumnName: "", //列字
+            dtColumnName: countColumnName, //列字
             timeFormat: "",
             searchFieldList: countFieldLists, //搜索字段数组
-            tableSql: this.countGetSQLStr(
-              countData.fieldInfo,
-              countData.tableName
-            ),
+            // tableSql: this.countGetSQLStr(
+            //   countData.fieldInfo,
+            //   countData.tableName
+            // ),
+            tableSql: this.getSQLStr3(countData.fieldInfo, countData.tableName),
             echoData: JSON.stringify(countEchoData),
             conditionDefaultValueMap: conutCondition,
           };
@@ -2311,22 +2376,22 @@ export default {
             });
             // 修改统计数据
 
-            await updateStatistic({
+            await updateGroupTableStatistic({
               tableKey: this.subEchoData.tableKey,
               dragTableStatisticList: this.dragTableStatisticList,
               tableSqlList: this.tableSqlList,
               searchFieldList: searchFieldList2,
               conditionDefaultValueMap: subCondition,
-              dtTableName: this.subTableName,
+              dtTableName: subTableData.tableName,
             });
 
             // 修改统计状态
-            await updateStatistic({
+            await updateGroupTableStatistic({
               tableKey: this.countEchoData.tableKey,
               dragTableStatisticList: stateList,
               tableSqlList: stateSqlList,
               searchFieldList: countFieldLists,
-              dtTableName: stateName,
+              dtTableName: countData.tableName,
               conditionDefaultValueMap: conutCondition,
             });
           } else {
@@ -2370,22 +2435,22 @@ export default {
 
             res = await addDialogGroup(data);
             //  统计数据
-            await addStatistic({
+            await addGroupTableStatistic({
               tableKey: tableList2.tableKey,
               dragTableStatisticList: this.dragTableStatisticList,
               tableSqlList: this.tableSqlList,
               searchFieldList: searchFieldList2,
-              dtTableName: this.subTableName,
+              dtTableName: subTableData.tableName,
               conditionDefaultValueMap: subCondition,
             });
             console.log(stateList);
             // 统计状态
-            await addStatistic({
+            await addGroupTableStatistic({
               tableKey: countTableList.tableKey,
               dragTableStatisticList: stateList,
               tableSqlList: stateSqlList,
               searchFieldList: countFieldLists,
-              dtTableName: stateName,
+              dtTableName: countData.tableName,
               conditionDefaultValueMap: conutCondition,
             });
           }

+ 315 - 38
ruoyi-ui/src/views/dialogTemplate/components/index.vue

@@ -2,32 +2,34 @@
   <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
+        class="base-info-item"
+        v-for="{ label, prop, value } in infoData"
+        :key="prop"
+      >
+        <span class="titlestyle">{{ label }}</span>
+        <span class="infostyle">{{ value }}</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 class="left" v-if="topTableCountInfo.length">
+          <p>{{ topTableCountInfo[0].title }}</p>
+          <i>{{
+            getDictLabel(topTableCountInfo[0].value, dict.type.node_task_status)
+          }}</i>
         </div>
-        <div class="right">
+        <!-- <div class="right">
           <p>是否外协</p>
           <el-checkbox v-model="checked"></el-checkbox>
-        </div>
+        </div> -->
       </div>
       <!-- 按钮组 -->
       <el-button-group>
         <el-button v-for="(item, index) in controlBtnArr" :key="index">
+          <!-- :loading="isLoading" -->
           <template>
-            <span @click="clickHandler(item, row)"
+            <span @click="clickHandler(item, index)"
               ><svg-icon
                 v-if="item.btnIcon"
                 class="pre-icon"
@@ -42,37 +44,47 @@
       <el-form ref="tableform" :model="tableDataForm">
         <el-table
           border
-          :data="tableData[1].data"
+          :data="tableData"
           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"
+            v-for="item in columns"
+            :prop="item.prop"
+            :label="item.label"
+            :key="item.prop"
             width="180"
+            align="center"
           >
             <template slot-scope="scope">
               <el-input
-                :v-if="scope.row[item.key]"
-                v-model="scope.row[item.key]"
+                v-if="!scope.row.id"
+                v-model="scope.row[item.prop]"
               ></el-input>
+              <span v-else>
+                {{ scope.row[item.prop] }}
+              </span>
             </template>
           </el-table-column>
           <el-table-column
-            v-if="isShowExcuteCol"
             label="操作"
             align="center"
             class-name="small-padding fixed-width"
           >
             <template slot-scope="scope">
-              <Menu
+              <!-- <Menu
                 :row="scope.row"
                 v-for="btnObj in excuteBtnArr"
                 :key="btnObj.id"
                 :listAll="btnObj"
                 @excuteHandler="excuteHandler"
-              ></Menu>
+              ></Menu> -->
+              <el-button
+                type="danger"
+                size="small"
+                @click="deleteHandler(scope.$index, scope.row)"
+              >
+                删除
+              </el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -80,7 +92,7 @@
         <div>
           <b>统计信息 </b>
           <span v-for="(item, index) in subCount" :key="index"
-            >{{ item.statisticTitle }}: {{ item.result }}</span
+            >{{ item.title }}: {{ item.value }}</span
           >
         </div>
 
@@ -108,6 +120,10 @@ import {
   btnCommonApi,
   dragTableInfo,
   unionListTableData,
+  getStatisticList,
+  addTableData,
+  delTableData,
+  batchEdit,
 } from "@/api/tablelist/commonTable";
 import { camelCase } from "@/utils";
 import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
@@ -115,17 +131,33 @@ import {
   getProcessPopupTableInfo,
   getProcessPopupTableList,
 } from "@/api/dragform/form"; //新的弹窗数据请求
+import dict from "@/utils/dict";
 
 export default {
   components: { Menu },
+  dicts: ["node_task_status"],
   data() {
     return {
+      isLoading: false,
+      conditions: {}, //查询条件
+      // 当前行信息
+      row: {},
+      groupKey: "",
       // 基础信息行数据
       infoData: [],
       listInfo: {},
       // 是否外协
       checked: false,
+      topTableCountInfo: [], //上部状态统计信息
+      topInfo: {},
+      topData: {},
+      // 表格数据
       tableData: [],
+      columns: [],
+      tableBtnInfo: {},
+      subTableName: "",
+      subTableInfo: {},
+      subCount: [], //表格统计数据
       // 动态增加表格数据
       editData: [],
       tableDataForm: {},
@@ -148,7 +180,6 @@ export default {
           // tableCondition: ''
         },
       },
-      columns: [],
       // 排序方式 默认降序
       sortOrder: true,
       tableName: "",
@@ -165,7 +196,7 @@ export default {
       controlBtnArr: [],
     };
   },
-  props: ["groupKey", "rowobj", "tableCount", "subCount", "subTableName"],
+  props: ["rowobj", "tableCount"],
   computed: {
     isShowExcuteCol() {
       return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
@@ -177,33 +208,166 @@ export default {
       let obj = {
         // id:'',
       };
+      this.columns.forEach((item) => {
+        obj[item.prop] = "";
+      });
+      console.log(obj);
       this.addListData.push(obj);
-      this.tableData[1].data.push(obj);
+      this.tableData.push(obj);
+    },
+    // 校验新增数据非空
+    getValidateRes(addListData) {
+      let hasEmpty = addListData.some((item) => {
+        return Object.values(item).some((val) => val == "");
+      });
+      return hasEmpty;
     },
     // 保存
     saveBtnHandler() {
-      console.log(this.addListData);
+      let addCondition = {
+        task_key: this.row.bpmExecuteProcessTaskKey,
+        task_node_key: this.row.benTaskNodeKey,
+      };
+      // console.log(this.conditions);
+      // for (const key in this.conditions) {
+      //   addCondition[key.replace("#{", "").split(".")[1]] =
+      //     this.conditions[key];
+      // }
+      let addListData = this.tableData.filter((item) => !item.id);
+      let validate = this.getValidateRes(addListData);
+      if (validate) {
+        this.$message.warning("请完善表单字段!");
+        return;
+      }
+      addListData.forEach((item) => {
+        Object.assign(item, addCondition);
+      });
+
       let data = {
-        addListMap: this.addListData,
+        addListMap: addListData,
         basicMap: {
-          btnType: 10,
+          // btnType: "INSERT",
           tableName: this.subTableName,
-          visible: true,
+          // visible: true,
         },
         commMap: {},
         conditionMap: {},
       };
-      btnCommonApi(data).then((res) => {
+      // btnCommonApi(data).then((res) => {
+      //   console.log("保存", res);
+      // });
+      addTableData(data).then((res) => {
         console.log("保存", res);
+        if (res.code == 200) {
+          this.reloadInfo();
+          this.$message.success("保存成功!");
+        } else {
+          this.$message.error("网络异常,请稍后保存");
+        }
+      });
+    },
+    // 设置基础信息-表格信息
+    setBaseInfo(baseObj, dataObj) {
+      let tempObj = JSON.parse(baseObj.dtColumnNameEcho);
+      let Keys = tempObj.map((item) => {
+        return {
+          prop: Object.keys(item)[0],
+          label: item[Object.keys(item)[0]],
+        };
+      });
+      this.infoData = Keys.map((item) => {
+        return {
+          ...item,
+          value: dataObj.resultMap[item.prop],
+        };
+      });
+    },
+    // 设置表格数据
+    async setTableData(tableInfo, tableData) {
+      let { dtColumnNameEcho, dragTableBtnList, tableKey, dtTableName } =
+        tableInfo;
+      this.subTableInfo = tableInfo;
+      this.tableData =
+        tableData.map((item) => {
+          return item.resultMap;
+        }) || [];
+      console.log(this.tableData);
+      this.subTableName = dtTableName;
+      console.log(this.subTableName);
+      this.tableBtnInfo = dragTableBtnList;
+      this.columns = JSON.parse(dtColumnNameEcho)?.map((item) => {
+        let prop = Object.keys(item)[0];
+        return {
+          prop,
+          label: item[prop],
+        };
+      });
+      let res = await this.getStatisticsData(tableKey);
+      this.subCount = res.map((item) => {
+        return {
+          title: item.statisticTitle,
+          value: item.result,
+        };
+      });
+    },
+    // 设置顶部状态数据
+    setTopData(baseObj, dataObj) {
+      let { dtColumnNameEcho, dragTableBtnList, tableKey } = baseObj;
+      this.controlBtnArr = dragTableBtnList[0].children;
+      let temp = JSON.parse(dtColumnNameEcho) || [];
+      this.topTableCountInfo = temp.map((item) => {
+        let prop = camelCase(Object.keys(item)[0]);
+        return {
+          prop,
+          title: item[Object.keys(item)[0]],
+          value: dataObj.resultMap[prop] || "未知状态",
+        };
       });
+      this.topInfo = baseObj;
+      this.topData = dataObj.resultMap;
+    },
+    // 获取统计数据
+    async getStatisticsData(tableKey) {
+      try {
+        let res = await getStatisticList({
+          queryMap: { tableKey, ...this.conditions },
+        });
+        if (res.code == 200) {
+          console.log(res);
+          return res.data;
+        } else {
+          throw new Error();
+        }
+      } catch (error) {
+        console.log(error);
+        this.$message.error("网络异常,获取数据失败");
+      }
+    },
+    reloadInfo() {
+      let { row, groupKey } = this;
+      this.getLists({ row, groupKey });
     },
     // 获取弹窗信息
     async getLists(payload) {
       // let res = await dragGroupTableInfo({ queryMap: { groupKey: groupKey } });
-      let resTableInfo = await getProcessPopupTableInfo({ queryMap: payload });
-      let resTableData = await getProcessPopupTableList({ queryMap: payload });
+      this.addListData = [];
+      this.row = payload.row;
+      this.groupKey = payload.groupKey;
+      let resTableInfo = await getProcessPopupTableInfo({
+        queryMap: { groupKey: payload.groupKey },
+      });
+
+      if (resTableInfo.code == 200) {
+        let res = await this.getTableData(resTableInfo.data, payload.row);
+        let { template } = resTableInfo.data.resultMap;
+        this.setBaseInfo(template[0], res[0][0]); //设置基础信息
+        this.setTableData(template[1], res[1]);
+        this.setTopData(template[2], res[2][0]);
+      }
+
       // 获取表格tablekey 和 sort
-      console.log(resTableData);
+      console.log(resTableInfo);
+      return;
       this.tableLists = JSON.parse(res.msg);
 
       this.tableLists.forEach(async (item) => {
@@ -242,6 +406,34 @@ export default {
         }
       });
     },
+    // 获取所有表格数据
+    async getTableData(tableInfo, row) {
+      let queryMap = {
+          groupKey: this.groupKey,
+        },
+        conditionKeys = [];
+      conditionKeys = tableInfo.resultMap?.condition.map((item) =>
+        camelCase(item.replace("#{", "").replace(".", "_"))
+      );
+      this.conditions = {};
+      conditionKeys.forEach((item, index) => {
+        queryMap[tableInfo.resultMap?.condition[index]] = row[item];
+        this.conditions[tableInfo.resultMap?.condition[index]] = row[item];
+      });
+
+      try {
+        let resTableData = await getProcessPopupTableList({
+          queryMap,
+        });
+        if (resTableData.code == 200) {
+          console.log("resTableData", resTableData);
+          return resTableData.data.resultMap.result;
+        }
+      } catch (error) {
+        console.log(error);
+        this.$message.error("网络异常");
+      }
+    },
     // 获取基础信息 表头数据
     async getTableHandle(res, sort) {
       this.columns = [];
@@ -336,6 +528,40 @@ export default {
         return this.tableList;
       }
     },
+    // 删除回调
+    async deleteHandler(index, row) {
+      if (row.id) {
+        let { primaryKey } = this.subTableInfo;
+        let ids = [];
+        ids.push(row[camelCase(primaryKey)]);
+        let payload = {
+          basicMap: {
+            tableName: this.subTableName,
+          },
+          conditionMap: {
+            // id: delIds,
+          },
+        };
+        payload.conditionMap[camelCase(primaryKey)] = ids;
+        // 发送请求 删除数据
+        this.$modal
+          .confirm('是否确认删除"' + ids + '"的数据项?')
+          .then(function () {
+            return delTableData(payload);
+            // return btnCommonApi(data);
+          })
+          .then(() => {
+            // 调用子组件查询方法 目的是携带上子组件中的查询参数
+            // this.$refs.mychild.pageList();
+            this.reloadInfo();
+            this.$modal.msgSuccess("删除成功");
+          })
+          .catch(() => {});
+        // let res = await delTableData(payload);
+      } else {
+        this.tableData.splice(index, 1);
+      }
+    },
     // 处理列表信息
     columnsHandler(columns) {
       let resArr = [];
@@ -388,7 +614,54 @@ export default {
       console.log(row);
     },
     // 按钮组点击
-    clickHandler(item, row) {},
+    async clickHandler(btnData) {
+      this.isLoading = true;
+      let { primaryKey, dtName } = this.topInfo;
+      let { btnParams, btnType, btnKey } = btnData;
+      let payload = {
+        basicMap: {
+          tableName: dtName,
+          // btnKey: btnData.btnKey,
+        },
+        conditionMap: {},
+        commMap: {},
+        // btnParametersMap: {},
+      };
+      payload.conditionMap[primaryKey] = this.topData[primaryKey];
+      if (btnParams) {
+        let tempParams = JSON.parse(btnParams)[0];
+        payload.commMap[tempParams.fieldName] = tempParams.fieldValue;
+      }
+      try {
+        let res = await batchEdit(payload);
+        if (res.code == 200) {
+          this.$message.success("修改成功!");
+          this.reloadInfo();
+        } else {
+          this.$message.error("网络异常请稍后再试");
+        }
+        this.isLoading = false;
+      } catch (error) {
+        this.isLoading = false;
+      }
+    },
+    // 获取字典对应label
+    getDictLabel(value, dictLsit = []) {
+      // value += "";
+      return dictLsit.find((item) => {
+        return item.value == value;
+      })?.label;
+    },
+    // 获取状态等数据
+    getComposeFormData() {
+      let res = {};
+      console.log(this.dict.type.node_task_status);
+      let currentStatus = this.dict.type.node_task_status.filter(
+        (item) => item.value == this.topTableCountInfo[0].value
+      );
+      res.isSuccess = currentStatus[0].raw.listClass == "success";
+      return res;
+    },
   },
   mounted() {
     // this.getLists()
@@ -426,7 +699,7 @@ export default {
       border-radius: 20px;
     }
     .infostyle {
-      background-color: #ebedf2;
+      // background-color: #ebedf2;
       color: #e84e95;
     }
   }
@@ -489,4 +762,8 @@ export default {
     }
   }
 }
+.base-info-item {
+  display: flex;
+  justify-content: space-between;
+}
 </style>

+ 7 - 4
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementAsyncContinuations.vue

@@ -73,10 +73,12 @@ import {
 import EventEmitter from "@utils/EventEmitter";
 import { getActive } from "@packages/bpmn-utils/BpmnDesignerUtils";
 import { listScript } from "@/api/bpmprocess/process";
+import { filterUtil } from "@packages/bo-utils/filterUtil.js";
 
 export default {
   name: "ElementAsyncContinuations",
   dicts: ["industry_type"],
+  props: ["allScriptList"],
   data() {
     return {
       acBefore: true,
@@ -136,10 +138,11 @@ export default {
         isEnablePaging: false,
         industryType,
       });
-      this.scriptList = res.rows.map((item) => ({
-        value: item.scriptKey,
-        label: item.scriptName,
-      }));
+      this.scriptList = filterUtil({ industryType }, this.allScriptList);
+      // this.scriptList = res.rows.map((item) => ({
+      //   value: item.scriptKey,
+      //   label: item.scriptName,
+      // }));
     },
   },
 };

+ 1 - 1
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementExcuteType.vue

@@ -63,7 +63,7 @@ export default {
   methods: {
     async initFormData() {
       if (!getNodeExecuteType(getActive())) {
-        this.updateNodeExcuteType("true");
+        this.updateNodeExcuteType("false");
       }
       this.nodeExecuteType = getNodeExecuteType(getActive());
     },

+ 50 - 23
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementExecuteUser.vue

@@ -34,8 +34,8 @@
         :label-width="100"
       >
         <div class="exe_user_type_input">
+          <!-- v-scroll="scrollHandler" -->
           <el-select
-            v-scroll="scrollHandler"
             v-model="exeUserValue"
             placeholder="请选择执行人"
             :multiple="exeUserType == 2"
@@ -77,9 +77,11 @@ import {
 import { getActive } from "@packages/bpmn-utils/BpmnDesignerUtils";
 import { listUser, deptTreeSelect } from "@/api/system/user";
 import { listRole } from "@/api/system/role";
+import { filterUtil } from "@packages/bo-utils/filterUtil.js";
 
 export default {
   name: "ElementExecuteUser",
+  props: ["allUserList", "allRoleList"],
   data() {
     return {
       userTypeList: [
@@ -127,6 +129,22 @@ export default {
           ?.label || "";
       return label;
     },
+    userList() {
+      return this.allUserList.map((item) => {
+        return {
+          value: item.userId.toString(),
+          label: item.nickName,
+        };
+      });
+    },
+    roleList() {
+      return this.allRoleList.map((item) => {
+        return {
+          value: item.roleKey,
+          label: item.roleName,
+        };
+      });
+    },
   },
   methods: {
     initFormData() {
@@ -164,32 +182,41 @@ export default {
       this.exeUserValue = "";
       if (!value) return;
       if (value == 3) {
-        this.exeRoleListHandler();
+        // this.exeRoleListHandler();
+        this.exeUserValueList = this.roleList;
       } else {
-        this.exeUserListHandler();
+        // this.exeUserListHandler();
+        this.exeUserValueList = this.userList;
       }
     },
     async exeUserListHandler() {
-      try {
-        let res = await listUser(this.queryParams);
-        if (res.code == 200) {
-          if (
-            res.rows.length == 0 ||
-            res.rows.length < this.queryParams.pageSize
-          ) {
-            this.isArriveBoottom = true; //到底了
-          }
-          res.rows.forEach((item) => {
-            this.exeUserValueList.push({
-              value: item.userId.toString(),
-              label: item.nickName,
-            });
-          });
-          console.log(this.exeUserValueList);
-        }
-      } catch (error) {
-        console.log(error);
-      }
+      this.allUserList.forEach((item) => {
+        this.exeUserValueList.push({
+          value: item.userId.toString(),
+          label: item.nickName,
+        });
+      });
+      // try {
+
+      //   let res = await listUser(this.queryParams);
+      //   if (res.code == 200) {
+      //     if (
+      //       res.rows.length == 0 ||
+      //       res.rows.length < this.queryParams.pageSize
+      //     ) {
+      //       this.isArriveBoottom = true; //到底了
+      //     }
+      //     res.rows.forEach((item) => {
+      //       this.exeUserValueList.push({
+      //         value: item.userId.toString(),
+      //         label: item.nickName,
+      //       });
+      //     });
+      //     console.log(this.exeUserValueList);
+      //   }
+      // } catch (error) {
+      //   console.log(error);
+      // }
     },
     async exeRoleListHandler() {
       try {

+ 15 - 9
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementNormalTask.vue

@@ -84,10 +84,12 @@ import {
 } from "@packages/bo-utils/myFieldUtil";
 import { getActive } from "@packages/bpmn-utils/BpmnDesignerUtils";
 import { listScript } from "@/api/bpmprocess/process";
+import { filterUtil } from "@packages/bo-utils/filterUtil.js";
 
 export default {
   name: "ElementNormalTask",
   dicts: ["industry_type", "script_trigger_type"],
+  props: ["allScriptList"],
   data() {
     return {
       scriptList: [],
@@ -121,15 +123,19 @@ export default {
       this.normalScriptKey = "";
     },
     async getScriptList(industryType) {
-      let res = await listScript({
-        isEnablePaging: false,
-        scriptType: 1,
-        industryType,
-      });
-      this.scriptList = res.rows.map((item) => ({
-        value: item.scriptKey,
-        label: item.scriptName,
-      }));
+      // let res = await listScript({
+      //   isEnablePaging: false,
+      //   scriptType: 1,
+      //   industryType,
+      // });
+      this.scriptList = filterUtil(
+        { scriptType: 1, industryType },
+        this.allScriptList
+      );
+      // this.scriptList = res.rows.map((item) => ({
+      //   value: item.scriptKey,
+      //   label: item.scriptName,
+      // }));
     },
     updateScriptKey(value) {
       setNormalScriptKey(getActive(), value);

+ 179 - 18
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementUnusualTasks.vue

@@ -121,6 +121,64 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item prop="formType" label="表单类型" size="normal">
+          <el-select
+            v-model="newUnusualTask.formType"
+            placeholder="请选择表单类型"
+            clearable
+            filterable
+            @change="formTypeChangeHandler"
+          >
+            <el-option
+              v-for="item in formTypeList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          v-if="newUnusualTask.formType == 'designForm'"
+          label="表单:"
+          size="normal"
+        >
+          <el-col :span="8">
+            <el-input
+              v-model="newUnusualTask.compName"
+              placeholder="组件名"
+              size="normal"
+              clearable
+            ></el-input>
+          </el-col>
+          <el-col class="line" :span="2">---</el-col>
+          <el-col :span="8">
+            <el-input
+              v-model="newUnusualTask.scriptName"
+              placeholder="脚本名"
+              size="normal"
+              clearable
+            ></el-input>
+          </el-col>
+        </el-form-item>
+
+        <el-form-item v-else prop="formId" label="表单" size="normal">
+          <el-select
+            v-model="newUnusualTask.formId"
+            placeholder="请选择表单"
+            clearable
+            filterable
+            @change="formChangeHandler"
+          >
+            <el-option
+              v-for="item in formList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
       </el-form>
       <template #footer>
         <el-button @click="modelVisible = false">取 消</el-button>
@@ -145,10 +203,13 @@ import { getScriptType } from "@packages/bo-utils/scriptUtil";
 import EventEmitter from "@utils/EventEmitter";
 import { getActive } from "@packages/bpmn-utils/BpmnDesignerUtils";
 import { listScript } from "@/api/bpmprocess/process";
-
+import { listForm } from "@/api/dragform/form";
+import { listGroup } from "@/api/relateTable/index.js";
+import { filterUtil } from "@packages/bo-utils/filterUtil.js";
 export default {
   name: "ElementUnusualTasks",
   dicts: ["script_trigger_type", "bpm_script_type", "industry_type"],
+  props: ["allScriptList"],
   data() {
     return {
       modelVisible: false,
@@ -160,7 +221,7 @@ export default {
       formRules: {
         scriptKey: {
           required: true,
-          trigger: ["blur", "change"],
+          trigger: ["change"],
           message: "任务脚本不能为空",
         },
         // scriptTriggerType: {
@@ -180,28 +241,38 @@ export default {
           label: "自动",
         },
       ],
+      formTypeList: [
+        {
+          value: "dragForm",
+          label: "拖拽表单",
+        },
+        {
+          value: "composeForm",
+          label: "组合表单",
+        },
+        {
+          value: "designForm",
+          label: "自定义表单",
+        },
+      ],
+      formList: [],
     };
   },
 
   mounted() {
+    console.log("allScriptList", this.allScriptList);
     this.reloadExtensionListeners();
     EventEmitter.on("element-update", this.reloadExtensionListeners);
   },
   methods: {
     reloadExtensionListeners() {
       this.modelVisible = false;
-      this.newUnusualTask = {
-        scriptKey: "",
-        scriptTriggerType: "0",
-        industryType: "0",
-        scriptName: "",
-        // event: getDefaultEvent(getActive()),
-        // type: "class",
-      };
+
       this._listenersRaw = getUnusualTasks(getActive());
       this.scriptForm.scriptTriggerType = getScriptTriggerType(getActive());
 
       this.listeners = getUnusualTaskTableData(this._listenersRaw);
+      console.log(this.listeners);
     },
 
     updateScriptType(value) {
@@ -229,8 +300,23 @@ export default {
 
     async openScriptModel(index, TaskData) {
       this.activeIndex = index;
+      this.newUnusualTask = {
+        scriptKey: "",
+        scriptTriggerType: "0",
+        industryType: "0",
+        scriptName: "",
+        formType: "",
+        formId: "",
+        compName: "", //组件名
+        // event: getDefaultEvent(getActive()),
+        // type: "class",
+      };
+      console.log(JSON.parse(JSON.stringify(TaskData)));
       TaskData && (this.newUnusualTask = JSON.parse(JSON.stringify(TaskData)));
-      this.getScriptList(this.newUnusualTask.industryType);
+      console.log(this.newUnusualTask);
+      let { industryType, formType } = this.newUnusualTask;
+      this.getScriptList(industryType);
+      formType && this.switchFormType(formType);
       this.modelVisible = true;
       await this.$nextTick();
       this.$refs.formRef && this.$refs.formRef.clearValidate();
@@ -260,16 +346,91 @@ export default {
 
     // 获取脚本列表
     async getScriptList(industryType = "0") {
-      let res = await listScript({
-        isEnablePaging: false,
+      // let res = await listScript({
+      //   isEnablePaging: false,
+      //   scriptType: "0",
+      //   industryType,
+      // });
+      // this.scriptKeyList = res.rows.map((item) => ({
+      //   value: item.scriptKey,
+      //   label: item.scriptName,
+      // }));
+      // 自定义筛选数据
+      let condition = {
         scriptType: "0",
         industryType,
-      });
-      this.scriptKeyList = res.rows.map((item) => ({
-        value: item.scriptKey,
-        label: item.scriptName,
-      }));
+      };
+      this.scriptKeyList = filterUtil(condition, this.allScriptList).map(
+        (item) => ({
+          value: item.scriptKey,
+          label: item.scriptName,
+        })
+      );
+    },
+    async getDragFormList() {
+      try {
+        let res = await listForm({ isEnablePaging: false });
+        if (res.code == 200) {
+          this.formList = res.rows.map((item) => {
+            return {
+              label: item.dfName,
+              value: item.fId + "",
+            };
+          });
+        } else {
+          throw Error(res);
+        }
+      } catch (error) {
+        console.log(error);
+        this.$message.warning("网络异常,获取表单列表失败");
+      }
+    },
+    async getComposeFormList() {
+      try {
+        let res = await listGroup({ isEnablePaging: false });
+        if (res.code == 200) {
+          this.formList = res.rows.map((item) => {
+            return {
+              label: item.groupName,
+              value: item.groupKey,
+            };
+          });
+        } else {
+          throw Error(res);
+        }
+      } catch (error) {
+        console.log(error);
+        this.$message.warning("网络异常,获取表单列表失败");
+      }
+    },
+
+    // 表单类型改变回调
+    formTypeChangeHandler(type) {
+      this.switchFormType(type);
+      this.newUnusualTask.formId = "";
+    },
+    switchFormType(type) {
+      switch (type) {
+        case "dragForm":
+          this.getDragFormList();
+          break;
+        case "composeForm":
+          this.getComposeFormList();
+        default:
+          break;
+      }
+    },
+    // 表单改变回调
+    formChangeHandler(formId) {
+      console.log(this.newUnusualTask.formId);
+      console.log(this.formList);
     },
   },
 };
 </script>
+<style lang="scss" scoped>
+.line {
+  display: flex;
+  justify-content: center;
+}
+</style>

+ 83 - 3
ruoyi-ui/src/views/system/bpmnPro/components/Panel/index.vue

@@ -6,7 +6,14 @@
       <p>{{ customTranslate(currentElementType || "Process") }}</p>
     </div>
     <el-collapse>
-      <component v-for="cp in this.renderComponents" :key="cp.name" :is="cp" />
+      <component
+        v-for="cp in this.renderComponents"
+        :key="cp.name"
+        :is="cp"
+        :allScriptList="allScriptList"
+        :allUserList="allUserList"
+        :allRoleList="allRoleList"
+      />
     </el-collapse>
   </div>
 </template>
@@ -30,6 +37,8 @@ import {
   isTaskOrUserTask,
   isUserTask,
   isProcess,
+  isStart,
+  isEnd,
 } from "@packages/bo-utils/myFieldUtil";
 import ElementGenerations from "@packages/Panel/components/ElementGenerations";
 import ElementDocumentations from "@packages/Panel/components/ElementDocumentations";
@@ -48,6 +57,9 @@ import ElementUnusualTasks from "@packages/Panel/components/ElementUnusualTasks"
 import ElementNormalTask from "@packages/Panel/components/ElementNormalTask";
 import ElementExcuteType from "@packages/Panel/components/ElementExcuteType";
 
+import { listScript } from "@/api/bpmprocess/process";
+import { listUser } from "@/api/system/user";
+import { listRole } from "@/api/system/role";
 export default {
   name: "BpmnPanel",
   components: {
@@ -76,6 +88,10 @@ export default {
       currentElementId: undefined,
       customTranslate,
       renderComponents: [],
+      // 列表选择数据
+      allScriptList: [],
+      allUserList: [],
+      allRoleList: [],
     };
   },
   created() {
@@ -97,6 +113,9 @@ export default {
     });
   },
   mounted() {
+    this.getAllScriptList();
+    this.getAllRoleList();
+    this.getAllUserList();
     !this.currentElementId && this.setCurrentElement();
   },
   methods: {
@@ -157,6 +176,8 @@ export default {
       //   this.renderComponents.push(ElementExecutionListeners);
       // isAsynchronous(element) &&
       !isProcess(element) &&
+        !isStart(element) &&
+        !isEnd(element) &&
         this.renderComponents.push(ElementAsyncContinuations); //节点前后执行的数据
       // isStartInitializable(element) &&
       //   this.renderComponents.push(ElementStartInitiator);
@@ -165,13 +186,72 @@ export default {
       isTaskOrUserTask(element) &&
         this.renderComponents.push(ElementExecuteForm);
       !isProcess(element) && this.renderComponents.push(ElementNormalTask); //正常节点
-      !isProcess(element) && this.renderComponents.push(ElementUnusualTasks); //可处理异常
+      !isProcess(element) &&
+        !isStart(element) &&
+        !isEnd(element) &&
+        this.renderComponents.push(ElementUnusualTasks); //可处理异常
       isUserTask(element) && this.renderComponents.push(ElementExecuteUser);
-      !isProcess(element) && this.renderComponents.push(ElementExcuteType);
+      !isProcess(element) &&
+        !isStart(element) &&
+        !isEnd(element) &&
+        this.renderComponents.push(ElementExcuteType);
 
       // !isProcess(element) && this.renderComponents.push(ElementBeforeNode);
       // !isProcess(element) && this.renderComponents.push(ElementAfterNode);
     },
+    // 获取所有脚本列表
+    async getAllScriptList() {
+      try {
+        let res = await listScript({ isEnablePaging: false });
+        // console.log(res);
+        if (res.code == 200) {
+          this.allScriptList = res.rows;
+        } else {
+          throw Error(res?.msg);
+        }
+      } catch (error) {
+        this.$message.warning("网络异常,请稍后再试");
+      }
+    },
+    // 获取所有用户列表
+    async getAllUserList() {
+      try {
+        let res = await listUser({ isEnablePaging: false });
+        if (res.code == 200) {
+          // res.rows.forEach((item) => {
+          // this.exeUserValueList.push({
+          //   value: item.userId.toString(),
+          //   label: item.nickName,
+          // });
+
+          // });
+          this.allUserList = res.rows;
+        } else {
+          throw Error(res?.msg);
+        }
+      } catch (error) {
+        this.$message.warning("网络异常,请稍后再试");
+      }
+    },
+    // 获取所有角色列表
+    async getAllRoleList() {
+      try {
+        let res = await listRole(this.queryParams);
+        if (res.code == 200) {
+          // res.rows.forEach((item) => {
+          //   this.exeUserValueList.push({
+          //     value: item.roleKey,
+          //     label: item.roleName,
+          //   });
+          // });
+          this.allRoleList = res.rows;
+        } else {
+          throw Error(res?.msg);
+        }
+      } catch (error) {
+        this.$message.warning("网络异常,请稍后再试");
+      }
+    },
   },
 };
 </script>

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

@@ -180,8 +180,6 @@ export default {
     },
     async saveNodeMsg(obj) {
       let data = getNodeMsg(obj);
-      // console.dir(obj.getElementsByTagName("bpmn:process")[0].id);
-      // return;
       if (!data.bpmProcessConfigurationList.length) return;
       data.bpmProcessConfigurationList.forEach((item) => {
         // item.createBy = this.$store.state.user.name;

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

@@ -0,0 +1,18 @@
+
+
+/**
+ * 
+ * @param {Object} condition 筛选条件
+ * @param {Array} dataList   被筛选数组
+ */
+export function filterUtil(condition = {}, dataList = []) {
+  if (dataList.length == 0) return [];
+  const keys = Object.keys(condition)
+  if (keys.length == 0) return []
+
+  let res = dataList.filter(item => keys.every(key =>
+    condition[key] == item[key]
+  )
+  )
+  return res;
+}

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

@@ -68,7 +68,7 @@ export function getNodeMsg(xmlObj) {
     bpmNodeHandleUserList = [...bpmNodeHandleUserList, ...bpmNodeHandleUser]
     attributeArray.forEach(attr => {
       let tempAttr = prefix + ':' + attr
-      nodeObj[attr] = node.attributes[tempAttr]?.nodeValue || ''
+      nodeObj[attr] = node.attributes[tempAttr]?.nodeValue || 'true'
     });
     nodeObj.nodeKey = node.id;
     nodeObj.nodeName = node.getAttribute('name');
@@ -114,9 +114,20 @@ function getNodeException(node, nodeObj) {
     if (extensionElements) {
       extensionElements.childNodes.forEach(item => {
         if (item.nodeName == `${prefix}:unusualTask`) {
+          let formName = '', formType = item.attributes.formType?.nodeValue || '';
+
+          if (formType == 'designForm') {
+            formName = item.getAttribute('compName') + '-' + item.getAttribute('scriptName');
+          } else {
+            formName = item.getAttribute('scriptName');
+          }
           res.push({
             scriptKey: item.attributes.scriptKey?.nodeValue,
-            scriptTriggerType: item.attributes?.scriptTriggerType?.nodeValue || 0
+            // scriptTriggerType: item.attributes?.scriptTriggerType?.nodeValue || 0,
+            scriptTriggerType: 0,
+            nodeFormType: item.getAttribute('formType'),
+            scriptNodeName: formName,
+            formKey: item.getAttribute('formId')
           })
         }
       })

+ 16 - 1
ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/myFieldUtil.js

@@ -112,6 +112,14 @@ export function getNodeFormType(element) {
 export function isUserTask(element) {
   return is(element, 'bpmn:UserTask');
 }
+// 开始节点
+export function isStart(element) {
+  return is(element, 'bpmn:StartEvent')
+}
+// 结束节点
+export function isEnd(element) {
+  return is(element, 'bpmn:EndEvent')
+}
 
 export function setExecuteUser(element, value, isUpdate) {
   const prefix = getProcessEngine();
@@ -234,6 +242,10 @@ export function getUnusualTaskTableData(moddleList = []) {
       scriptTriggerType: item?.$attrs.scriptTriggerType || '0',
       scriptName: item?.$attrs.scriptName || '',
       industryType: item?.$attrs.industryType || '0',
+      formType: item?.$attrs.formType || '',
+      formId: item?.$attrs.formId || '',
+      designFormName: item?.$attrs.designFormName || '',
+      compName: item?.$attrs.compName || '',
     }
   })
   return res
@@ -242,7 +254,7 @@ export function getUnusualTaskTableData(moddleList = []) {
 function updateTaskProperty(element, listener, props) {
   const modeling = getModeler.getModeling();
   const prefix = getProcessEngine();
-  const { scriptKey, scriptTriggerType, scriptName, industryType } = props;
+  const { scriptKey, scriptTriggerType, scriptName, industryType, formType, compName, formId, formName } = props;
 
   const updateProperty = (key, value) =>
     modeling.updateModdleProperties(element, listener, { [`${key}`]: value });
@@ -251,6 +263,9 @@ function updateTaskProperty(element, listener, props) {
   scriptTriggerType && updateProperty("scriptTriggerType", scriptTriggerType);
   scriptName && updateProperty('scriptName', scriptName);
   industryType && updateProperty('industryType', industryType);
+  formType && updateProperty('formType', formType)
+  compName && updateProperty('compName', compName)
+  formId && updateProperty('formId', formId)
 }
 // 修改任务
 export function updateUnusualTask(element, props, listener) {

+ 2 - 2
ruoyi-ui/src/views/system/excuteBtnMange/index.vue

@@ -815,7 +815,7 @@ export default {
             btnGroupName: "新建按钮组",
             btnName: "新建按钮组",
             children: [],
-            btnType: 6,
+            btnType: "DIRECTORY",
           };
 
           let _this = this;
@@ -828,7 +828,7 @@ export default {
     // 只保留目录
     getAllMenuList(node) {
       // 如果当前节点的btnType等于6,则保留该节点,否则删除该节点
-      if (node.btnType == 6) {
+      if (node.btnType == "DIRECTORY") {
         if (Array.isArray(node.children) && node.children.length != 0) {
           // 递归遍历子节点,并删除所有btnType不等于6的子节点
           let _this = this;

+ 8 - 35
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -437,18 +437,9 @@ export default {
     // 得到当前展示的table的唯一标识
     this.tableKey = this.$route.query.tableKey;
   },
-  watch: {
-    tableList: {
-      handler(val) {
-        // console.log(JSON.parse(JSON.stringify(val)), "tableListChange");
-      },
-      deep: true,
-    },
-  },
+  watch: {},
   computed: {
     isShowExcuteCol() {
-      // console.log(!this.excuteBtnArr?.every((arr) => arr.children.length == 0));
-      // return true;
       return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
     },
   },
@@ -471,7 +462,6 @@ export default {
           });
           // 获取操作列的按钮数据
           this.excuteBtnArr = res.data.resultMap.button;
-          // console.log('res', this.templateInfo)
           this.queryParams.orderByColumn =
             res.data.resultMap.querySql.orderByColumn;
           this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
@@ -494,7 +484,6 @@ export default {
           );
           // 根据sql语句查询当前表数据
           unionListTableData(this.queryParams).then(async (res) => {
-            // console.log('unionListTableData');
             this.tableList = [];
             res.rows.forEach((item) => {
               this.tableList.push(item.resultMap);
@@ -526,7 +515,6 @@ export default {
               queryCriteriaValue: this.queryParams.queryMap.queryCriteriaValue,
             },
           }).then((res) => {
-            // console.log('getStatisticList', res);
             this.statisticList = res.data;
           });
         });
@@ -685,11 +673,7 @@ export default {
     },
     /** 修改按钮操作 */
     async handleUpdate(row, btnData) {
-      // console.log(this.currentBtnData);
-
       let nameTable = this.templateInfo.template.dtTableName;
-      // console.log(nameTable);
-      // console.log('row', row);
       this.rowobj = {};
       let obj = {};
       for (let key in row) {
@@ -702,7 +686,6 @@ export default {
         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("当前表格未绑定表单!");
@@ -713,7 +696,7 @@ export default {
       try {
         let payLoad = {
           basicMap: {
-            btnType: UPDATE,
+            btnType: "UPDATE",
             btnKey: this.currentBtnData.btnKey,
             visible: "false",
             sqlKey: this.templateInfo.template.sqlKey,
@@ -753,8 +736,6 @@ export default {
           this.groupKey = this.currentBtnData.btnTableFormGroupKey;
           this.$nextTick(() => {
             let refChild = this.$refs.dialogRef;
-
-            // console.log(this.$refs.dialogRef);
             refChild.getLists(this.groupKey);
           });
 
@@ -766,7 +747,6 @@ export default {
               tableKey: tablesubKey,
             },
           }).then((res) => {
-            // console.log('统计', res);
             this.subCount = res.data;
           });
 
@@ -791,7 +771,6 @@ export default {
             "'" + obj[this.templateInfo.template.primaryKey] + "'";
 
           getStatisticList(data).then((res) => {
-            // console.log('统计', res);
             this.tableCount = res.data;
           });
         }
@@ -846,11 +825,9 @@ export default {
     },
     // 添加真正的字段名
     addRealFieldName(row) {
-      console.log(row);
       let fieldList = Object.keys(row);
       // 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);
@@ -887,13 +864,12 @@ 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]);
       }
       let data = {
         basicMap: {
-          btnType: 9,
+          btnType: btnData.btnType,
           btnKey: btnData.btnKey,
           tableName: this.tableName,
         },
@@ -929,7 +905,6 @@ export default {
     // 批量删除接口
     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 = [];
@@ -1042,7 +1017,6 @@ export default {
     // 弹窗新增的数
     addListHandler(val) {
       this.addLists.push(...val);
-      // console.log(this.addLists);
     },
     // 绑定弹窗Dialog确定按钮
     btnComfirm() {
@@ -1063,7 +1037,6 @@ export default {
     },
     // 去掉表名 开头字母小写
     formatField(field = "", tableName) {
-      // console.log(field, tableName);
       let temp = field.replace(tableName, "");
       return toUnderline(temp[0].toLowerCase() + temp.slice(1));
     },
@@ -1096,10 +1069,12 @@ export default {
           if (Object.keys(this.defaultValue).length) {
             //修改
             // 后台接收需要是表中字段真实的名称,无所谓驼峰。
+            // data.conditionMap[this.templateInfo.template?.primaryKey] =
+            //   this.defaultValue[
+            //     camelCase(this.templateInfo.template?.primaryKey)
+            //   ];
             data.conditionMap[this.templateInfo.template?.primaryKey] =
-              this.defaultValue[
-                camelCase(this.templateInfo.template?.primaryKey)
-              ];
+              this.defaultValue[this.templateInfo.template?.primaryKey];
             Object.keys(values).map((k) => {
               data.commMap[k] = values[k];
             });
@@ -1222,9 +1197,7 @@ export default {
       );
       if (!fieldConditionList.length) return tableList;
       let res = await this.setDictStyleData();
-      // console.log(res);
       this.dictStyleObj = res;
-      // console.log(JSON.parse(JSON.stringify(this.dictStyleObj)));
       tableList.forEach((row) => {
         // if (!row.styleFieldObj) row.styleFieldObj = {};
         for (let i = 0; i < fieldConditionList.length; i++) {