1.0.1
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# React + TypeScript + Vite
|
||||
|
||||
`cp node_modules/pdfjs-dist/build/pdf.worker.min.mjs public/pdf.worker.min.mjs`
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
|
||||
Currently, two official plugins are available:
|
||||
|
||||
946
package-lock.json
generated
946
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.13.2",
|
||||
"pdfjs-dist": "^5.4.449",
|
||||
"pdfjs-dist": "^4.4.168",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router-dom": "^7.9.6"
|
||||
@@ -33,4 +33,4 @@
|
||||
"typescript-eslint": "^8.46.4",
|
||||
"vite": "^7.2.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ const API_CONFIG = {
|
||||
INTERNAL_URL: 'http://10.1.5.118:8077/platform-api',
|
||||
// 外网地址(HTTPS)
|
||||
EXTERNAL_URL: 'http://apihis.circleharmonyhospital.cn:8982/platform-api',
|
||||
BASE_URL: import.meta.env.NODE_ENV === 'development'
|
||||
? 'http://10.1.5.118:8077/platform-api'
|
||||
BASE_URL: import.meta.env.MODE === 'development'
|
||||
? '/platform-api'
|
||||
: 'http://apihis.circleharmonyhospital.cn:8982/platform-api',
|
||||
TIMEOUT: 120000,
|
||||
};
|
||||
|
||||
@@ -1186,7 +1186,17 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
|
||||
className='mt-0.5 w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500'
|
||||
/>
|
||||
<div className='flex-1 min-w-0'>
|
||||
<div className='font-semibold text-[14px] text-gray-900'>{item.name}</div>
|
||||
<div
|
||||
className='font-semibold text-[14px] text-gray-900'
|
||||
style={{
|
||||
display: '-webkit-box',
|
||||
WebkitLineClamp: 2,
|
||||
WebkitBoxOrient: 'vertical',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
{item.name}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.min.mjs?url';
|
||||
|
||||
import { getDaojiandanPdf as getDaojiandanPdfApi, submitDaojiandanSign, editDaojiandanPrintStatus } from '../../api';
|
||||
import type { ExamClient } from '../../data/mockData';
|
||||
import type { SignaturePadHandle } from '../ui';
|
||||
import { Button, SignaturePad } from '../ui';
|
||||
|
||||
// Polyfill for Promise.withResolvers
|
||||
if (typeof (Promise as any).withResolvers === 'undefined') {
|
||||
(Promise as any).withResolvers = function <T>() {
|
||||
let resolve!: (value: T | PromiseLike<T>) => void;
|
||||
@@ -20,8 +18,14 @@ if (typeof (Promise as any).withResolvers === 'undefined') {
|
||||
};
|
||||
}
|
||||
|
||||
// 配置 PDF.js worker
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker;
|
||||
if (typeof (Promise as any).try === 'undefined') {
|
||||
(Promise as any).try = function (fn: () => any) {
|
||||
return new Promise((resolve) => resolve(fn()));
|
||||
};
|
||||
}
|
||||
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs';
|
||||
|
||||
|
||||
export const ExamPrintPanel = ({ client }: { client: ExamClient }) => {
|
||||
const [pdfUrl, setPdfUrl] = useState<string | null>(null);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.min.mjs?url';
|
||||
import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf.mjs';
|
||||
import pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.min.mjs?url';
|
||||
|
||||
import type { OutputTongyishuFileInfo, OutputTijianPdfFileInfo, OutputPhysicalExamItemInfo } from '../../api';
|
||||
import {
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
import type { SignaturePadHandle } from '../ui';
|
||||
import { Button, SignaturePad } from '../ui';
|
||||
|
||||
// Polyfill for Promise.withResolvers
|
||||
if (typeof (Promise as any).withResolvers === 'undefined') {
|
||||
(Promise as any).withResolvers = function <T>() {
|
||||
let resolve!: (value: T | PromiseLike<T>) => void;
|
||||
@@ -33,8 +32,13 @@ if (typeof (Promise as any).withResolvers === 'undefined') {
|
||||
};
|
||||
}
|
||||
|
||||
// 配置 PDF.js worker
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker;
|
||||
if (typeof (Promise as any).try === 'undefined') {
|
||||
(Promise as any).try = function (fn: () => any) {
|
||||
return new Promise((resolve) => resolve(fn()));
|
||||
};
|
||||
}
|
||||
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfWorkerSrc;
|
||||
|
||||
interface ExamSignPanelProps {
|
||||
examId?: number;
|
||||
|
||||
@@ -180,7 +180,7 @@ export const HomeSection = () => {
|
||||
</Card>
|
||||
)}
|
||||
|
||||
<div className='grid grid-cols-2 gap-4 pb-4'>
|
||||
<div className='grid grid-cols-2 gap-4 pb-10'>
|
||||
<Card>
|
||||
<CardHeader>B1 服务看板</CardHeader>
|
||||
<CardContent>
|
||||
|
||||
6
src/vite-env.d.ts
vendored
Normal file
6
src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare module '*?url' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
Reference in New Issue
Block a user