Merge branch 'feat/backset.cn-dev-2.1' of ssh://git.mozzie.cn:10022/mozzie/pnpm-backset.cn into feat/backset.cn-dev-2.1
This commit is contained in:
commit
03804b8364
|
@ -85,35 +85,65 @@ export default function Guide(props: IProps) {
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (props.defaultValue)
|
||||
vditorRef.current = new Vditor("vditor", {
|
||||
height: 600,
|
||||
cache: {
|
||||
id: props.id,
|
||||
enable: false,
|
||||
vditorRef.current = new Vditor("vditor", {
|
||||
height: 600,
|
||||
cache: {
|
||||
id: props.id,
|
||||
enable: false,
|
||||
},
|
||||
toolbar: [...toolbar, "|", submitTool],
|
||||
value: props.defaultValue ?? "",
|
||||
hint: { delay: 200, emoji },
|
||||
counter: { enable: true },
|
||||
preview: { actions: ["desktop", "mobile"] },
|
||||
after: () => console.log("[info] vditor init success..."),
|
||||
upload: {
|
||||
accept: "image/*",
|
||||
url: "/api/vod/oss/image/upload",
|
||||
multiple: false,
|
||||
success(_, res) {
|
||||
const { code, data, msg } = JSON.parse(res);
|
||||
if (code === 10000) {
|
||||
message.success("上传成功");
|
||||
const { name, url } = data;
|
||||
vditorRef.current?.insertValue(``);
|
||||
} else {
|
||||
message.error(msg);
|
||||
}
|
||||
},
|
||||
toolbar: [...toolbar, "|", submitTool],
|
||||
value: props.defaultValue ?? "",
|
||||
hint: { delay: 200, emoji },
|
||||
counter: { enable: true },
|
||||
preview: { actions: ["desktop", "mobile"] },
|
||||
after: () => console.log("[info] vditor init success..."),
|
||||
upload: {
|
||||
accept: "image/*",
|
||||
url: "/api/vod/oss/image/upload",
|
||||
multiple: false,
|
||||
success(_, res) {
|
||||
const { code, data, msg } = JSON.parse(res);
|
||||
if (code === 10000) {
|
||||
message.success("上传成功");
|
||||
const { name, url } = data;
|
||||
vditorRef.current?.insertValue(``);
|
||||
} else {
|
||||
message.error(msg);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
vditorRef.current = new Vditor("vditor", {
|
||||
height: 600,
|
||||
cache: {
|
||||
id: props.id,
|
||||
enable: false,
|
||||
},
|
||||
toolbar: [...toolbar, "|", submitTool],
|
||||
value: props.defaultValue ?? "",
|
||||
hint: { delay: 200, emoji },
|
||||
counter: { enable: true },
|
||||
preview: { actions: ["desktop", "mobile"] },
|
||||
after: () => console.log("[info] vditor init success..."),
|
||||
upload: {
|
||||
accept: "image/*",
|
||||
url: "/api/vod/oss/image/upload",
|
||||
multiple: false,
|
||||
success(_, res) {
|
||||
const { code, data, msg } = JSON.parse(res);
|
||||
if (code === 10000) {
|
||||
message.success("上传成功");
|
||||
const { name, url } = data;
|
||||
vditorRef.current?.insertValue(``);
|
||||
} else {
|
||||
message.error(msg);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}, [props.defaultValue]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -80,7 +80,7 @@ function Timeline(props: IProps) {
|
|||
}, [cursorStatic.top]);
|
||||
|
||||
useEffect(() => {
|
||||
if (props.data && orbitRef.current) {
|
||||
if (props.data.length > 0 && orbitRef.current) {
|
||||
setTimelineData(filterYearOnce(props.data));
|
||||
// 全部的月份数数量平均划分
|
||||
const avg = orbitRef.current.clientHeight / props.data.length;
|
||||
|
@ -90,7 +90,7 @@ function Timeline(props: IProps) {
|
|||
|
||||
useEffect(() => {
|
||||
window.addEventListener("resize", () => {
|
||||
if (props.data && orbitRef.current) {
|
||||
if (props.data.length > 0 && orbitRef.current) {
|
||||
setTimelineData(filterYearOnce(props.data));
|
||||
// 全部的月份数数量平均划分
|
||||
const avg = orbitRef.current.clientHeight / props.data.length;
|
||||
|
@ -98,7 +98,7 @@ function Timeline(props: IProps) {
|
|||
}
|
||||
});
|
||||
return () => window.removeEventListener("resize", () => {});
|
||||
}, []);
|
||||
}, [props.data]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -53,10 +53,13 @@ export default function Index() {
|
|||
*/
|
||||
const onTimelineScroll = (p: IOnScrollParam) => {
|
||||
const { top, height } = p;
|
||||
//左侧区域高度
|
||||
const { scrollHeight, clientHeight } = thumbnailRef.current!;
|
||||
scale.current = (scrollHeight - clientHeight) / height;
|
||||
thumbnailRef.current!.scrollTop = top * scale.current;
|
||||
if (thumbnailRef.current) {
|
||||
//左侧区域高度
|
||||
const { scrollHeight, clientHeight } = thumbnailRef.current;
|
||||
if (scrollHeight === clientHeight) return;
|
||||
scale.current = (scrollHeight - clientHeight) / height;
|
||||
thumbnailRef.current!.scrollTop = top * scale.current;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user