跳到主要内容

打开创建事项视图

openItemCreateScreen api打开主应用的事项创建弹出框,并填写初始化数据和自定义数据。

参数

interface User {
objectId: string;
username: string;
avatar?: File;

emailVerified: boolean;
email?: string;
deleted: boolean;
enabled: boolean;
nickname?: string;
isSystem: boolean;
role?: Record<string, any>;
}
interface ChildCardDepsProps {
workspaceId?: string;
itemTypeIds: string[];
ancestors: string[]; // Item ancestors
fieldValues?: Record<string, any>;
}

interface ItemProps {
assignee?: User[];
itemType?: { objectId: string } // Item type
workspace?: { objectId: string, key: string }; // Item belongs to the workspace
itemGroup?: { objectId: string }; // Item group
itemLinkTypeId?: string; // Item lint type id
}

// Event params
interface Props {
createItemByScript?: boolean; // Whether to trigger the creation of items through scripts
addLink?: boolean; // Whether to create and associate
inwardItem?: { objectId?: string; itemType?: string }; // Related item
extraData?: Record<string, any>; // Create and edit the item data in the pop-up window for the event to be used for data linkage
initItemData?: ItemProps; // Default initial rendering of modal data
childCardDeps?: ChildCardDepsProps; // Create subitems
workspaceId?: string; // Workspace id
extraFieldsData?: Record<string, any>; // Initialized field data
}

示例

import createProximaSdk from '@giteeteam/proxima-sdk-js';
const proxima = createProximaSdk()

// EXAMPLE 1
// Allow passing empty objects
proxima.execute('openItemCreateScreen', {});

// EXAMPLE 2
proxima.execute('openItemCreateScreen', { initItemData: {itemType: ''} });