feat: approval, todo initiator (#1317)
Reviewed-on: daoyoucloud/tachybase#1317 Reviewed-by: sealday <zhanglin@daoyoucloud.com> Co-authored-by: bai.zixv <bai.zixv@foxmail.com> Co-committed-by: bai.zixv <bai.zixv@foxmail.com>
This commit is contained in:
parent
41b8d00223
commit
3a1e3d92e6
@ -15,6 +15,27 @@ export const CollectionApprovalTodos = {
|
||||
'x-component': 'InputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'createdBy',
|
||||
target: 'users',
|
||||
foreignKey: 'createdById',
|
||||
interface: 'm2o',
|
||||
uiSchema: {
|
||||
type: 'number',
|
||||
title: `{{t("Initiator", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'RemoteSelect',
|
||||
'x-component-props': {
|
||||
fieldNames: {
|
||||
label: 'nickname',
|
||||
value: 'id',
|
||||
},
|
||||
service: {
|
||||
resource: 'users',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'user',
|
||||
|
@ -53,6 +53,8 @@ const schemaItems = [
|
||||
collection: 'approvalRecords',
|
||||
params: {
|
||||
appends: [
|
||||
'createdBy.id',
|
||||
'createdBy.nickname',
|
||||
'user.id',
|
||||
'user.nickname',
|
||||
'node.id',
|
||||
|
@ -101,6 +101,20 @@ export const SchemaApprovalBlockTodos = {
|
||||
},
|
||||
},
|
||||
},
|
||||
createdBy: {
|
||||
type: 'void',
|
||||
title: `{{t("Initiator", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'TableV2.Column.Decorator',
|
||||
'x-component': 'TableV2.Column',
|
||||
'x-component-props': { width: 160 },
|
||||
properties: {
|
||||
createdBy: {
|
||||
type: 'string',
|
||||
'x-component': 'UserColumn',
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
},
|
||||
user: {
|
||||
type: 'void',
|
||||
'x-decorator': 'TableV2.Column.Decorator',
|
||||
|
@ -131,7 +131,7 @@ export default class ApprovalInstruction extends Instruction {
|
||||
'executions.id': processor.execution.id,
|
||||
},
|
||||
fields: ['id', 'status', 'data', 'summary', 'collectionName'],
|
||||
appends: ['approvalExecutions'],
|
||||
appends: ['approvalExecutions', 'createdBy'],
|
||||
except: ['data'],
|
||||
});
|
||||
const approvalExecution = approval.approvalExecutions.find((item) => item.executionId === processor.execution.id);
|
||||
@ -144,6 +144,7 @@ export default class ApprovalInstruction extends Instruction {
|
||||
assignees.map((userId, index) => ({
|
||||
approvalId: approval.id,
|
||||
approvalExecutionId: approvalExecution.id,
|
||||
createdById: approval.createdBy?.id,
|
||||
userId,
|
||||
jobId: job.id,
|
||||
nodeId: node.id,
|
||||
|
@ -5,6 +5,7 @@ export default defineCollection({
|
||||
namespace: 'workflow.approvalRecords',
|
||||
dumpRules: 'required',
|
||||
name: 'approvalRecords',
|
||||
createdBy: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'string',
|
||||
|
Loading…
Reference in New Issue
Block a user