优化文档列表
This commit is contained in:
@@ -71,7 +71,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
// 并行获取文档详情和文档类型列表
|
||||
const [documentResponse, documentTypesResponse] = await Promise.all([
|
||||
getDocument(id),
|
||||
getDocumentTypes()
|
||||
getDocumentTypes({ pageSize: 500 })
|
||||
]);
|
||||
|
||||
if (documentResponse.error) {
|
||||
@@ -198,6 +198,8 @@ export default function DocumentEdit() {
|
||||
// 在新窗口打开文档预览
|
||||
const openPreview = () => {
|
||||
// 假设有一个预览URL的格式,比如 /preview?path=xxx
|
||||
console.log('documentstest', document);
|
||||
|
||||
const previewUrl = `/preview?path=${encodeURIComponent(document.path)}&name=${encodeURIComponent(document.name)}`;
|
||||
window.open(previewUrl, '_blank');
|
||||
};
|
||||
@@ -268,11 +270,12 @@ export default function DocumentEdit() {
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div className="form-group">
|
||||
<label htmlFor="type-id" className="form-label">文档类型 <span className="text-red-500">*</span></label>
|
||||
<select
|
||||
<select
|
||||
id="type-id"
|
||||
name="type_id"
|
||||
className="form-select"
|
||||
defaultValue={document.type}
|
||||
disabled={document.fileStatus !== 'Processed'}
|
||||
required
|
||||
>
|
||||
{documentTypes.map((type: DocType) => (
|
||||
|
||||
Reference in New Issue
Block a user