文档管理 复制链接修正

This commit is contained in:
lxy 2025-09-23 18:13:37 +08:00
parent d18e4cb1eb
commit 0a359eb287
10 changed files with 13 additions and 16 deletions

View File

@ -1,10 +1,9 @@
/// <reference types="react" />
import { GenerateUrlFn } from "../../../types/Article";
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "article", true, {
entityId: string;
articleMenuId: string | undefined;
generateUrl: GenerateUrlFn;
empty: import("react").ReactNode;
empty: React.ReactNode | undefined;
menuCheck: (isArticle: boolean) => void;
}>) => React.ReactElement;
export default _default;

View File

@ -92,7 +92,7 @@ export default OakComponent({
},
onCopy(articleId) {
const { generateUrl } = this.props;
const url = generateUrl ? generateUrl('article', 'detail', articleId) : '';
const url = generateUrl ? generateUrl('article', 'copy', articleId) : '';
copy(url);
this.setMessage({
type: 'success',

View File

@ -1,4 +1,3 @@
/// <reference types="react" />
import { EntityDict } from "../../../oak-app-domain";
import { GenerateUrlFn } from "../../../types/Article";
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
@ -6,8 +5,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
entityId: string;
title: string;
origin: string;
menuEmpty: import("react").ReactNode;
articleEmpty: import("react").ReactNode;
menuEmpty: React.ReactNode | undefined;
articleEmpty: React.ReactNode | undefined;
generateUrl: GenerateUrlFn;
}>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="react" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "articleMenu", true, {
entity: string;
entityId: string;
@ -6,8 +5,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
origin: string;
onMenuClick: (menuId: string, menuName: string, isArticle: boolean) => void;
onArticleClick: (atricleId: string) => void;
empty: import("react").ReactNode;
empty: React.ReactNode | undefined;
changeAddArticle: (show: boolean) => void;
generateUrl: (mode: 'article' | 'menu', type: 'detail' | 'editor' | 'preview' | 'create', id: string) => string;
generateUrl: (mode: "article" | "menu", type: "detail" | "editor" | "preview" | "create", id: string) => string;
}>) => React.ReactElement;
export default _default;

View File

@ -115,7 +115,7 @@ export default OakComponent({
},
onCopy(menuId) {
const { generateUrl } = this.props;
const url = generateUrl ? generateUrl('menu', 'detail', menuId) : '';
const url = generateUrl ? generateUrl('menu', 'copy', menuId) : '';
copy(url);
this.setMessage({
type: 'success',

View File

@ -1,3 +1,3 @@
export type Mode = 'article' | 'menu';
export type Action = 'detail' | 'editor' | 'preview' | 'create';
export type Action = 'detail' | 'editor' | 'preview' | 'create' | 'copy';
export type GenerateUrlFn = (mode: Mode, type: Action, id: string) => string;

View File

@ -1,3 +1,3 @@
export type Mode = 'article' | 'menu';
export type Action = 'detail' | 'editor' | 'preview' | 'create';
export type Action = 'detail' | 'editor' | 'preview' | 'create' | 'copy';
export type GenerateUrlFn = (mode: Mode, type: Action, id: string) => string;

View File

@ -47,7 +47,7 @@ export default OakComponent({
properties: {
entityId: '',
articleMenuId: '' as string | undefined,
generateUrl: ((mode: Mode, type: Action, id: string) => {}) as GenerateUrlFn,
generateUrl: ((mode: Mode, type: Action, id: string) => { }) as GenerateUrlFn,
empty: undefined as React.ReactNode | undefined,
menuCheck: (isArticle: boolean) => undefined as void,
},
@ -97,7 +97,7 @@ export default OakComponent({
},
onCopy(articleId: string) {
const { generateUrl } = this.props;
const url = generateUrl ? generateUrl('article', 'detail', articleId) : '';
const url = generateUrl ? generateUrl('article', 'copy', articleId) : '';
copy(url);
this.setMessage({
type: 'success',

View File

@ -118,7 +118,7 @@ export default OakComponent({
},
onCopy(menuId: string) {
const { generateUrl } = this.props;
const url = generateUrl ? generateUrl('menu', 'detail', menuId) : '';
const url = generateUrl ? generateUrl('menu', 'copy', menuId) : '';
copy(url);
this.setMessage({
type: 'success',

View File

@ -1,4 +1,4 @@
export type Mode = 'article' | 'menu';
export type Action = 'detail' | 'editor' | 'preview' | 'create';
export type Action = 'detail' | 'editor' | 'preview' | 'create' | 'copy';
export type GenerateUrlFn = (mode: Mode, type: Action, id: string) => string;