Explorar el Código

流程节点添加绑定表单类型

lph hace 1 año
padre
commit
71a8ab70c8

+ 8 - 0
ruoyi-ui/src/components/kFormDesign/OptionsEdit.vue

@@ -478,6 +478,11 @@ export default {
       deep: true,
       immediate: true,
     },
+    // 'formData.tableName': {
+    //   handler(nval) {
+    //     if(nval){}
+    //   }
+    // }
   },
   computed: {
     ...mapState({
@@ -565,6 +570,9 @@ export default {
         };
       }
       this.formData.dynamicName = this.myOptions.dynamicKey;
+      if (this.formData.tableName) {
+        this.getFieldOptions(this.formData.tableName);
+      }
       this.isShow = true;
     },
     // 弹窗取消回调

+ 8 - 2
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>
@@ -249,7 +249,13 @@ export default {
     // 打开运行节点弹窗
     opneExecuteNode(row) {
       console.log(row);
-      this.myForm = row.benTaskNodeName.split("-")[0];
+      let preFix = row.benTaskNodeName.split("-")[0];
+      if (preFix) {
+        //前缀式表单弹窗
+        this.myForm = preFix;
+      } else {
+        //拖拽表单或工艺弹窗
+      }
       this.row = row; //记录当前行数据
       this.open = true; // 打开弹窗
       // 根据当前节点绑定的表单信息查询对应的表单进行展示

+ 0 - 1
ruoyi-ui/src/views/dialogTemplate/indexTable.vue

@@ -122,7 +122,6 @@ import { addGroup, listGroup, getTable, delGroup, updataGroup } from '@/api/rela
 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";

+ 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 - 1
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',

+ 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');

+ 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>