fix
This commit is contained in:
@@ -64,6 +64,8 @@ interface DataImporterProps {
|
||||
templateName: string;
|
||||
templateVariables: string[];
|
||||
variant?: 'default' | 'ps' | 'mobile';
|
||||
/** 由外部提供下载入口时隐藏内置按钮 */
|
||||
hideDownloadTemplate?: boolean;
|
||||
}
|
||||
|
||||
export const DataImporter: React.FC<DataImporterProps> = ({
|
||||
@@ -73,6 +75,7 @@ export const DataImporter: React.FC<DataImporterProps> = ({
|
||||
templateName,
|
||||
templateVariables,
|
||||
variant = 'default',
|
||||
hideDownloadTemplate = false,
|
||||
}) => {
|
||||
const { showAlert } = useAppDialog();
|
||||
const isPs = variant === 'ps';
|
||||
@@ -184,21 +187,21 @@ export const DataImporter: React.FC<DataImporterProps> = ({
|
||||
|
||||
return (
|
||||
<div className={wrapperClass}>
|
||||
{!isMobile && (
|
||||
<div className={`flex flex-wrap gap-2 ${isPs ? '' : 'justify-end'}`}>
|
||||
{!isMobile && !hideDownloadTemplate && (
|
||||
<div className="flex justify-end">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => downloadDataTemplate(templateName, templateVariables)}
|
||||
className={
|
||||
isMobile
|
||||
? 'mobile-secondary-btn w-full'
|
||||
: isPs
|
||||
? 'ps-btn text-[10px] w-full justify-center'
|
||||
: 'inline-flex items-center gap-1.5 px-3 py-1.5 border border-gray-200 text-gray-600 hover:bg-gray-50 rounded-lg text-xs font-semibold cursor-pointer'
|
||||
isPs
|
||||
? 'inline-flex items-center justify-center w-14 h-7 text-[#ccc] hover:text-white hover:bg-[#444] rounded transition cursor-pointer shrink-0'
|
||||
: 'inline-flex items-center justify-center w-18 h-9 border border-gray-200 text-gray-600 hover:bg-gray-50 rounded-lg cursor-pointer shrink-0'
|
||||
}
|
||||
aria-label="下载数据模板"
|
||||
title="下载数据模板"
|
||||
>
|
||||
<Download className="w-3.5 h-3.5" />
|
||||
下载数据模板
|
||||
<span className="text-[12px] ml-1">模版</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -141,8 +141,7 @@ export const MobileExportView: React.FC<MobileExportViewProps> = ({
|
||||
type="button"
|
||||
onClick={onExportPdf}
|
||||
disabled={exportDisabled}
|
||||
className={`inline-flex items-center gap-1 ml-1 px-2.5 py-1.5 text-[11px] font-semibold rounded-lg shrink-0 ${
|
||||
exportDisabled
|
||||
className={`inline-flex items-center gap-1 ml-1 px-2.5 py-1.5 text-[11px] font-semibold rounded-lg shrink-0 ${exportDisabled
|
||||
? 'bg-[#444] text-[#888] cursor-not-allowed'
|
||||
: 'bg-indigo-600 hover:bg-indigo-700 active:bg-indigo-800 text-white'
|
||||
}`}
|
||||
@@ -186,8 +185,7 @@ export const MobileExportView: React.FC<MobileExportViewProps> = ({
|
||||
key={item.id}
|
||||
type="button"
|
||||
onClick={() => setMobileModule(item.id)}
|
||||
className={`mobile-design-props-nav-btn mobile-export-props-nav-btn ${
|
||||
mobileModule === item.id ? 'active' : ''
|
||||
className={`mobile-design-props-nav-btn mobile-export-props-nav-btn ${mobileModule === item.id ? 'active' : ''
|
||||
}`}
|
||||
>
|
||||
{item.icon}
|
||||
@@ -216,6 +214,7 @@ export const MobileExportView: React.FC<MobileExportViewProps> = ({
|
||||
</div>
|
||||
<DataImporter
|
||||
variant="ps"
|
||||
hideDownloadTemplate
|
||||
importData={importData}
|
||||
onDataLoaded={onDataLoaded}
|
||||
onClear={onClear}
|
||||
@@ -245,9 +244,9 @@ export const MobileExportView: React.FC<MobileExportViewProps> = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{exportBlockedReason && !pdfGenerating && (
|
||||
{/* {exportBlockedReason && !pdfGenerating && (
|
||||
<p className="text-[10px] text-amber-500/90 text-center">{exportBlockedReason}</p>
|
||||
)}
|
||||
)} */}
|
||||
</div>
|
||||
)}
|
||||
{mobileModule === 'layout' && (
|
||||
|
||||
@@ -577,8 +577,8 @@ export const LayoutPreview: React.FC<LayoutPreviewProps> = ({
|
||||
<p className="text-sm text-[#aaa]">上传数据源并完成变量映射后</p>
|
||||
<p className="text-xs text-[#666] max-w-[280px] leading-relaxed">
|
||||
{isMobileVariant
|
||||
? '在下方「数据源与变量绑定」中上传 Excel,预览将自动更新'
|
||||
: '在右侧「数据源与变量绑定」中点击「应用数据」生成排版预览;纸张排版变更会自动更新'}
|
||||
? '在下方「数据源」中上传 Excel,预览将自动更新'
|
||||
: '在右侧「数据源」中点击「应用数据」生成排版预览;纸张排版变更会自动更新'}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user