mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2025-10-17 07:03:58 +00:00
update 优化 支持前端返回节点扩展数据(按钮权限 抄送人 扩展变量)
This commit is contained in:
@@ -20,7 +20,7 @@ export interface UserQuery extends PageQuery {
|
|||||||
status?: string;
|
status?: string;
|
||||||
deptId?: string | number;
|
deptId?: string | number;
|
||||||
roleId?: string | number;
|
roleId?: string | number;
|
||||||
userIds?: string;
|
userIds?: string | number | (string | number)[] | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -30,18 +30,20 @@ export interface FlowTaskVO {
|
|||||||
nodeRatio: string | number;
|
nodeRatio: string | number;
|
||||||
version?: string;
|
version?: string;
|
||||||
applyNode?: boolean;
|
applyNode?: boolean;
|
||||||
buttonList?: buttonList[];
|
buttonList?: ButtonList[];
|
||||||
|
copyList?: FlowCopyVo[];
|
||||||
|
varList?: Map<string, string>;
|
||||||
businessCode: string;
|
businessCode: string;
|
||||||
businessTitle: string;
|
businessTitle: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface buttonList {
|
export interface ButtonList {
|
||||||
code: string;
|
code: string;
|
||||||
show: boolean;
|
show: boolean;
|
||||||
}
|
}
|
||||||
export interface VariableVo {
|
export interface FlowCopyVo {
|
||||||
key: string;
|
userId: string | number;
|
||||||
value: string;
|
userName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TaskOperationBo {
|
export interface TaskOperationBo {
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<el-form-item label="抄送" v-if="buttonObj.copy">
|
<el-form-item label="抄送" v-if="buttonObj.copy">
|
||||||
<el-button type="primary" icon="Plus" circle @click="openUserSelectCopy" />
|
<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)">
|
<el-tag v-for="user in selectCopyUserList" :key="user.userId" closable style="margin: 2px" @close="handleCopyCloseTag(user)">
|
||||||
{{ user.nickName }}
|
{{ user.userName }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="buttonObj.pop && nestNodeList && nestNodeList.length > 0" label="下一步审批人" prop="assigneeMap">
|
<el-form-item v-if="buttonObj.pop && nestNodeList && nestNodeList.length > 0" label="下一步审批人" prop="assigneeMap">
|
||||||
@@ -149,8 +149,7 @@ import {
|
|||||||
import UserSelect from '@/components/UserSelect';
|
import UserSelect from '@/components/UserSelect';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
import { UserVO } from '@/api/system/user/types';
|
import { FlowCopyVo, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
|
||||||
import { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
|
|
||||||
|
|
||||||
const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
|
const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
|
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
@@ -171,9 +170,11 @@ const buttonDisabled = ref(true);
|
|||||||
//任务id
|
//任务id
|
||||||
const taskId = ref<string>('');
|
const taskId = ref<string>('');
|
||||||
//抄送人
|
//抄送人
|
||||||
const selectCopyUserList = ref<UserVO[]>([]);
|
const selectCopyUserList = ref<FlowCopyVo[]>([]);
|
||||||
//抄送人id
|
//抄送人id
|
||||||
const selectCopyUserIds = ref<string>(undefined);
|
const selectCopyUserIds = ref<string>(undefined);
|
||||||
|
//自定义节点变量
|
||||||
|
const varNodeList = ref<Map<string, string>>(undefined);
|
||||||
//可减签的人员
|
//可减签的人员
|
||||||
const deleteUserList = ref<any>([]);
|
const deleteUserList = ref<any>([]);
|
||||||
//弹窗可选择的人员id
|
//弹窗可选择的人员id
|
||||||
@@ -218,6 +219,8 @@ const task = ref<FlowTaskVO>({
|
|||||||
nodeRatio: undefined,
|
nodeRatio: undefined,
|
||||||
applyNode: false,
|
applyNode: false,
|
||||||
buttonList: [],
|
buttonList: [],
|
||||||
|
copyList: [],
|
||||||
|
varList: undefined,
|
||||||
businessCode: undefined,
|
businessCode: undefined,
|
||||||
businessTitle: undefined
|
businessTitle: undefined
|
||||||
});
|
});
|
||||||
@@ -259,6 +262,10 @@ const openDialog = async (id?: string) => {
|
|||||||
task.value.buttonList.forEach((e) => {
|
task.value.buttonList.forEach((e) => {
|
||||||
buttonObj.value[e.code] = e.show;
|
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;
|
buttonDisabled.value = false;
|
||||||
try {
|
try {
|
||||||
const data = {
|
const data = {
|
||||||
@@ -303,7 +310,7 @@ const handleCompleteTask = async () => {
|
|||||||
selectCopyUserList.value.forEach((e) => {
|
selectCopyUserList.value.forEach((e) => {
|
||||||
const copyUser = {
|
const copyUser = {
|
||||||
userId: e.userId,
|
userId: e.userId,
|
||||||
userName: e.nickName
|
userName: e.userName
|
||||||
};
|
};
|
||||||
flowCopyList.push(copyUser);
|
flowCopyList.push(copyUser);
|
||||||
});
|
});
|
||||||
@@ -366,14 +373,14 @@ const openUserSelectCopy = () => {
|
|||||||
userSelectCopyRef.value.open();
|
userSelectCopyRef.value.open();
|
||||||
};
|
};
|
||||||
//确认抄送人员
|
//确认抄送人员
|
||||||
const userSelectCopyCallBack = (data: UserVO[]) => {
|
const userSelectCopyCallBack = (data: FlowCopyVo[]) => {
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
selectCopyUserList.value = data;
|
selectCopyUserList.value = data;
|
||||||
selectCopyUserIds.value = selectCopyUserList.value.map((item) => item.userId).join(',');
|
selectCopyUserIds.value = selectCopyUserList.value.map((item) => item.userId).join(',');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//删除抄送人员
|
//删除抄送人员
|
||||||
const handleCopyCloseTag = (user: UserVO) => {
|
const handleCopyCloseTag = (user: FlowCopyVo) => {
|
||||||
const userId = user.userId;
|
const userId = user.userId;
|
||||||
// 使用split删除用户
|
// 使用split删除用户
|
||||||
const index = selectCopyUserList.value.findIndex((item) => item.userId === userId);
|
const index = selectCopyUserList.value.findIndex((item) => item.userId === userId);
|
||||||
|
@@ -173,7 +173,7 @@ const computedIds = (data) => {
|
|||||||
} else if (typeof data === 'string') {
|
} else if (typeof data === 'string') {
|
||||||
return data.split(',');
|
return data.split(',');
|
||||||
} else if (typeof data === 'number') {
|
} else if (typeof data === 'number') {
|
||||||
return [data];
|
return [String(data)];
|
||||||
} else {
|
} else {
|
||||||
console.warn('<UserSelect> The data type of data should be array or string or number, but I received other');
|
console.warn('<UserSelect> The data type of data should be array or string or number, but I received other');
|
||||||
return [];
|
return [];
|
||||||
|
Reference in New Issue
Block a user