chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -49,7 +49,7 @@ function getCreateDocumentParams(
|
||||
return {
|
||||
document_bases: [
|
||||
{
|
||||
name: '', // table custom传控
|
||||
name: '', // Table custom control
|
||||
source_info: {
|
||||
document_source: DocumentSource.Custom,
|
||||
},
|
||||
@@ -102,7 +102,7 @@ export const TableCustomCreate = <
|
||||
|
||||
useEffect(() => {
|
||||
if (footerStatus !== FooterBtnStatus.LOADING) {
|
||||
setFooterStatus(getCustomStatus(metaData, 'toBeDelete')); // toBeDelete 待删
|
||||
setFooterStatus(getCustomStatus(metaData, 'toBeDelete')); // toBeDelete to be deleted
|
||||
}
|
||||
}, [metaData]);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { type TableLocalContentProps } from '../../types';
|
||||
import { TableCustomCreate as TableCustomCreateV2 } from './create-v2';
|
||||
|
||||
/** 到时候要删掉 TableCustomCreateV1*/
|
||||
/** Delete TableCustomCreateV1 at that time.*/
|
||||
export const TableCustomCreate = (props: TableLocalContentProps) => (
|
||||
<TableCustomCreateV2 {...props} />
|
||||
);
|
||||
|
||||
@@ -175,7 +175,7 @@ export function tableDataCleaning({
|
||||
},
|
||||
}));
|
||||
|
||||
// 增加操作列
|
||||
// Add action column
|
||||
tableColumns.push({
|
||||
title: <></>,
|
||||
width: 100,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* service定义:包含业务处理 & 事件
|
||||
* Service definition: contains business processes & events
|
||||
*/
|
||||
import { useMemo } from 'react';
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
type UploadTableState,
|
||||
} from '@/features/knowledge-type/table/interface';
|
||||
|
||||
/** table-local upload 时要用tos_uri 去取table_info */
|
||||
/** Use tos_uri to get table_info when uploading table-local */
|
||||
export const useUploadFetchTableParams = <
|
||||
T extends UploadTableState<number> & UploadTableAction<number>,
|
||||
>(
|
||||
@@ -84,7 +84,7 @@ export const useRetry = <
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
// TODO 加上报
|
||||
// TODO plus report
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ export const TableUpload = <
|
||||
const fetchTableInfo = useFetchTableSchemaInfo<T>(useStore);
|
||||
|
||||
useEffect(() => {
|
||||
// 删除上传文件时,同步删除表格源数据
|
||||
// When deleting an uploaded file, delete the table source data synchronously
|
||||
if (!unitList.length) {
|
||||
setOriginTableData({});
|
||||
setTableData({});
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* service定义:包含业务处理 & 事件
|
||||
* Service definition: contains business processes & events
|
||||
*/
|
||||
import { useMemo } from 'react';
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
type UploadTableState,
|
||||
} from '@/features/knowledge-type/table/interface';
|
||||
|
||||
/** table-local upload 时要用tos_uri 去取table_info */
|
||||
/** Use tos_uri to get table_info when uploading table-local */
|
||||
export const useUploadFetchTableParams = <
|
||||
T extends UploadTableState<number> & UploadTableAction<number>,
|
||||
>(
|
||||
@@ -84,7 +84,7 @@ export const useRetry = <
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
// TODO 加上报
|
||||
// TODO plus report
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ export const TableUpload = <
|
||||
const fetchTableInfo = useFetchTableSchemaInfo<T>(useStore);
|
||||
|
||||
useEffect(() => {
|
||||
// 删除上传文件时,同步删除表格源数据
|
||||
// When deleting an uploaded file, delete the table source data synchronously
|
||||
if (!unitList.length) {
|
||||
setOriginTableData({});
|
||||
setTableData({});
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/**
|
||||
* pure network request & common services
|
||||
*/
|
||||
// TODO 待解
|
||||
// TODO to be solved
|
||||
|
||||
import { type StoreApi, type UseBoundStore } from 'zustand';
|
||||
import { debounce, get } from 'lodash-es';
|
||||
@@ -163,8 +163,8 @@ export const useFetchTableSchemaInfoReq = (
|
||||
};
|
||||
|
||||
/**
|
||||
* 这个方法 所有的table链路都会用到
|
||||
* impure,会改store,因为所有table链路类似,所以放到这里
|
||||
* This method is used by all table links
|
||||
* Impure, will change the store, because all table links are similar, so put it here
|
||||
*/
|
||||
export const useFetchTableSchemaInfo = <
|
||||
T extends UploadTableState<number> & UploadTableAction<number>,
|
||||
@@ -187,7 +187,7 @@ export const useFetchTableSchemaInfo = <
|
||||
}
|
||||
: res;
|
||||
if (!isOnlyPreview) {
|
||||
// 为什么有这个if,因为第一次请求全量,第二次请求isOnlyPreview
|
||||
// Why is there this if, because the first request is full, and the second request is OnlyPreview.
|
||||
setOriginTableData(newData);
|
||||
}
|
||||
const validateRes = semanticValidator(newData);
|
||||
@@ -202,8 +202,8 @@ export const useFetchTableSchemaInfo = <
|
||||
);
|
||||
};
|
||||
|
||||
// TODO 待优化,这个函数包含了太多逻辑,非常乱
|
||||
// events action nl2ql链路
|
||||
// TODO needs to be optimized. This function contains too much logic and is very messy.
|
||||
// Events action nl2ql link
|
||||
export const useChangeTableSettingsNl2ql = <
|
||||
T extends UploadTableState<number> &
|
||||
UploadTableAction<number> &
|
||||
@@ -224,7 +224,7 @@ export const useChangeTableSettingsNl2ql = <
|
||||
const AWAIT = 500;
|
||||
const params = useUploadFetchTableParams(useStore);
|
||||
|
||||
const isThirdResegment = isThirdResegmentFunc(opt ?? OptType.ADD, type); // 判断是否为三方的resegment
|
||||
const isThirdResegment = isThirdResegmentFunc(opt ?? OptType.ADD, type); // Determine whether it is a tripartite resegment
|
||||
const isIncremental = isIncrementalFunc(opt ?? OptType.ADD);
|
||||
|
||||
const onChangeTableSettings = debounce((v: TableSettings) => {
|
||||
@@ -233,7 +233,7 @@ export const useChangeTableSettingsNl2ql = <
|
||||
type &&
|
||||
[UnitType.TABLE_GOOGLE_DRIVE, UnitType.TABLE_FEISHU].includes(type)
|
||||
? {
|
||||
// 飞书需要传 tos_uri
|
||||
// Feishu needs to pass tos_uri
|
||||
tos_uri: type === UnitType.TABLE_FEISHU ? tosUrlRef : undefined,
|
||||
source_file_id: sourceFileId ?? undefined,
|
||||
document_source:
|
||||
@@ -243,7 +243,7 @@ export const useChangeTableSettingsNl2ql = <
|
||||
}
|
||||
: params;
|
||||
fetchTableInfo({
|
||||
// 如果为三方的resegment就不传 source_file
|
||||
// If it is a resegment of three parties, it will not be transmitted source_file
|
||||
source_file: isThirdResegment ? undefined : sourceFile,
|
||||
table_sheet:
|
||||
!isIncremental &&
|
||||
@@ -254,7 +254,7 @@ export const useChangeTableSettingsNl2ql = <
|
||||
header_line_idx: String(v.header_line_idx),
|
||||
start_line_idx: String(v.start_line_idx),
|
||||
},
|
||||
// 如果为三方的resegment和增量导入,就传 document_id 其他情况不传
|
||||
// If it is a three-party resegment and incremental import, it will pass document_id other cases will not pass
|
||||
document_id: isThirdResegment || isIncremental ? docID : undefined,
|
||||
table_data_type: TableDataType.AllData,
|
||||
});
|
||||
@@ -315,7 +315,7 @@ export const useUpdateDocument = <
|
||||
|
||||
/**
|
||||
* table custom createDocument
|
||||
* TODO 即将废弃,切到新的knowledge信息架构后要删掉
|
||||
* TODO will be abandoned soon, and will be deleted after cutting to the new knowledge information architecture
|
||||
* @deprecated
|
||||
* @param setStatus
|
||||
* @param formApi
|
||||
@@ -368,8 +368,8 @@ export const useCreateDocument = (
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* table unit name校验
|
||||
* TODO 待删,新链路已经不用,只直接用新的,因为产品功能是新的
|
||||
* Table unit name verification
|
||||
* TODO to be deleted, the new link is no longer used, only the new one is used directly, because the product function is new.
|
||||
*/
|
||||
export const useValidateUnitName = () => {
|
||||
const { docID: docIdFromQuery, spaceID, datasetID } = useKnowledgeParams();
|
||||
|
||||
@@ -60,7 +60,7 @@ import {
|
||||
} from '@/constants';
|
||||
|
||||
/**
|
||||
* 校验key是否能作为语义匹配项
|
||||
* Verify whether the key can be used as a semantic match
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ export const semanticValidator = (
|
||||
return {};
|
||||
}
|
||||
|
||||
// TODO 下面forEach写的不好,待优化
|
||||
// The forEach below TODO is not well written and needs to be optimized.
|
||||
const res: SemanticValidate = {};
|
||||
Object.keys(table_meta).forEach(sheetId => {
|
||||
res[sheetId] = {};
|
||||
@@ -260,7 +260,7 @@ export function getConfigurationNextStatus(
|
||||
const hasDuplicateColumnName = meta.some(
|
||||
v => meta.filter(i => i.column_name === v.column_name).length >= 2,
|
||||
);
|
||||
// 没有表结构数据禁止下一步
|
||||
// No table structure data prohibits next step
|
||||
if (
|
||||
!Object.keys(meta).length ||
|
||||
hasEmptyMeta ||
|
||||
@@ -282,13 +282,13 @@ export function getDocIdFromProgressList(progressList: ProgressItem[]) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取footer状态,不包括loading状态,仅判断启/禁用
|
||||
* 满足以下任一情况时,禁用footer按钮
|
||||
* 1.存在列名为空
|
||||
* 2.unitName为空
|
||||
* 3.没有选择语义匹配项
|
||||
* Get footer status, excluding loading status, only judge start/disable
|
||||
* Disable the footer button when any of the following conditions are met
|
||||
* 1. There is an empty column name
|
||||
* 2. unitName is empty
|
||||
* 3. No semantic match selected
|
||||
* @param metaData
|
||||
* @param unitName // TODO unitName的判断待删
|
||||
* @param unitName//TODO unitName judgment to be deletede deleted
|
||||
* @returns
|
||||
*/
|
||||
export const getCustomStatus = (
|
||||
@@ -297,13 +297,13 @@ export const getCustomStatus = (
|
||||
): FooterBtnStatus => {
|
||||
const isDisabled =
|
||||
metaData.some(meta => !meta.column_type) ||
|
||||
!validateField(unitName)?.valid || // TODO 这一行待删
|
||||
!validateField(unitName)?.valid || // TODO line to be deleted
|
||||
!metaData.some(meta => meta.is_semantic === true) ||
|
||||
metaData.some(v => validateField(v.column_name ?? '')?.valid === false);
|
||||
return isDisabled ? FooterBtnStatus.DISABLE : FooterBtnStatus.ENABLE;
|
||||
};
|
||||
|
||||
// table上传第一步footer状态判断
|
||||
// Table upload first step footer status judgment
|
||||
export function getButtonStatus(unitList: UnitItem[]) {
|
||||
const valid = unitList.some(v => validateField(v.name)?.valid === false);
|
||||
if (
|
||||
@@ -331,8 +331,8 @@ export function getAddSegmentParams({
|
||||
documentInfo: DocumentBase[];
|
||||
}) {
|
||||
const payload = {
|
||||
space_id: spaceId, // 兼容旧接口
|
||||
document_id: docId, // 兼容旧接口
|
||||
space_id: spaceId, // Compatible with outdated interfaces
|
||||
document_id: docId, // Compatible with outdated interfaces
|
||||
dataset_id: datasetId,
|
||||
format_type: FormatType.Table,
|
||||
document_bases: documentInfo,
|
||||
@@ -393,7 +393,7 @@ export function getCreateDocumentParams({
|
||||
update_rule: getUpdateRule(),
|
||||
table_sheet: tableSettingsToString(tableSettings),
|
||||
table_meta: metaData.map(meta => ({
|
||||
id: isAppend ? meta.id : '0', // 不是追加,默认是新建(为'0')
|
||||
id: isAppend ? meta.id : '0', // Not append, default is new ('0')
|
||||
column_name: meta.column_name,
|
||||
is_semantic: meta.is_semantic,
|
||||
column_type: meta.column_type,
|
||||
@@ -403,6 +403,6 @@ export function getCreateDocumentParams({
|
||||
})),
|
||||
|
||||
is_append: isAppend,
|
||||
// document_id: useDocIdFromQuery() ?? undefined, // TODO 待删除,这里是为了兼容原来的MemoryApi.ProcessDocumentsTask更新逻辑
|
||||
// document_id: useDocIdFromQuery ()?? undefined,//TODO to be deleted, here is to be compatible with the original MemoryApi. ProcessDocumentsTask update logic
|
||||
};
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export const TextProcessing: FC<
|
||||
},
|
||||
},
|
||||
],
|
||||
// 非首次添加时,不需要传分段规则
|
||||
// When not added for the first time, no segmentation rules are required
|
||||
chunk_strategy: getCustomValues(segmentMode, segmentRule),
|
||||
storage_strategy:
|
||||
IS_CN_REGION && enableStorageStrategy
|
||||
|
||||
@@ -69,7 +69,7 @@ export const SegmentPreviewStep: FC<
|
||||
[docReviewList, unitList],
|
||||
);
|
||||
|
||||
/** 创建 doc review */
|
||||
/** Create doc review */
|
||||
useEffect(() => {
|
||||
const createDocReview = async () => {
|
||||
const { unitList: inputUnitList } = useStore.getState();
|
||||
@@ -95,7 +95,7 @@ export const SegmentPreviewStep: FC<
|
||||
if (!docReviewCreated) {
|
||||
createDocReview();
|
||||
}
|
||||
// TODO: segmentMode 切换时需要重新创建 doc review
|
||||
// TODO: segmentMode needs to be recreated when switching doc review
|
||||
}, [
|
||||
docReviewCreated,
|
||||
parsingStrategy,
|
||||
@@ -104,7 +104,7 @@ export const SegmentPreviewStep: FC<
|
||||
levelChunkStrategy,
|
||||
]);
|
||||
|
||||
/** 轮询 doc review 状态 */
|
||||
/** Poll doc review status */
|
||||
const { run: pollDocReviewStatus, cancel: cancelPollDocReviewStatus } =
|
||||
useRequest(
|
||||
async () => {
|
||||
@@ -131,12 +131,12 @@ export const SegmentPreviewStep: FC<
|
||||
};
|
||||
}, [docReviewCreated]);
|
||||
|
||||
/** 结束轮询 */
|
||||
/** end polling */
|
||||
const docReviewProcessFinished =
|
||||
docReviewList.length > 0 &&
|
||||
docReviewList.every(
|
||||
item =>
|
||||
// docReview 刚创建时没有 status, 其他情况下校验 status 是否为 Processing
|
||||
// DocReview has no status when it is first created. In other cases, check whether the status is Processing.
|
||||
typeof item.status !== 'undefined' &&
|
||||
item.status !== ReviewStatus.Processing,
|
||||
);
|
||||
|
||||
@@ -88,7 +88,7 @@ export function getCreateDocumentParams({
|
||||
levelChunkStrategy,
|
||||
),
|
||||
};
|
||||
// 火山[云搜索服务]只在国内环境上线
|
||||
// Volcano [Cloud Search Service] is only available in the domestic environment
|
||||
if (IS_CN_REGION && enableStorageStrategy) {
|
||||
req.storage_strategy = {
|
||||
storage_location: storageLocation,
|
||||
|
||||
@@ -38,7 +38,7 @@ import { type PDFDocumentFilterValue } from '@/features/knowledge-type/text';
|
||||
import type { UploadTextLocalAddUpdateStore } from '../../store';
|
||||
import { TextLocalAddUpdateStep } from '../../constants';
|
||||
|
||||
// ! 本地文档上传
|
||||
// ! Local file upload
|
||||
export const TextSegment: FC<
|
||||
ContentProps<UploadTextLocalAddUpdateStore>
|
||||
> = props => {
|
||||
|
||||
@@ -19,32 +19,32 @@ import { type Review } from '@coze-arch/idl/knowledge';
|
||||
|
||||
export interface IDocReviewState {
|
||||
/**
|
||||
* 当前 active 的 doc review 的 id
|
||||
* The id of the currently active doc review
|
||||
*/
|
||||
currentReviewID?: string;
|
||||
/**
|
||||
* 当前选中的分段的 id
|
||||
* The ID of the currently selected segment
|
||||
*/
|
||||
selectionIDs?: string[];
|
||||
/**
|
||||
* docReview 的列表
|
||||
* List of docReview
|
||||
*/
|
||||
docReviewList: Review[];
|
||||
}
|
||||
|
||||
export interface IDocReviewAction {
|
||||
/**
|
||||
* 设置当前 active 的 doc review 的 id
|
||||
* Set the id of the currently active doc review
|
||||
* @param id
|
||||
*/
|
||||
setCurrentReviewID: (id: string) => void;
|
||||
/**
|
||||
* 设置当前选中的分段的 id
|
||||
* Sets the ID of the currently selected segment.
|
||||
* @param ids
|
||||
*/
|
||||
setSelectionIDs: (ids: string[]) => void;
|
||||
/**
|
||||
* 设置 docReview 的列表
|
||||
* Set up a list of docReviews
|
||||
* @param list
|
||||
*/
|
||||
setDocReviewList: (list: Review[]) => void;
|
||||
|
||||
@@ -67,7 +67,7 @@ export const SegmentPreviewStep: FC<
|
||||
[docReviewList, documentInfo],
|
||||
);
|
||||
|
||||
/** 创建 doc review */
|
||||
/** Create doc review */
|
||||
useEffect(() => {
|
||||
const createDocReview = async () => {
|
||||
const res = await KnowledgeApi.CreateDocumentReview({
|
||||
@@ -88,7 +88,7 @@ export const SegmentPreviewStep: FC<
|
||||
if (!docReviewCreated) {
|
||||
createDocReview();
|
||||
}
|
||||
// TODO: segmentMode 切换时需要重新创建 doc review
|
||||
// TODO: segmentMode needs to be recreated when switching doc review
|
||||
}, [
|
||||
docReviewCreated,
|
||||
parsingStrategy,
|
||||
@@ -98,7 +98,7 @@ export const SegmentPreviewStep: FC<
|
||||
documentInfo,
|
||||
]);
|
||||
|
||||
/** 轮询 doc review 状态 */
|
||||
/** Poll doc review status */
|
||||
const { run: pollDocReviewStatus, cancel: cancelPollDocReviewStatus } =
|
||||
useRequest(
|
||||
async () => {
|
||||
@@ -125,12 +125,12 @@ export const SegmentPreviewStep: FC<
|
||||
};
|
||||
}, [docReviewCreated]);
|
||||
|
||||
/** 结束轮询 */
|
||||
/** end polling */
|
||||
const docReviewProcessFinished =
|
||||
docReviewList.length > 0 &&
|
||||
docReviewList.every(
|
||||
item =>
|
||||
// docReview 刚创建时没有 status, 其他情况下校验 status 是否为 Processing
|
||||
// DocReview has no status when it is first created. In other cases, check whether the status is Processing.
|
||||
typeof item.status !== 'undefined' &&
|
||||
item.status !== ReviewStatus.Processing,
|
||||
);
|
||||
@@ -167,7 +167,7 @@ export const SegmentPreviewStep: FC<
|
||||
<>
|
||||
<SegmentPreview
|
||||
docReviewList={docReviewList}
|
||||
// 重分段的时候只有一个文档,所以不需要刷新 docReviewList
|
||||
// There is only one document when re-segmenting, so there is no need to refresh the docReviewList.
|
||||
segmentMode={segmentMode}
|
||||
currentReviewID={currentReviewID}
|
||||
setCurrentReviewID={setCurrentReviewID}
|
||||
|
||||
@@ -51,7 +51,7 @@ export const useResegment = <T extends UploadTextLocalResegmentStore>(
|
||||
const pollingTaskProgress = usePollingTaskProgress();
|
||||
const docId = params.docID ?? '';
|
||||
|
||||
// TODO: 分层相关
|
||||
// TODO: Hierarchical correlation
|
||||
const { run: handleProcessText } = useRequest(
|
||||
async () => {
|
||||
if (!params.datasetID) {
|
||||
|
||||
@@ -37,7 +37,7 @@ import {
|
||||
import type { UploadTextLocalResegmentStore } from '../../store';
|
||||
import { TextLocalResegmentStep } from '../../constants';
|
||||
|
||||
// ! 本地文档上传
|
||||
// ! Local file upload
|
||||
export const TextSegment: FC<
|
||||
ContentProps<UploadTextLocalResegmentStore>
|
||||
> = props => {
|
||||
@@ -89,7 +89,7 @@ export const TextSegment: FC<
|
||||
setDocumentInfo(resDocumentInfo);
|
||||
});
|
||||
|
||||
// TODO: 切回来
|
||||
// TODO: Cut back
|
||||
useEffect(() => {
|
||||
if (docID) {
|
||||
listDocumentReq({
|
||||
|
||||
@@ -32,7 +32,7 @@ export const getButtonNextStatus = (
|
||||
return FooterBtnStatus.DISABLE;
|
||||
}
|
||||
}
|
||||
// TODO: 分层相关
|
||||
// TODO: Hierarchical correlation
|
||||
|
||||
return FooterBtnStatus.ENABLE;
|
||||
};
|
||||
|
||||
@@ -19,32 +19,32 @@ import { type Review } from '@coze-arch/idl/knowledge';
|
||||
|
||||
export interface IDocReviewState {
|
||||
/**
|
||||
* 当前 active 的 doc review 的 id
|
||||
* The id of the currently active doc review
|
||||
*/
|
||||
currentReviewID?: string;
|
||||
/**
|
||||
* 当前选中的分段的 id
|
||||
* The ID of the currently selected segment
|
||||
*/
|
||||
selectionIDs?: string[];
|
||||
/**
|
||||
* docReview 的列表
|
||||
* List of docReview
|
||||
*/
|
||||
docReviewList: Review[];
|
||||
}
|
||||
|
||||
export interface IDocReviewAction {
|
||||
/**
|
||||
* 设置当前 active 的 doc review 的 id
|
||||
* Set the id of the currently active doc review
|
||||
* @param id
|
||||
*/
|
||||
setCurrentReviewID: (id: string) => void;
|
||||
/**
|
||||
* 设置当前选中的分段的 id
|
||||
* Sets the ID of the currently selected segment.
|
||||
* @param ids
|
||||
*/
|
||||
setSelectionIDs: (ids: string[]) => void;
|
||||
/**
|
||||
* 设置 docReview 的列表
|
||||
* Set up a list of docReviews
|
||||
* @param list
|
||||
*/
|
||||
setDocReviewList: (list: Review[]) => void;
|
||||
|
||||
@@ -51,14 +51,14 @@ export type UploadTextStore<T extends number> = UploadTextState<T> &
|
||||
UploadTextAction<T>;
|
||||
|
||||
export interface FilterPageConfig {
|
||||
// 注意页码从 1 开始
|
||||
// Note that page numbers start at 1
|
||||
pageIndex: number;
|
||||
isFilter: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务含义是 crop 框距离四个边缘距离占整个 pdf 尺寸的百分比
|
||||
* 取值 [0, 1] 粒度 0.01
|
||||
* The business implication is the distance between the crop box and the four edges as a percentage of the entire pdf size
|
||||
* Value [0,1] particle size 0.01
|
||||
*/
|
||||
export interface CropperSizePercent {
|
||||
topPercent: number;
|
||||
|
||||
@@ -84,12 +84,12 @@ export const SegmentPreview = (props: ISegmentPreviewProps) => {
|
||||
review => review.review_id === currentReviewID,
|
||||
);
|
||||
const fileType = currentReview?.document_type;
|
||||
// 前端不好展示 docx,需要用后端转换过的 pdf 格式的 url
|
||||
// The front end is not good to display docx, so you need to use the URL in pdf format converted by the back end.
|
||||
const fileUrl = ['docx', 'doc'].includes(fileType ?? '')
|
||||
? (currentReview?.preview_tos_url ?? '')
|
||||
: (currentReview?.tos_url ?? '');
|
||||
const segmentTosUrl = currentReview?.doc_tree_tos_url ?? '';
|
||||
// 切换文档时进行保存 review
|
||||
// Save review when switching documents
|
||||
const { loading: saveLoading, runAsync: saveDocumentReview } = useRequest(
|
||||
async () => {
|
||||
const res = await KnowledgeApi.SaveDocumentReview({
|
||||
|
||||
@@ -46,7 +46,7 @@ export const ImageLocalTaskList: FC<
|
||||
return null;
|
||||
}
|
||||
|
||||
// 实现自己的getImageFileInfo方法
|
||||
// Implement your own getImageFileInfo method
|
||||
const getImageFileInfo = (data: RenderColumnsProps) => {
|
||||
const { record } = data;
|
||||
const curStatus = getProcessStatus(record?.status);
|
||||
|
||||
@@ -45,7 +45,7 @@ export const TableLocalTaskList: FC<
|
||||
return null;
|
||||
}
|
||||
|
||||
// 实现自己的getTableLocalInfo方法
|
||||
// Implement your own getTableLocalInfo method
|
||||
const getTableLocalInfo = (data: RenderColumnsProps) => {
|
||||
const { record } = data;
|
||||
const curStatus = getProcessStatus(record?.status);
|
||||
|
||||
@@ -46,7 +46,7 @@ export const TextLocalTaskList: FC<
|
||||
return null;
|
||||
}
|
||||
|
||||
// 实现自己的getTextLocalInfo方法
|
||||
// Implement your own getTextLocalInfo method
|
||||
const getTextLocalInfo = (data: RenderColumnsProps) => {
|
||||
const { record } = data;
|
||||
const curStatus = getProcessStatus(record?.status);
|
||||
|
||||
Reference in New Issue
Block a user