Prechádzať zdrojové kódy

!683 代码审查修改
Merge pull request !683 from Lesan/feature/bpm-代码审查

芋道源码 6 mesiacov pred
rodič
commit
473d681c11

+ 8 - 8
src/components/SimpleProcessDesignerV2/src/consts.ts

@@ -246,15 +246,15 @@ export type AssignEmptyHandler = {
 export type ListenerHandler = {
   enable: boolean
   path?: string
-  header?: ListenerParam[]
-  body?: ListenerParam[]
+  header?: HttpRequestParam[]
+  body?: HttpRequestParam[]
 }
-export type ListenerParam = {
+export type HttpRequestParam = {
   key: string
   type: number
   value: string
 }
-export enum ListenerParamTypeEnum {
+export enum BpmHttpRequestParamTypeEnum {
   /**
    * 固定值
    */
@@ -264,7 +264,7 @@ export enum ListenerParamTypeEnum {
    */
   FROM_FORM = 2
 }
-export const LISTENER_MAP_TYPES = [
+export const BPM_HTTP_REQUEST_PARAM_TYPES = [
   {
     value: 1,
     label: '固定值'
@@ -710,7 +710,7 @@ export type RouterSetting = {
   conditionGroups: ConditionGroup
 }
 
-// ==================== 触发器相关定义 ==================== 
+// ==================== 触发器相关定义 ====================
 /**
  * 触发器节点结构定义
  */
@@ -736,9 +736,9 @@ export type HttpRequestTriggerSetting = {
   // 请求 URL
   url: string
   // 请求头参数设置
-  header?: ListenerParam[] // TODO 需要重命名一下
+  header?: HttpRequestParam[]
   // 请求体参数设置
-  body?: ListenerParam[]
+  body?: HttpRequestParam[]
 }
 
 export const TRIGGER_TYPES: DictDataVO[] = [

+ 7 - 7
src/components/SimpleProcessDesignerV2/src/node.ts

@@ -14,7 +14,7 @@ import {
   AssignStartUserHandlerType,
   AssignEmptyHandlerType,
   FieldPermissionType,
-  ListenerParam
+  HttpRequestParam
 } from './consts'
 import { parseFormFields } from '@/components/FormCreate/src/utils'
 
@@ -139,20 +139,20 @@ export type UserTaskFormType = {
   taskCreateListenerEnable?: boolean
   taskCreateListenerPath?: string
   taskCreateListener?: {
-    header: ListenerParam[],
-    body: ListenerParam[]
+    header: HttpRequestParam[],
+    body: HttpRequestParam[]
   }
   taskAssignListenerEnable?: boolean
   taskAssignListenerPath?: string
   taskAssignListener?: {
-    header: ListenerParam[],
-    body: ListenerParam[]
+    header: HttpRequestParam[],
+    body: HttpRequestParam[]
   }
   taskCompleteListenerEnable?: boolean
   taskCompleteListenerPath?: string
   taskCompleteListener?:{
-    header: ListenerParam[],
-    body: ListenerParam[]
+    header: HttpRequestParam[],
+    body: HttpRequestParam[]
   }
   signEnable: boolean
   reasonRequire: boolean

+ 9 - 9
src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue

@@ -16,7 +16,7 @@
       <div class="mr-2">
         <el-select class="w-100px!" v-model="item.type">
           <el-option
-            v-for="types in LISTENER_MAP_TYPES"
+            v-for="types in BPM_HTTP_REQUEST_PARAM_TYPES"
             :key="types.value"
             :label="types.label"
             :value="types.value"
@@ -33,7 +33,7 @@
           }"
         >
           <el-input
-            v-if="item.type === ListenerParamTypeEnum.FIXED_VALUE"
+            v-if="item.type === BpmHttpRequestParamTypeEnum.FIXED_VALUE"
             class="w-160px"
             v-model="item.value"
           />
@@ -47,7 +47,7 @@
           }"
         >
           <el-select
-            v-if="item.type === ListenerParamTypeEnum.FROM_FORM"
+            v-if="item.type === BpmHttpRequestParamTypeEnum.FROM_FORM"
             class="w-160px!"
             v-model="item.value"
           >
@@ -86,7 +86,7 @@
       <div class="mr-2">
         <el-select class="w-100px!" v-model="item.type">
           <el-option
-            v-for="types in LISTENER_MAP_TYPES"
+            v-for="types in BPM_HTTP_REQUEST_PARAM_TYPES"
             :key="types.value"
             :label="types.label"
             :value="types.value"
@@ -103,7 +103,7 @@
           }"
         >
           <el-input
-            v-if="item.type === ListenerParamTypeEnum.FIXED_VALUE"
+            v-if="item.type === BpmHttpRequestParamTypeEnum.FIXED_VALUE"
             class="w-160px"
             v-model="item.value"
           />
@@ -117,7 +117,7 @@
           }"
         >
           <el-select
-            v-if="item.type === ListenerParamTypeEnum.FROM_FORM"
+            v-if="item.type === BpmHttpRequestParamTypeEnum.FROM_FORM"
             class="w-160px!"
             v-model="item.value"
           >
@@ -141,7 +141,7 @@
   </el-form-item>
 </template>
 <script setup lang="ts">
-import { ListenerParam, LISTENER_MAP_TYPES, ListenerParamTypeEnum } from '../../consts'
+import { HttpRequestParam, BPM_HTTP_REQUEST_PARAM_TYPES, BpmHttpRequestParamTypeEnum } from '../../consts'
 import { useFormFields } from '../../node'
 defineOptions({
   name: 'HttpRequestParamSetting'
@@ -149,12 +149,12 @@ defineOptions({
 
 const props = defineProps({
   header: {
-    type: Array as () => ListenerParam[],
+    type: Array as () => HttpRequestParam[],
     required: false,
     default: () => []
   },
   body: {
-    type: Array as () => ListenerParam[],
+    type: Array as () => HttpRequestParam[],
     required: false,
     default: () => []
   },

+ 9 - 0
src/views/bpm/task/copy/index.vue

@@ -46,6 +46,15 @@
     <el-table v-loading="loading" :data="list">
       <!-- TODO 芋艿:增加摘要 -->
       <el-table-column align="center" label="流程名" prop="processInstanceName" min-width="180" />
+      <el-table-column label="摘要" prop="summary" min-width="180">
+        <template #default="scope">
+          <div class="flex flex-col" v-if="scope.row.summary && scope.row.summary.length > 0">
+            <div v-for="(item, index) in scope.row.summary" :key="index">
+              <el-text type="info"> {{ item.key }} : {{ item.value }} </el-text>
+            </div>
+          </div>
+        </template>
+      </el-table-column>
       <el-table-column
         align="center"
         label="流程发起人"

+ 3 - 3
src/views/bpm/task/done/index.vue

@@ -122,10 +122,10 @@
   <ContentWrap>
     <el-table v-loading="loading" :data="list">
       <el-table-column align="center" label="流程" prop="processInstance.name" width="180" />
-      <el-table-column label="摘要" prop="summary" min-width="180">
+      <el-table-column label="摘要" prop="processInstance.summary" min-width="180">
         <template #default="scope">
-          <div class="flex flex-col" v-if="scope.row.summary && scope.row.summary.length > 0">
-            <div v-for="(item, index) in scope.row.summary" :key="index">
+          <div class="flex flex-col" v-if="scope.row.processInstance.summary && scope.row.processInstance.summary.length > 0">
+            <div v-for="(item, index) in scope.row.processInstance.summary" :key="index">
               <el-text type="info"> {{ item.key }} : {{ item.value }} </el-text>
             </div>
           </div>

+ 3 - 3
src/views/bpm/task/todo/index.vue

@@ -105,10 +105,10 @@
   <ContentWrap>
     <el-table v-loading="loading" :data="list">
       <el-table-column align="center" label="流程" prop="processInstance.name" width="180" />
-      <el-table-column label="摘要" prop="summary" min-width="180">
+      <el-table-column label="摘要" prop="processInstance.summary" min-width="180">
         <template #default="scope">
-          <div class="flex flex-col" v-if="scope.row.summary && scope.row.summary.length > 0">
-            <div v-for="(item, index) in scope.row.summary" :key="index">
+          <div class="flex flex-col" v-if="scope.row.processInstance.summary && scope.row.processInstance.summary.length > 0">
+            <div v-for="(item, index) in scope.row.processInstance.summary" :key="index">
               <el-text type="info"> {{ item.key }} : {{ item.value }} </el-text>
             </div>
           </div>