Vanessa 2025-03-06 11:54:24 +08:00
parent a742bd49a6
commit 2889872b89
2 changed files with 21 additions and 4 deletions

View file

@ -22,6 +22,7 @@ import {Model} from "../layout/Model";
import {getDockByType} from "../layout/tabUtil";
import {getAllEditor, getAllModels} from "../layout/getAll";
import {openSetting} from "../config";
import {openAttr, openFileAttr} from "../menus/commonMenuItem";
let openTab;
let openWindow;
@ -177,6 +178,19 @@ const getModelByDockType = (type: TDock | string) => {
/// #endif
};
const openAttributePanel = (options: {
data?: IObject // 块属性值
nodeElement?: HTMLElement, // 块元素
focusName: "bookmark" | "name" | "alias" | "memo" | "av" | "custom", // av 为数据库页签custom 为自定义页签,其余为内置输入框
protyle?: IProtyle, // 有数据库时需要传入 protyle
}) => {
if (options.data) {
openFileAttr(options.data, options.focusName, options.protyle);
} else {
openAttr(options.nodeElement, options.focusName, options.protyle);
}
};
export const API = {
adaptHotkey: updateHotkeyTip,
confirm: confirmDialog,
@ -201,5 +215,6 @@ export const API = {
getAllEditor,
getAllModels,
platformUtils,
openSetting
openSetting,
openAttributePanel,
};