Merge branch 'PingChuan' into shiy-login
This commit is contained in:
@@ -3,22 +3,19 @@
|
||||
* 路由: /contract-draft/:draftId
|
||||
*/
|
||||
|
||||
import type { LoaderFunctionArgs, MetaFunction, ActionFunctionArgs } from '@remix-run/node';
|
||||
import { redirect } from '@remix-run/node';
|
||||
import { useLoaderData, useNavigate, useFetcher } from '@remix-run/react';
|
||||
import { useState, useRef, useEffect } from 'react';
|
||||
import { FilePreview, type FilePreviewHandle } from '~/components/reviews/FilePreview';
|
||||
import { PlaceholderForm } from '~/components/contracts/PlaceholderForm';
|
||||
import { getDraftById, deleteDraft } from '~/api/contracts/draft-service.server';
|
||||
import type { ActionFunctionArgs, LoaderFunctionArgs, MetaFunction } from '@remix-run/node';
|
||||
import { useFetcher, useLoaderData, useNavigate } from '@remix-run/react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { downloadFile } from '~/api/axios-client';
|
||||
import type { ContractTemplate } from '~/api/contract-template/templates';
|
||||
import { extractPlaceholdersFromDocx, generateDefaultSchema } from '~/api/contracts/docx-parser.server';
|
||||
import { getUserSession } from '~/api/login/auth.server';
|
||||
import { deleteFile } from '~/api/storage/minio-client';
|
||||
import { toastService } from '~/components/ui/Toast';
|
||||
import { PlaceholderForm } from '~/components/contracts/PlaceholderForm';
|
||||
import { FilePreview, type FilePreviewHandle } from '~/components/reviews/FilePreview';
|
||||
import { messageService } from '~/components/ui/MessageModal';
|
||||
import { downloadFile } from '~/api/axios-client';
|
||||
import { extractPlaceholdersFromDocx, generateDefaultSchema } from '~/api/contracts/docx-parser.server';
|
||||
import path from 'path';
|
||||
import { toastService } from '~/components/ui/Toast';
|
||||
import type { DraftedContract, PlaceholderSchema } from '~/types/contract-draft';
|
||||
import type { ContractTemplate } from '~/api/contract-template/templates';
|
||||
|
||||
export const meta: MetaFunction<typeof loader> = ({ data }) => {
|
||||
return [
|
||||
@@ -301,10 +298,11 @@ export default function ContractDraftPage() {
|
||||
// 设置高亮值,触发 FilePreview 中的高亮
|
||||
setHighlightValue(placeholder);
|
||||
|
||||
// 短暂延迟后清除高亮,以便下次点击可以重新触发
|
||||
// 延迟清除高亮,给焦点夺回机制充足的时间
|
||||
// PlaceholderForm 会在 150ms 后夺回焦点,所以这里延迟 250ms 清除
|
||||
setTimeout(() => {
|
||||
setHighlightValue(undefined);
|
||||
}, 100);
|
||||
}, 250);
|
||||
};
|
||||
|
||||
// 导出文档(下载当前编辑的文件)- 不再需要手动保存
|
||||
|
||||
Reference in New Issue
Block a user