|
@@ -4,13 +4,14 @@ import { ReloadOutlined } from "@ant-design/icons";
|
|
|
|
|
|
|
|
import { get } from "../../../request";
|
|
import { get } from "../../../request";
|
|
|
import { ISentenceSimListResponse } from "../../api/Corpus";
|
|
import { ISentenceSimListResponse } from "../../api/Corpus";
|
|
|
-import { IWidgetSentEditInner, SentEditInner } from "../SentEdit";
|
|
|
|
|
|
|
+import MdView from "../MdView";
|
|
|
|
|
|
|
|
interface IWidget {
|
|
interface IWidget {
|
|
|
book: number;
|
|
book: number;
|
|
|
para: number;
|
|
para: number;
|
|
|
wordStart: number;
|
|
wordStart: number;
|
|
|
wordEnd: number;
|
|
wordEnd: number;
|
|
|
|
|
+ channelsId?: string[];
|
|
|
limit?: number;
|
|
limit?: number;
|
|
|
reload?: boolean;
|
|
reload?: boolean;
|
|
|
onReload?: Function;
|
|
onReload?: Function;
|
|
@@ -21,16 +22,18 @@ const SentSimWidget = ({
|
|
|
wordStart,
|
|
wordStart,
|
|
|
wordEnd,
|
|
wordEnd,
|
|
|
limit,
|
|
limit,
|
|
|
|
|
+ channelsId,
|
|
|
reload = false,
|
|
reload = false,
|
|
|
onReload,
|
|
onReload,
|
|
|
}: IWidget) => {
|
|
}: IWidget) => {
|
|
|
- const [sentData, setSentData] = useState<IWidgetSentEditInner[]>([]);
|
|
|
|
|
|
|
+ const [sentData, setSentData] = useState<string[]>([]);
|
|
|
|
|
|
|
|
const load = () => {
|
|
const load = () => {
|
|
|
let url = `/v2/sent-sim?view=sentence&book=${book}¶graph=${para}&start=${wordStart}&end=${wordEnd}&limit=10&mode=edit`;
|
|
let url = `/v2/sent-sim?view=sentence&book=${book}¶graph=${para}&start=${wordStart}&end=${wordEnd}&limit=10&mode=edit`;
|
|
|
if (typeof limit !== "undefined") {
|
|
if (typeof limit !== "undefined") {
|
|
|
url = url + `&limit=${limit}`;
|
|
url = url + `&limit=${limit}`;
|
|
|
}
|
|
}
|
|
|
|
|
+ url += channelsId ? `&channels=${channelsId.join()}` : "";
|
|
|
get<ISentenceSimListResponse>(url)
|
|
get<ISentenceSimListResponse>(url)
|
|
|
.then((json) => {
|
|
.then((json) => {
|
|
|
if (json.ok) {
|
|
if (json.ok) {
|
|
@@ -67,7 +70,7 @@ const SentSimWidget = ({
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
{sentData.map((item, id) => {
|
|
{sentData.map((item, id) => {
|
|
|
- return <SentEditInner {...item} key={id} />;
|
|
|
|
|
|
|
+ return <MdView html={item} key={id} />;
|
|
|
})}
|
|
})}
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|