Explorar el Código

update 优化 支持前端返回节点扩展数据(按钮权限 抄送人 扩展变量)

疯狂的狮子Li hace 7 meses
padre
commit
43b4e74c9c

+ 1 - 1
src/api/system/user/types.ts

@@ -20,7 +20,7 @@ export interface UserQuery extends PageQuery {
   status?: string;
   deptId?: string | number;
   roleId?: string | number;
-  userIds?: string;
+  userIds?:  string | number | (string | number)[] | undefined;
 }
 
 /**

+ 7 - 5
src/api/workflow/task/types.ts

@@ -30,18 +30,20 @@ export interface FlowTaskVO {
   nodeRatio: string | number;
   version?: string;
   applyNode?: boolean;
-  buttonList?: buttonList[];
+  buttonList?: ButtonList[];
+  copyList?: FlowCopyVo[];
+  varList?: Map<string, string>;
   businessCode: string;
   businessTitle: string;
 }
 
-export interface buttonList {
+export interface ButtonList {
   code: string;
   show: boolean;
 }
-export interface VariableVo {
-  key: string;
-  value: string;
+export interface FlowCopyVo {
+  userId: string | number;
+  userName: string;
 }
 
 export interface TaskOperationBo {

+ 14 - 7
src/components/Process/submitVerify.vue

@@ -14,7 +14,7 @@
       <el-form-item label="抄送" v-if="buttonObj.copy">
         <el-button type="primary" icon="Plus" circle @click="openUserSelectCopy" />
         <el-tag v-for="user in selectCopyUserList" :key="user.userId" closable style="margin: 2px" @close="handleCopyCloseTag(user)">
-          {{ user.nickName }}
+          {{ user.userName }}
         </el-tag>
       </el-form-item>
       <el-form-item v-if="buttonObj.pop && nestNodeList && nestNodeList.length > 0" label="下一步审批人" prop="assigneeMap">
@@ -149,8 +149,7 @@ import {
 import UserSelect from '@/components/UserSelect';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-import { UserVO } from '@/api/system/user/types';
-import { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
+import { FlowCopyVo, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
 
 const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
 const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
@@ -171,9 +170,11 @@ const buttonDisabled = ref(true);
 //任务id
 const taskId = ref<string>('');
 //抄送人
-const selectCopyUserList = ref<UserVO[]>([]);
+const selectCopyUserList = ref<FlowCopyVo[]>([]);
 //抄送人id
 const selectCopyUserIds = ref<string>(undefined);
+//自定义节点变量
+const varNodeList = ref<Map<string, string>>(undefined);
 //可减签的人员
 const deleteUserList = ref<any>([]);
 //弹窗可选择的人员id
@@ -218,6 +219,8 @@ const task = ref<FlowTaskVO>({
   nodeRatio: undefined,
   applyNode: false,
   buttonList: [],
+  copyList: [],
+  varList: undefined,
   businessCode: undefined,
   businessTitle: undefined
 });
@@ -259,6 +262,10 @@ const openDialog = async (id?: string) => {
   task.value.buttonList.forEach((e) => {
     buttonObj.value[e.code] = e.show;
   });
+  selectCopyUserList.value = task.value.copyList;
+  selectCopyUserIds.value = task.value.copyList.map((e) => e.userId).join(',');
+  varNodeList.value = task.value.varList;
+  console.log('varNodeList', varNodeList.value)
   buttonDisabled.value = false;
   try {
     const data = {
@@ -303,7 +310,7 @@ const handleCompleteTask = async () => {
     selectCopyUserList.value.forEach((e) => {
       const copyUser = {
         userId: e.userId,
-        userName: e.nickName
+        userName: e.userName
       };
       flowCopyList.push(copyUser);
     });
@@ -366,14 +373,14 @@ const openUserSelectCopy = () => {
   userSelectCopyRef.value.open();
 };
 //确认抄送人员
-const userSelectCopyCallBack = (data: UserVO[]) => {
+const userSelectCopyCallBack = (data: FlowCopyVo[]) => {
   if (data && data.length > 0) {
     selectCopyUserList.value = data;
     selectCopyUserIds.value = selectCopyUserList.value.map((item) => item.userId).join(',');
   }
 };
 //删除抄送人员
-const handleCopyCloseTag = (user: UserVO) => {
+const handleCopyCloseTag = (user: FlowCopyVo) => {
   const userId = user.userId;
   // 使用split删除用户
   const index = selectCopyUserList.value.findIndex((item) => item.userId === userId);

+ 1 - 1
src/components/UserSelect/index.vue

@@ -173,7 +173,7 @@ const computedIds = (data) => {
   } else if (typeof data === 'string') {
     return data.split(',');
   } else if (typeof data === 'number') {
-    return [data];
+    return [String(data)];
   } else {
     console.warn('<UserSelect> The data type of data should be array or string or number, but I received other');
     return [];