Skip to content

Commit c17d63d

Browse files
committed
feat: 完善右键菜单显示效果
1 parent 2c9e318 commit c17d63d

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oflow-interface",
3-
"version": "0.8.29",
3+
"version": "0.8.30",
44
"description": "Interface package for O FLOW. You can use this package to build your own plugin that can control anything.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/api/service/main/context-menu/dto/menu-line-create-options.interface.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export interface MenuLineCreateOptions {
77
type?: MenuLineType, // 菜单选项种类 默认BUTTON
88
text?: string, // 文本
99
tip?: string, // 附属文本
10-
icon?: FunctionComponent | undefined, // 图标
10+
icon?: FunctionComponent, // 图标
11+
view?: FunctionComponent, // 图标
1112
color?: string, // 字体颜色
1213
disabled?: boolean, // 禁用状态 默认false
1314
shortcut?: string, // 快捷键
@@ -16,6 +17,8 @@ export interface MenuLineCreateOptions {
1617
onMouseOver?: (e: any) => void, // 鼠标悬停事件
1718
onMouseOut?: (e: any) => void, // 鼠标移开事件
1819

20+
closeAllOnClick?: boolean, // 点击后关闭所有菜单 Type为Button时默认true 其他默认false
21+
1922
checkboxDefaultValue?: boolean, // 复选框状态 默认值false
2023
onCheckboxChange?: (value: any) => void, // 复选框回调
2124

src/api/service/main/context-menu/dto/menu-line-type.enum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export enum MenuLineType {
44
DIVIDER = 'DIVIDER', // 分割线
55
CHECKBOX = 'CHECKBOX', // 单个可选中复选框
66
SUB = 'SUB', // 二级菜单
7+
VIEW = 'VIEW', // 无
78
}

src/api/service/main/context-menu/menu-line.class.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class MenuLine {
1414
public text: string = '',
1515
public tip: string = '',
1616
public icon: FunctionComponent | undefined = undefined,
17+
public view: FunctionComponent | undefined = undefined,
1718
public color: string = '',
1819
public disabled: boolean = false,
1920
public shortcut: string = '',
@@ -22,6 +23,8 @@ export default class MenuLine {
2223
public onMouseOver: ((e: any) => void) = () => {},
2324
public onMouseOut: ((e: any) => void) = () => {},
2425

26+
public closeAllOnClick: boolean = type === MenuLineType.BUTTON,
27+
2528
public checkboxDefaultValue: boolean = false,
2629
public onCheckboxChange: ((value: any) => void) = () => {},
2730

@@ -40,12 +43,14 @@ export default class MenuLine {
4043
options.text,
4144
options.tip,
4245
options.icon,
46+
options.view,
4347
options.color,
4448
options.disabled,
4549
options.shortcut,
4650
options.onClick,
4751
options.onMouseOver,
4852
options.onMouseOut,
53+
options.closeAllOnClick,
4954
options.checkboxDefaultValue,
5055
options.onCheckboxChange,
5156
options.sub,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export enum RvModelOrigin {
2-
Basic = 'basic',
3-
Provider = 'provider',
4-
Upload = 'upload',
2+
BASIC = 'BASIC',
3+
PROVIDER = 'PROVIDER',
4+
UPLOAD = 'UPLOAD',
55
}

src/api/service/sync/interface/model/rv-model.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export default interface RvModel {
1414
mid: string
1515
args: any
1616
fid: string
17-
}
17+
}

0 commit comments

Comments
 (0)