diff --git a/src/components/WangEidtor/WangEidtor.tsx b/src/components/WangEidtor/WangEidtor.tsx deleted file mode 100644 index d4a4f60..0000000 --- a/src/components/WangEidtor/WangEidtor.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import React, { useState, useEffect, forwardRef } from 'react'; -import '@wangeditor/editor/dist/css/style.css'; -import { Editor, Toolbar } from '@wangeditor/editor-for-react'; -import { - IDomEditor, - IEditorConfig, - IToolbarConfig, - i18nChangeLanguage, - i18nAddResources, -} from '@wangeditor/editor'; - -// 定义多语言组件属性 -export interface WangEditorProps { - value?: string; - onChange?: (html: string) => void; - language?: 'zh-CN' | 'en'; - height?: string; - placeholder?: string; - mode?: 'default' | 'simple'; - readOnly?: boolean; - toolbarKeys?: string[]; -} - -// 添加全局多语言配置 -i18nAddResources('zh-CN', { - editor: { - placeholder: '请输入内容...', - }, -}); - -i18nAddResources('en', { - editor: { - placeholder: 'Please enter content...', - }, -}); - -// 使用forwardRef以便能在Form.Item中使用ref -const WangEditor = forwardRef(({ - value = '', - onChange, - language = 'zh-CN', - height = '300px', - placeholder, - mode = 'default', - readOnly = false, - toolbarKeys, -}, ref) => { - // 编辑器实例 - const [editor, setEditor] = useState(null); - // HTML内容 - const [html, setHtml] = useState(value); - - // 设置语言 - useEffect(() => { - i18nChangeLanguage(language); - }, [language]); - - // 工具栏配置 - const toolbarConfig: Partial = { - excludeKeys: [], - }; - - if (toolbarKeys) { - toolbarConfig.toolbarKeys = toolbarKeys; - } - - // 编辑器配置 - const editorConfig: Partial = { - placeholder: placeholder || (language === 'zh-CN' ? '请输入内容...' : 'Please enter content...'), - readOnly, - }; - - // 监听value变化 - useEffect(() => { - if (editor && value !== html) { - setHtml(value); - } - }, [value, editor]); - - // 及时销毁editor实例,重要! - useEffect(() => { - return () => { - if (editor == null) return; - editor.destroy(); - setEditor(null); - }; - }, [editor]); - - // 处理编辑器内容变化 - const handleChange = (newEditor: IDomEditor) => { - const newHtml = newEditor.getHtml(); - setHtml(newHtml); - - // 调用Form.Item的onChange回调,支持表单验证 - if (onChange) { - // 如果内容为空或只有空段落,传递空字符串以触发验证 - if (!newHtml || newHtml === '

' || newHtml === '


') { - onChange(''); - } else { - onChange(newHtml); - } - } - }; - - return ( -
-
- {!readOnly && ( - - )} - -
-
- ); -}); - -export default WangEditor; diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index a2e1dcd..429c0d4 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1,19 +1,9 @@ -import common from './en-US/common'; import login from './en-US/login'; import register from './en-US/register'; -import helpManage from './en-US/helpManage'; -import aboutManage from './en-US/aboutManage'; -import policyManage from './en-US/policyManage'; -import userQuestion from './en-US/userQuestion'; -import friendLink from './en-US/friendLink'; +import menu from './en-US/menu'; export default { - ...common, ...login, ...register, - ...helpManage, - ...aboutManage, - ...policyManage, - ...userQuestion, - ...friendLink, + ...menu, }; diff --git a/src/locales/en-US/aboutManage.ts b/src/locales/en-US/aboutManage.ts deleted file mode 100644 index a0931a3..0000000 --- a/src/locales/en-US/aboutManage.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default { - // About Us Management Page - 'aboutManage.title': 'About Us Management', - 'aboutManage.save': 'Save', - 'aboutManage.saveSuccess': 'Save successful', - 'aboutManage.saveFailed': 'Save failed', - 'aboutManage.fetchFailed': 'Failed to fetch data', - - // Form Tabs - 'aboutManage.form.chineseTab': 'Chinese', - 'aboutManage.form.englishTab': 'English', - - // Chinese Form Items - 'aboutManage.form.title': 'Title (Chinese)', - 'aboutManage.form.titleRequired': 'Please enter Chinese title', - 'aboutManage.form.titlePlaceholder': 'Please enter Chinese title', - 'aboutManage.form.content': 'Content (Chinese)', - 'aboutManage.form.contentRequired': 'Please enter Chinese content', - 'aboutManage.form.contentPlaceholder': 'Please enter Chinese content...', - 'aboutManage.form.address': 'Address (Chinese)', - 'aboutManage.form.addressRequired': 'Please enter Chinese address', - 'aboutManage.form.addressPlaceholder': 'Please enter Chinese address', - 'aboutManage.form.contactsPhone': 'Contact Phone (Chinese)', - 'aboutManage.form.contactsPhoneRequired': 'Please enter Chinese contact phone', - 'aboutManage.form.contactsPhonePlaceholder': 'Please enter Chinese contact phone', - 'aboutManage.form.contactsEmail': 'Contact Email (Chinese)', - 'aboutManage.form.contactsEmailRequired': 'Please enter Chinese contact email', - 'aboutManage.form.contactsEmailPlaceholder': 'Please enter Chinese contact email', - 'aboutManage.form.contactsConsult': 'Consultation Method (Chinese)', - 'aboutManage.form.contactsConsultRequired': 'Please enter Chinese consultation method', - 'aboutManage.form.contactsConsultPlaceholder': 'Please enter Chinese consultation method', - - // English Form Items - 'aboutManage.form.titleEn': 'Title (English)', - 'aboutManage.form.titleEnRequired': 'Please enter English title', - 'aboutManage.form.titleEnPlaceholder': 'Please enter English title', - 'aboutManage.form.contentEn': 'Content (English)', - 'aboutManage.form.contentEnRequired': 'Please enter English content', - 'aboutManage.form.contentEnPlaceholder': 'Please enter English content...', - 'aboutManage.form.addressEn': 'Address (English)', - 'aboutManage.form.addressEnRequired': 'Please enter English address', - 'aboutManage.form.addressEnPlaceholder': 'Please enter English address', - 'aboutManage.form.contactsPhoneEn': 'Contact Phone (English)', - 'aboutManage.form.contactsPhoneEnRequired': 'Please enter English contact phone', - 'aboutManage.form.contactsPhoneEnPlaceholder': 'Please enter English contact phone', - 'aboutManage.form.contactsEmailEn': 'Contact Email (English)', - 'aboutManage.form.contactsEmailEnRequired': 'Please enter English contact email', - 'aboutManage.form.contactsEmailEnPlaceholder': 'Please enter English contact email', - 'aboutManage.form.contactsConsultEn': 'Consultation Method (English)', - 'aboutManage.form.contactsConsultEnRequired': 'Please enter English consultation method', - 'aboutManage.form.contactsConsultEnPlaceholder': 'Please enter English consultation method', -}; diff --git a/src/locales/en-US/common.ts b/src/locales/en-US/common.ts deleted file mode 100644 index af39d55..0000000 --- a/src/locales/en-US/common.ts +++ /dev/null @@ -1,56 +0,0 @@ -export default { - // Menu - 'menu.首页': 'Home', - 'menu.管理员管理': 'Admin Management', - 'menu.下载中心管理': 'Download Center Management', - 'menu.通知中心管理': 'Notice Center Management', - 'menu.政策法规管理': 'Policy Management', - 'menu.关于我们管理': 'About Us Management', - 'menu.帮助中心管理': 'Help Center Management', - 'menu.用户提问管理': 'User Questions Management', - 'menu.已阅问题': 'Read Questions', - 'menu.未阅问题': 'Unread Questions', - 'menu.友情链接管理': 'Friendly Links Management', - 'menu.友情链接分类': 'Friendly Links Category', - 'menu.友情链接列表': 'Friendly Links List', - // Supplier Evaluation Management - 'menu.供应商评价': 'Supplier Evaluation', - 'menu.模板管理': 'Template Management', - 'menu.任务管理': 'Task Management', - 'menu.评价打分': 'Evaluation Scoring', - 'menu.评价结果': 'Evaluation Results', - 'menu.评价结果审批': 'Results Approval', - // Supplier Annual Review Management - 'menu.供应商年审': 'Supplier Annual Review', - 'menu.年审模板管理': 'Review Template Management', - 'menu.年审任务管理': 'Review Task Management', - 'menu.年度查询': 'Annual Query', - 'menu.年审结果': 'Review Results', - - // Common Text - "查看": "Info", - "采购需求公示": "Procurement Demand Announcement", - "招标采购公告": "Bidding Procurement Announcement", - "非招标采购公告": "Non-bidding Procurement Announcement", - "资格预审公告": "Pre-qualification Announcement", - "招募公告": "Recruitment Announcement", - "变更公告": "Change Announcement", - "中标(中选)候选人公示": "Bid Winner Candidate Announcement", - "中标(中选)结果公示": "Bid Result Announcement", - "采购失败(流标)公告": "Failed Procurement Announcement", - "加载更多": "Load More", - "登录/注册": "Login/Register", - - // Buttons - "common.confirm": "Confirm", - "common.cancel": "Cancel", - - // FileUpload component - 'component.fileUpload.buttonText': 'Upload File', - 'component.fileUpload.dragText': 'Click or drag file to this area to upload', - 'component.fileUpload.fileTypeTip': 'Supported file types: {types}', - 'component.fileUpload.fileSizeTip': 'File size should not exceed {size}MB', - 'component.fileUpload.uploadFailed': 'Upload failed', - 'component.fileUpload.parseError': 'Failed to parse response', - 'component.fileUpload.networkError': 'Network error', -}; diff --git a/src/locales/en-US/friendLink.ts b/src/locales/en-US/friendLink.ts deleted file mode 100644 index 2a0cc4f..0000000 --- a/src/locales/en-US/friendLink.ts +++ /dev/null @@ -1,96 +0,0 @@ -export default { - // Friendly Links Management page - 'friendLink.title': 'Friendly Links Management', - 'friendLink.name': 'Name', - 'friendLink.nameEn': 'English Name', - 'friendLink.url': 'URL', - 'friendLink.logo': 'Logo', - 'friendLink.thumbnail': 'Thumbnail', - 'friendLink.sort': 'Sort Order', - 'friendLink.status': 'Status', - 'friendLink.category': 'Category', - 'friendLink.operation': 'Operation', - 'friendLink.add': 'Add Link', - 'friendLink.edit': 'Edit Link', - 'friendLink.delete': 'Delete Link', - 'friendLink.batchDelete': 'Batch Delete', - 'friendLink.enable': 'Enable', - 'friendLink.disable': 'Disable', - 'friendLink.enabled': 'Enabled', - 'friendLink.disabled': 'Disabled', - 'friendLink.selectedCount': '{count} items selected', - - // Form related - 'friendLink.form.name.required': 'Please enter link name', - 'friendLink.form.name.placeholder': 'Please enter link name', - 'friendLink.form.nameEn.required': 'Please enter English name', - 'friendLink.form.nameEn.placeholder': 'Please enter English name', - 'friendLink.form.category.required': 'Please select category', - 'friendLink.form.category.placeholder': 'Please select category', - 'friendLink.form.url.required': 'Please enter URL', - 'friendLink.form.url.invalid': 'Please enter a valid URL', - 'friendLink.form.url.placeholder': 'Please enter URL starting with http:// or https://', - 'friendLink.form.thumbnail.required': 'Please upload thumbnail', - 'friendLink.form.thumbnail.upload': 'Upload Thumbnail', - 'friendLink.form.sort.required': 'Please enter sort order', - 'friendLink.form.sort.placeholder': 'Please enter sort order, smaller number comes first', - - // Operation tips - 'friendLink.delete.confirm.title': 'Delete Confirmation', - 'friendLink.delete.confirm.content': 'Are you sure you want to delete this link?', - 'friendLink.delete.success': 'Deleted successfully', - 'friendLink.batchDelete.empty': 'Please select items to delete', - 'friendLink.batchDelete.confirm.title': 'Batch Delete Confirmation', - 'friendLink.batchDelete.confirm.content': 'Are you sure you want to delete {count} selected items?', - 'friendLink.batchDelete.success': 'Batch delete successful', - 'friendLink.add.success': 'Added successfully', - 'friendLink.update.success': 'Updated successfully', - 'friendLink.enable.success': 'Enabled successfully', - 'friendLink.disable.success': 'Disabled successfully', - 'friendLink.enable.confirm.title': 'Enable Confirmation', - 'friendLink.enable.confirm.content': 'Are you sure you want to enable this link?', - 'friendLink.disable.confirm.title': 'Disable Confirmation', - 'friendLink.disable.confirm.content': 'Are you sure you want to disable this link?', - 'friendLink.detail.failed': 'Failed to get link details', - - // Friendly Link Category Management - 'friendLink.category.title': 'Friendly Link Category Management', - 'friendLink.category.name': 'Category Name', - 'friendLink.category.level': 'Level', - 'friendLink.category.sort': 'Sort Order', - 'friendLink.category.parentCategory': 'Parent Category', - 'friendLink.category.operation': 'Operation', - 'friendLink.category.add': 'Add Category', - 'friendLink.category.addChild': 'Add Subcategory', - 'friendLink.category.edit': 'Edit', - 'friendLink.category.delete': 'Delete', - 'friendLink.category.form.title.add': 'Add Category', - 'friendLink.category.form.title.addChild': 'Add Subcategory', - 'friendLink.category.form.title.edit': 'Edit Category', - 'friendLink.category.form.name': 'Category Name', - 'friendLink.category.form.name.placeholder': 'Please enter category name', - 'friendLink.category.form.name.required': 'Please enter category name', - 'friendLink.category.form.parentCategory': 'Parent Category', - 'friendLink.category.form.parentCategory.placeholder': 'Please select parent category', - 'friendLink.category.form.parentCategory.required': 'Please select parent category', - 'friendLink.category.form.sort': 'Sort Order', - 'friendLink.category.form.sort.placeholder': 'Please enter sort value, smaller number comes first', - 'friendLink.category.form.sort.required': 'Please enter sort value', - 'friendLink.category.delete.confirm.title': 'Delete Category', - 'friendLink.category.delete.confirm.content': 'Are you sure you want to delete category "{name}"?', - 'friendLink.category.delete.hasChildren': 'This category has subcategories and cannot be deleted directly', - 'friendLink.category.delete.success': 'Deleted successfully', - 'friendLink.category.add.success': 'Added successfully', - 'friendLink.category.update.success': 'Updated successfully', - - // Category Type - 'friendLink.category.type': 'Type', - 'friendLink.category.type.normal': 'Normal Display', - 'friendLink.category.type.featured': 'Featured Display', - 'friendLink.category.form.type': 'Category Type', - 'friendLink.category.form.type.placeholder': 'Please select category type', - 'friendLink.category.form.type.required': 'Please select category type', - 'friendLink.category.form.remark': 'Remark', - 'friendLink.category.form.remark.placeholder': 'Please enter remark', - 'friendLink.category.form.remark.required': 'Please enter remark', -}; diff --git a/src/locales/en-US/helpManage.ts b/src/locales/en-US/helpManage.ts deleted file mode 100644 index 77d5079..0000000 --- a/src/locales/en-US/helpManage.ts +++ /dev/null @@ -1,109 +0,0 @@ -export default { - // Help Center Management List Page - 'helpManage.title': 'Help Center Management', - 'helpManage.serialNumber': 'No.', - 'helpManage.title.label': 'Title', - 'helpManage.category': 'Category', - 'helpManage.date': 'Date', - 'helpManage.status': 'Status', - 'helpManage.publisher': 'Publisher', - 'helpManage.operation': 'Operation', - 'helpManage.view': 'View', - 'helpManage.edit': 'Edit', - 'helpManage.publish': 'Publish', - 'helpManage.unpublish': 'Unpublish', - 'helpManage.delete': 'Delete', - 'helpManage.top': 'Top', - 'helpManage.untop': 'Untop', - 'helpManage.add': 'Add', - 'helpManage.search': 'Search', - 'helpManage.reset': 'Reset', - 'helpManage.submit': 'Submit', - 'helpManage.cancel': 'Cancel', - 'helpManage.confirmDelete': 'Are you sure you want to delete this help item?', - 'helpManage.batchDelete': 'Are you sure you want to delete the selected help items?', - 'helpManage.batchDeleteButton': 'Batch Delete', - 'helpManage.confirmPublish': 'Are you sure you want to publish this help item?', - 'helpManage.confirmUnpublish': 'Are you sure you want to unpublish this help item?', - 'helpManage.confirmTop': 'Are you sure you want to top this help item?', - 'helpManage.confirmUntop': 'Are you sure you want to untop this help item?', - 'helpManage.publishSuccess': 'Publish successful', - 'helpManage.unpublishSuccess': 'Unpublish successful', - 'helpManage.publishFailed': 'Publish failed', - 'helpManage.unpublishFailed': 'Unpublish failed', - 'helpManage.topSuccess': 'Top successful', - 'helpManage.untopSuccess': 'Untop successful', - 'helpManage.topFailed': 'Top failed', - 'helpManage.untopFailed': 'Untop failed', - 'helpManage.deleteSuccess': 'Delete successful', - 'helpManage.deleteFailed': 'Delete failed', - 'helpManage.batchDeleteSuccess': 'Batch delete successful', - 'helpManage.batchDeleteFailed': 'Batch delete failed', - 'helpManage.addSuccess': 'Add successful', - 'helpManage.addFailed': 'Add failed', - 'helpManage.updateSuccess': 'Update successful', - 'helpManage.updateFailed': 'Update failed', - 'helpManage.fetchFailed': 'Failed to fetch help center list', - 'helpManage.fetchDetailFailed': 'Failed to fetch details', - 'helpManage.noDeleteItems': 'No items to delete', - 'helpManage.selectedCount': '{count} items selected', - 'helpManage.publishedNoEdit': 'Published help items cannot be edited', - 'helpManage.publishedNoDelete': 'Published help items cannot be deleted', - 'helpManage.deleteConfirmTitle': 'Title', - 'helpManage.deleteConfirmContent': 'This action cannot be undone', - 'helpManage.searchTitlePlaceholder': 'Enter title keywords', - 'helpManage.searchCategoryPlaceholder': 'Select category', - 'helpManage.searchStatusPlaceholder': 'Select status', - - // Help Center Form - 'helpManage.form.isTop': 'Top', - 'helpManage.form.category': 'Category', - 'helpManage.form.categoryRequired': 'Please select a category', - 'helpManage.form.categoryPlaceholder': 'Please select a category', - 'helpManage.form.chineseTab': 'Chinese', - 'helpManage.form.englishTab': 'English', - 'helpManage.form.titleZh': 'Title (Chinese)', - 'helpManage.form.titleZhRequired': 'Please enter Chinese title', - 'helpManage.form.titleZhPlaceholder': 'Please enter Chinese title', - 'helpManage.form.contentZh': 'Content (Chinese)', - 'helpManage.form.contentZhRequired': 'Please enter Chinese content', - 'helpManage.form.contentZhPlaceholder': 'Please enter help content...', - 'helpManage.form.answerContentZh': 'Answer Content (Chinese)', - 'helpManage.form.answerContentZhPlaceholder': 'Please enter answer content...', - 'helpManage.form.titleEn': 'Title (English)', - 'helpManage.form.titleEnRequired': 'Please enter English title', - 'helpManage.form.titleEnPlaceholder': 'Please enter English title', - 'helpManage.form.contentEn': 'Content (English)', - 'helpManage.form.contentEnRequired': 'Please enter English content', - 'helpManage.form.contentEnPlaceholder': 'Please enter help content...', - 'helpManage.form.answerContentEn': 'Answer Content (English)', - 'helpManage.form.answerContentEnPlaceholder': 'Please enter answer content...', - - // Help Center Detail - 'helpManage.detail.title': 'Title', - 'helpManage.detail.titleEn': 'English Title', - 'helpManage.detail.category': 'Category', - 'helpManage.detail.isTop': 'Is Top', - 'helpManage.detail.status': 'Status', - 'helpManage.detail.creator': 'Creator', - 'helpManage.detail.createTime': 'Create Time', - 'helpManage.detail.updateTime': 'Update Time', - 'helpManage.detail.contentZh': 'Content (Chinese)', - 'helpManage.detail.contentEn': 'Content (English)', - 'helpManage.detail.answerContentZh': 'Answer Content (Chinese)', - 'helpManage.detail.answerContentEn': 'Answer Content (English)', - 'helpManage.detail.yes': 'Yes', - 'helpManage.detail.no': 'No', - - // Help Status - 'helpManage.status.draft': 'Draft', - 'helpManage.status.published': 'Published', - 'helpManage.status.unpublished': 'Unpublished', - 'helpManage.status.unknown': 'Unknown', - - // Help Categories - 'helpManage.category.registerGuide': 'Registration Guide', - 'helpManage.category.biddingGuide': 'Bidding Guide', - 'helpManage.category.faq': 'FAQ', - 'helpManage.category.contactUs': 'Contact Us', -}; diff --git a/src/locales/en-US/menu.ts b/src/locales/en-US/menu.ts new file mode 100644 index 0000000..b713e42 --- /dev/null +++ b/src/locales/en-US/menu.ts @@ -0,0 +1,25 @@ +export default { + 'menu.首页': 'Home', + + // 供应商评价模块 + 'menu.供应商评价': 'Supplier Evaluation', + 'menu.模板管理': 'Template Management', + 'menu.模板管理新增': 'Add Template', + 'menu.模板管理详情': 'Template Detail', + 'menu.任务管理': 'Task Management', + 'menu.任务管理新增': 'Add Task', + 'menu.评价打分': 'Evaluation Scoring', + 'menu.评价结果': 'Evaluation Results', + 'menu.评价结果详情': 'Evaluation Results Detail', + 'menu.评价结果得分明细': 'Evaluation Score Details', + 'menu.评价结果打分情况': 'Evaluation Scoring Status', + 'menu.评价结果审批': 'Evaluation Results Approval', + 'menu.评价审批详情': 'Evaluation Approval Detail', + + // 供应商年审模块 + 'menu.供应商年审': 'Supplier Annual Review', + 'menu.年审模板管理': 'Annual Review Template Management', + 'menu.年审任务管理': 'Annual Review Task Management', + 'menu.年度查询': 'Annual Query', + 'menu.年审结果': 'Annual Review Results', +}; diff --git a/src/locales/en-US/policyManage.ts b/src/locales/en-US/policyManage.ts deleted file mode 100644 index 108f399..0000000 --- a/src/locales/en-US/policyManage.ts +++ /dev/null @@ -1,87 +0,0 @@ -export default { - // Policies and Regulations Management List Page - 'policyManage.title': 'Policies & Regulations Management', - 'policyManage.serialNumber': 'No.', - 'policyManage.title.label': 'Title', - 'policyManage.date': 'Date', - 'policyManage.status': 'Status', - 'policyManage.publisher': 'Publisher', - 'policyManage.operation': 'Operation', - 'policyManage.view': 'View', - 'policyManage.edit': 'Edit', - 'policyManage.publish': 'Publish', - 'policyManage.unpublish': 'Unpublish', - 'policyManage.delete': 'Delete', - 'policyManage.top': 'Top', - 'policyManage.add': 'Add', - 'policyManage.search': 'Search', - 'policyManage.reset': 'Reset', - 'policyManage.submit': 'Submit', - 'policyManage.cancel': 'Cancel', - 'policyManage.close': 'Close', - 'policyManage.confirmDelete': 'Are you sure you want to delete this policy?', - 'policyManage.confirmDeleteBatch': 'Are you sure you want to delete the selected policies?', - 'policyManage.confirmPublish': 'Are you sure you want to publish this policy?', - 'policyManage.confirmUnpublish': 'Are you sure you want to unpublish this policy?', - 'policyManage.batchDelete': 'Batch Delete', - 'policyManage.deleteSuccess': 'Delete successful', - 'policyManage.deleteFailed': 'Delete failed', - 'policyManage.batchDeleteSuccess': 'Batch delete successful', - 'policyManage.batchDeletePartialFailed': 'Some deletions failed, please refresh and try again', - 'policyManage.batchDeleteFailed': 'Batch delete failed', - 'policyManage.publishSuccess': 'Publish successful', - 'policyManage.unpublishSuccess': 'Unpublish successful', - 'policyManage.publishFailed': 'Publish failed', - 'policyManage.unpublishFailed': 'Unpublish failed', - 'policyManage.fetchFailed': 'Failed to fetch data', - 'policyManage.fetchDetailFailed': 'Failed to fetch details', - 'policyManage.deleteConfirmTitle': 'Title', - 'policyManage.deleteConfirmContent': 'This action cannot be undone', - 'policyManage.selectedCount': '{count} items selected', - 'policyManage.searchTitlePlaceholder': 'Enter title keywords', - 'policyManage.searchStatusPlaceholder': 'Select status', - - // Policy Form Page - 'policyManage.form.title': 'Policy & Regulation', - 'policyManage.form.add': 'Add Policy & Regulation', - 'policyManage.form.edit': 'Edit Policy & Regulation', - 'policyManage.form.view': 'View Policy & Regulation', - 'policyManage.form.isTop': 'Set as Top', - 'policyManage.form.chineseTab': 'Chinese', - 'policyManage.form.englishTab': 'English', - 'policyManage.form.titleZh': 'Title (Chinese)', - 'policyManage.form.titleZhRequired': 'Please enter Chinese title', - 'policyManage.form.titleZhPlaceholder': 'Please enter Chinese title', - 'policyManage.form.contentZh': 'Content (Chinese)', - 'policyManage.form.contentZhRequired': 'Please enter Chinese content', - 'policyManage.form.contentZhPlaceholder': 'Please enter Chinese content...', - 'policyManage.form.titleEn': 'Title (English)', - 'policyManage.form.titleEnRequired': 'Please enter English title', - 'policyManage.form.titleEnPlaceholder': 'Please enter English title', - 'policyManage.form.contentEn': 'Content (English)', - 'policyManage.form.contentEnRequired': 'Please enter English content', - 'policyManage.form.contentEnPlaceholder': 'Please enter English content...', - 'policyManage.form.addSuccess': 'Add successful', - 'policyManage.form.updateSuccess': 'Update successful', - 'policyManage.form.addFailed': 'Add failed', - 'policyManage.form.updateFailed': 'Update failed', - - // Policy Details Page - 'policyManage.detail.title': 'Title', - 'policyManage.detail.titleEn': 'English Title', - 'policyManage.detail.isTop': 'Is Top', - 'policyManage.detail.status': 'Status', - 'policyManage.detail.creator': 'Creator', - 'policyManage.detail.createTime': 'Create Time', - 'policyManage.detail.updateTime': 'Update Time', - 'policyManage.detail.contentZh': 'Chinese Content', - 'policyManage.detail.contentEn': 'English Content', - 'policyManage.detail.yes': 'Yes', - 'policyManage.detail.no': 'No', - - // Policy Status - 'policyManage.status.draft': 'Draft', - 'policyManage.status.published': 'Published', - 'policyManage.status.unpublished': 'Unpublished', - 'policyManage.status.unknown': 'Unknown', -}; diff --git a/src/locales/en-US/userQuestion.ts b/src/locales/en-US/userQuestion.ts deleted file mode 100644 index 6e8be36..0000000 --- a/src/locales/en-US/userQuestion.ts +++ /dev/null @@ -1,161 +0,0 @@ -export default { - // User Questions Management page - 'userQuestion.title': 'User Questions Management', - 'userQuestion.user': 'User', - 'userQuestion.question': 'Question', - 'userQuestion.answer': 'Answer', - 'userQuestion.createTime': 'Asked At', - 'userQuestion.status': 'Status', - 'userQuestion.operation': 'Operation', - 'userQuestion.unanswered': 'Unanswered', - 'userQuestion.answered': 'Answered', - 'userQuestion.reply': 'Reply', - 'userQuestion.view': 'View', - 'userQuestion.viewAll': 'View All', - 'userQuestion.confirmDelete': 'Are you sure you want to delete this question?', - 'userQuestion.batchDelete': 'Are you sure you want to delete the selected questions?', - 'userQuestion.description': 'User Questions Management Instructions', - 'userQuestion.descriptionText': 'The User Questions Management module is used to process questions submitted by users on the platform. Read questions are questions that have been replied to, and unread questions are questions waiting to be replied to. You can click on the respective card to enter the corresponding management page.', - 'userQuestion.deleteSuccess': 'Successfully deleted', - 'userQuestion.deleteFailed': 'Failed to delete', - 'userQuestion.replySuccess': 'Successfully replied', - 'userQuestion.replyFailed': 'Failed to reply', - 'userQuestion.selectRequired': 'Please select at least one item', - 'userQuestion.batchDeleteConfirm': 'This action cannot be undone. Are you sure you want to continue?', - 'userQuestion.unread': 'Unread', - 'userQuestion.read': 'Read', - 'userQuestion.delete': 'Delete', - 'userQuestion.edit': 'Edit Answer', - 'userQuestion.editSuccess': 'Successfully edited', - 'userQuestion.editFailed': 'Failed to edit', - 'userQuestion.publishStatus': 'Publish Status', - 'userQuestion.topStatus': 'Top Status', - 'userQuestion.published': 'Published', - 'userQuestion.unpublished': 'Unpublished', - 'userQuestion.top': 'Topped', - 'userQuestion.untop': 'Not Topped', - 'userQuestion.submitAnswer': 'Submit Answer', - 'userQuestion.saveEdit': 'Save Changes', - 'userQuestion.confirmSubmit': 'Confirm Submit Answer', - 'userQuestion.confirmEdit': 'Confirm Save Changes', - 'userQuestion.submitConfirmText': 'Are you sure you want to submit this answer? After submission, the status will change to answered.', - 'userQuestion.editConfirmText': 'Are you sure you want to save changes to this answer?', - - // Question Categories - 'questionCategory.biddingProcess': 'Bidding Process', - 'questionCategory.biddingGuide': 'Bidding Guide', - 'questionCategory.registrationGuide': 'Registration Guide', - 'questionCategory.systemOperation': 'System Operation', - 'questionCategory.otherIssues': 'Other Issues', - - // Read Questions page - 'readQuestion.title': 'Read Questions Management', - 'readQuestion.user': 'Username', - 'readQuestion.question': 'Question Content', - 'readQuestion.answer': 'Reply Content', - 'readQuestion.createTime': 'Asked Time', - 'readQuestion.answerTime': 'Reply Time', - 'readQuestion.status': 'Status', - 'readQuestion.operation': 'Operation', - 'readQuestion.view': 'View Details', - 'readQuestion.delete': 'Delete', - 'readQuestion.search': 'Search', - 'readQuestion.reset': 'Reset', - 'readQuestion.confirmDelete': 'Are you sure you want to delete this question?', - 'readQuestion.batchDelete': 'Batch Delete', - 'readQuestion.viewDetails': 'View Question Details', - 'readQuestion.questionDetails': 'Question Details', - 'readQuestion.answerDetails': 'Reply Details', - 'readQuestion.close': 'Close', - 'readQuestion.deleteSuccess': 'Successfully deleted', - 'readQuestion.deleteFailed': 'Failed to delete', - 'readQuestion.selectRequired': 'Please select at least one item', - 'readQuestion.batchDeleteConfirm': 'This action cannot be undone. Are you sure you want to continue?', - 'readQuestion.questionPlaceholder': 'Please enter question keywords', - 'readQuestion.fetchFailed': 'Failed to fetch answered questions', - 'readQuestion.edit': 'Edit Answer', - 'readQuestion.serialNumber': 'No.', - 'readQuestion.questionTitle': 'Question Title', - 'readQuestion.category': 'Category', - 'readQuestion.asker': 'Asker', - 'readQuestion.company': 'Company', - 'readQuestion.account': 'Account', - 'readQuestion.contact': 'Contact', - 'readQuestion.email': 'Email', - 'readQuestion.askTime': 'Asked At', - 'readQuestion.respondent': 'Respondent', - 'readQuestion.answerStatus': 'Answer Status', - 'readQuestion.confirm': 'Confirm', - 'readQuestion.cancel': 'Cancel', - 'readQuestion.batchDeleteSuccess': 'Batch delete successful', - 'readQuestion.batchDeleteFailed': 'Batch delete failed', - 'readQuestion.selectedCount': 'Selected {count} items', - - // Unread Questions page - 'unreadQuestion.title': 'Unread Questions Management', - 'unreadQuestion.user': 'Username', - 'unreadQuestion.question': 'Question Content', - 'unreadQuestion.createTime': 'Asked Time', - 'unreadQuestion.status': 'Status', - 'unreadQuestion.operation': 'Operation', - 'unreadQuestion.reply': 'Answer', - 'unreadQuestion.delete': 'Delete', - 'unreadQuestion.search': 'Search', - 'unreadQuestion.reset': 'Reset', - 'unreadQuestion.confirmDelete': 'Are you sure you want to delete this question?', - 'unreadQuestion.batchDelete': 'Batch Delete', - 'unreadQuestion.replyModal': 'Reply to Question', - 'unreadQuestion.questionContent': 'Question Content', - 'unreadQuestion.answerContent': 'Reply Content', - 'unreadQuestion.answerPlaceholder': 'Please enter your reply...', - 'unreadQuestion.submit': 'Submit', - 'unreadQuestion.cancel': 'Cancel', - 'unreadQuestion.answerRequired': 'Please enter reply content', - 'unreadQuestion.selectRequired': 'Please select at least one item', - 'unreadQuestion.batchDeleteConfirm': 'This action cannot be undone. Are you sure you want to continue?', - 'unreadQuestion.questionPlaceholder': 'Please enter question keywords', - 'unreadQuestion.fetchFailed': 'Failed to fetch unanswered questions', - 'unreadQuestion.serialNumber': 'No.', - 'unreadQuestion.questionTitle': 'Question Title', - 'unreadQuestion.category': 'Category', - 'unreadQuestion.asker': 'Asker', - 'unreadQuestion.company': 'Company', - 'unreadQuestion.account': 'Account', - 'unreadQuestion.contact': 'Contact', - 'unreadQuestion.email': 'Email', - 'unreadQuestion.askTime': 'Asked At', - 'unreadQuestion.batchDeleteSuccess': 'Batch delete successful', - 'unreadQuestion.batchDeleteFailed': 'Batch delete failed', - 'unreadQuestion.selectedCount': 'Selected {count} items', - - // Question Detail Component - 'questionDetail.title': 'Title', - 'questionDetail.category': 'Category', - 'questionDetail.askTime': 'Asked Time', - 'questionDetail.asker': 'Asker', - 'questionDetail.company': 'Company Name', - 'questionDetail.account': 'Account', - 'questionDetail.contact': 'Contact', - 'questionDetail.email': 'Email', - 'questionDetail.publishStatus': 'Publish Status', - 'questionDetail.topStatus': 'Top Status', - 'questionDetail.answerTime': 'Answer Time', - 'questionDetail.respondent': 'Respondent', - 'questionDetail.questionContent': 'Question Content', - 'questionDetail.answerContent': 'Answer Content', - - // Question Modal Component - 'questionModal.answer': 'Answer Question', - 'questionModal.edit': 'Edit Answer', - 'questionModal.view': 'Question Details', - 'questionModal.publishSwitch': 'Publish', - 'questionModal.topSwitch': 'Top', - 'questionModal.confirmSubmit': 'Confirm Submit', - 'questionModal.confirmEdit': 'Confirm Edit', - 'questionModal.close': 'Close', - 'questionModal.answerRequired': 'Please enter answer content', - 'questionModal.answerSuccess': 'Answer submitted successfully', - 'questionModal.answerFailed': 'Failed to submit answer', - 'questionModal.editSuccess': 'Edit successful', - 'questionModal.editFailed': 'Edit failed', -}; diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 646807e..9382ed8 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1,21 +1,9 @@ -import common from './zh-CN/common'; import login from './zh-CN/login'; import register from './zh-CN/register'; -import helpManage from './zh-CN/helpManage'; -import aboutManage from './zh-CN/aboutManage'; -import policyManage from './zh-CN/policyManage'; -import userQuestion from './zh-CN/userQuestion'; -import friendLink from './zh-CN/friendLink'; import menu from './zh-CN/menu'; export default { - ...common, ...login, ...register, - ...helpManage, - ...aboutManage, - ...policyManage, - ...userQuestion, - ...friendLink, ...menu, }; diff --git a/src/locales/zh-CN/aboutManage.ts b/src/locales/zh-CN/aboutManage.ts deleted file mode 100644 index 3ee83f9..0000000 --- a/src/locales/zh-CN/aboutManage.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default { - // 关于我们管理页面 - 'aboutManage.title': '关于我们管理', - 'aboutManage.save': '保存', - 'aboutManage.saveSuccess': '保存成功', - 'aboutManage.saveFailed': '保存失败', - 'aboutManage.fetchFailed': '获取数据失败', - - // 表单标签 - 'aboutManage.form.chineseTab': '中文版', - 'aboutManage.form.englishTab': '英文版', - - // 中文表单项 - 'aboutManage.form.title': '标题', - 'aboutManage.form.titleRequired': '请输入标题', - 'aboutManage.form.titlePlaceholder': '请输入标题', - 'aboutManage.form.content': '正文内容', - 'aboutManage.form.contentRequired': '请输入正文内容', - 'aboutManage.form.contentPlaceholder': '请输入正文内容...', - 'aboutManage.form.address': '地址', - 'aboutManage.form.addressRequired': '请输入地址', - 'aboutManage.form.addressPlaceholder': '请输入地址', - 'aboutManage.form.contactsPhone': '联系电话', - 'aboutManage.form.contactsPhoneRequired': '请输入联系电话', - 'aboutManage.form.contactsPhonePlaceholder': '请输入联系电话', - 'aboutManage.form.contactsEmail': '联系邮箱', - 'aboutManage.form.contactsEmailRequired': '请输入联系邮箱', - 'aboutManage.form.contactsEmailPlaceholder': '请输入联系邮箱', - 'aboutManage.form.contactsConsult': '咨询方式', - 'aboutManage.form.contactsConsultRequired': '请输入咨询方式', - 'aboutManage.form.contactsConsultPlaceholder': '请输入咨询方式', - - // 英文表单项 - 'aboutManage.form.titleEn': '标题(英文)', - 'aboutManage.form.titleEnRequired': '请输入英文标题', - 'aboutManage.form.titleEnPlaceholder': '请输入英文标题', - 'aboutManage.form.contentEn': '正文内容(英文)', - 'aboutManage.form.contentEnRequired': '请输入英文正文内容', - 'aboutManage.form.contentEnPlaceholder': '请输入英文正文内容...', - 'aboutManage.form.addressEn': '地址(英文)', - 'aboutManage.form.addressEnRequired': '请输入英文地址', - 'aboutManage.form.addressEnPlaceholder': '请输入英文地址', - 'aboutManage.form.contactsPhoneEn': '联系电话(英文)', - 'aboutManage.form.contactsPhoneEnRequired': '请输入英文联系电话', - 'aboutManage.form.contactsPhoneEnPlaceholder': '请输入英文联系电话', - 'aboutManage.form.contactsEmailEn': '联系邮箱(英文)', - 'aboutManage.form.contactsEmailEnRequired': '请输入英文联系邮箱', - 'aboutManage.form.contactsEmailEnPlaceholder': '请输入英文联系邮箱', - 'aboutManage.form.contactsConsultEn': '咨询方式(英文)', - 'aboutManage.form.contactsConsultEnRequired': '请输入英文咨询方式', - 'aboutManage.form.contactsConsultEnPlaceholder': '请输入英文咨询方式', -}; diff --git a/src/locales/zh-CN/common.ts b/src/locales/zh-CN/common.ts deleted file mode 100644 index 0854aaf..0000000 --- a/src/locales/zh-CN/common.ts +++ /dev/null @@ -1,56 +0,0 @@ -export default { - // 菜单 - 'menu.首页': '首页', - 'menu.管理员管理': '管理员管理', - 'menu.下载中心管理': '下载中心管理', - 'menu.通知中心管理': '通知中心管理', - 'menu.政策法规管理': '政策法规管理', - 'menu.关于我们管理': '关于我们管理', - 'menu.帮助中心管理': '帮助中心管理', - 'menu.用户提问管理': '用户提问管理', - 'menu.已阅问题': '已阅问题', - 'menu.未阅问题': '未阅问题', - 'menu.友情链接管理': '友情链接管理', - 'menu.友情链接分类': '友情链接分类', - 'menu.友情链接列表': '友情链接列表', - // 供应商评价管理 - 'menu.供应商评价': '供应商评价', - 'menu.模板管理': '模板管理', - 'menu.任务管理': '任务管理', - 'menu.评价打分': '评价打分', - 'menu.评价结果': '评价结果', - 'menu.评价结果审批': '评价结果审批', - // 供应商年审管理 - 'menu.供应商年审': '供应商年审', - 'menu.年审模板管理': '年审模板管理', - 'menu.年审任务管理': '年审任务管理', - 'menu.年度查询': '年度查询', - 'menu.年审结果': '年审结果', - - // 通用文本 - "查看": "查看", - "采购需求公示": "采购需求公示", - "招标采购公告": "招标采购公告", - "非招标采购公告": "非招标采购公告", - "资格预审公告": "资格预审公告", - "招募公告": "招募公告", - "变更公告": "变更公告", - "中标(中选)候选人公示": "中标(中选)候选人公示", - "中标(中选)结果公示": "中标(中选)结果公示", - "采购失败(流标)公告": "采购失败(流标)公告", - "加载更多": "加载更多", - "登录/注册": "登录/注册", - - // 按钮 - "common.confirm": "确定", - "common.cancel": "取消", - - // FileUpload组件 - 'component.fileUpload.buttonText': '上传文件', - 'component.fileUpload.dragText': '点击或拖拽文件到此区域上传', - 'component.fileUpload.fileTypeTip': '支持的文件类型:{types}', - 'component.fileUpload.fileSizeTip': '文件大小不超过{size}MB', - 'component.fileUpload.uploadFailed': '上传失败', - 'component.fileUpload.parseError': '解析响应失败', - 'component.fileUpload.networkError': '网络错误', -}; diff --git a/src/locales/zh-CN/friendLink.ts b/src/locales/zh-CN/friendLink.ts deleted file mode 100644 index ff4de1b..0000000 --- a/src/locales/zh-CN/friendLink.ts +++ /dev/null @@ -1,96 +0,0 @@ -export default { - // 友情链接管理页面 - 'friendLink.title': '友情链接管理', - 'friendLink.name': '名称', - 'friendLink.nameEn': '英文名称', - 'friendLink.url': '链接地址', - 'friendLink.logo': '图标', - 'friendLink.thumbnail': '缩略图', - 'friendLink.sort': '排序', - 'friendLink.status': '状态', - 'friendLink.category': '所属分类', - 'friendLink.operation': '操作', - 'friendLink.add': '新增链接', - 'friendLink.edit': '编辑链接', - 'friendLink.delete': '删除链接', - 'friendLink.batchDelete': '批量删除', - 'friendLink.enable': '启用', - 'friendLink.disable': '禁用', - 'friendLink.enabled': '已启用', - 'friendLink.disabled': '已禁用', - 'friendLink.selectedCount': '已选择 {count} 项', - - // 表单相关 - 'friendLink.form.name.required': '请输入链接名称', - 'friendLink.form.name.placeholder': '请输入链接名称', - 'friendLink.form.nameEn.required': '请输入英文名称', - 'friendLink.form.nameEn.placeholder': '请输入英文名称', - 'friendLink.form.category.required': '请选择所属分类', - 'friendLink.form.category.placeholder': '请选择所属分类', - 'friendLink.form.url.required': '请输入链接地址', - 'friendLink.form.url.invalid': '请输入有效的URL地址', - 'friendLink.form.url.placeholder': '请输入链接地址,以http://或https://开头', - 'friendLink.form.thumbnail.required': '请上传缩略图', - 'friendLink.form.thumbnail.upload': '上传缩略图', - 'friendLink.form.sort.required': '请输入排序值', - 'friendLink.form.sort.placeholder': '请输入排序值,数字越小越靠前', - - // 操作提示 - 'friendLink.delete.confirm.title': '删除确认', - 'friendLink.delete.confirm.content': '确定要删除该友情链接吗?', - 'friendLink.delete.success': '删除成功', - 'friendLink.batchDelete.empty': '请选择要删除的项', - 'friendLink.batchDelete.confirm.title': '批量删除确认', - 'friendLink.batchDelete.confirm.content': '确定要删除选中的 {count} 项吗?', - 'friendLink.batchDelete.success': '批量删除成功', - 'friendLink.add.success': '添加成功', - 'friendLink.update.success': '更新成功', - 'friendLink.enable.success': '启用成功', - 'friendLink.disable.success': '禁用成功', - 'friendLink.enable.confirm.title': '启用确认', - 'friendLink.enable.confirm.content': '确定要启用该友情链接吗?', - 'friendLink.disable.confirm.title': '禁用确认', - 'friendLink.disable.confirm.content': '确定要禁用该友情链接吗?', - 'friendLink.detail.failed': '获取友情链接详情失败', - - // 友情链接分类管理 - 'friendLink.category.title': '友情链接分类管理', - 'friendLink.category.name': '分类名称', - 'friendLink.category.level': '层级', - 'friendLink.category.sort': '排序', - 'friendLink.category.parentCategory': '父级分类', - 'friendLink.category.operation': '操作', - 'friendLink.category.add': '新增分类', - 'friendLink.category.addChild': '新增子类', - 'friendLink.category.edit': '编辑', - 'friendLink.category.delete': '删除', - 'friendLink.category.form.title.add': '新增分类', - 'friendLink.category.form.title.addChild': '新增子分类', - 'friendLink.category.form.title.edit': '编辑分类', - 'friendLink.category.form.name': '分类名称', - 'friendLink.category.form.name.placeholder': '请输入分类名称', - 'friendLink.category.form.name.required': '请输入分类名称', - 'friendLink.category.form.parentCategory': '父级分类', - 'friendLink.category.form.parentCategory.placeholder': '请选择父级分类', - 'friendLink.category.form.parentCategory.required': '请选择父级分类', - 'friendLink.category.form.sort': '排序', - 'friendLink.category.form.sort.placeholder': '请输入排序值,数字越小越靠前', - 'friendLink.category.form.sort.required': '请输入排序值', - 'friendLink.category.delete.confirm.title': '删除分类', - 'friendLink.category.delete.confirm.content': '确定要删除分类"{name}"吗?', - 'friendLink.category.delete.hasChildren': '该分类下有子分类,不能直接删除', - 'friendLink.category.delete.success': '删除成功', - 'friendLink.category.add.success': '添加成功', - 'friendLink.category.update.success': '更新成功', - - // 分类类型 - 'friendLink.category.type': '类型', - 'friendLink.category.type.normal': '普通展示', - 'friendLink.category.type.featured': '重点展示', - 'friendLink.category.form.type': '分类类型', - 'friendLink.category.form.type.placeholder': '请选择分类类型', - 'friendLink.category.form.type.required': '请选择分类类型', - 'friendLink.category.form.remark': '备注', - 'friendLink.category.form.remark.placeholder': '请输入备注信息', - 'friendLink.category.form.remark.required': '请输入备注信息', -}; diff --git a/src/locales/zh-CN/helpManage.ts b/src/locales/zh-CN/helpManage.ts deleted file mode 100644 index 0067485..0000000 --- a/src/locales/zh-CN/helpManage.ts +++ /dev/null @@ -1,108 +0,0 @@ -export default { - // 帮助中心管理列表页 - 'helpManage.title': '帮助中心管理', - 'helpManage.serialNumber': '序号', - 'helpManage.title.label': '标题', - 'helpManage.category': '问题类型', - 'helpManage.date': '日期', - 'helpManage.status': '状态', - 'helpManage.publisher': '发布人', - 'helpManage.operation': '操作', - 'helpManage.view': '查看', - 'helpManage.edit': '编辑', - 'helpManage.publish': '发布', - 'helpManage.unpublish': '下架', - 'helpManage.delete': '删除', - 'helpManage.top': '置顶', - 'helpManage.untop': '取消置顶', - 'helpManage.add': '新增', - 'helpManage.search': '搜索', - 'helpManage.reset': '重置', - 'helpManage.submit': '提交', - 'helpManage.cancel': '取消', - 'helpManage.confirmDelete': '确定要删除该帮助吗?', - 'helpManage.batchDelete': '确定要批量删除选中的帮助吗?', - 'helpManage.confirmPublish': '确定要发布该帮助吗?', - 'helpManage.confirmUnpublish': '确定要下架该帮助吗?', - 'helpManage.confirmTop': '确定要置顶该帮助吗?', - 'helpManage.confirmUntop': '确定要取消置顶该帮助吗?', - 'helpManage.publishSuccess': '发布成功', - 'helpManage.unpublishSuccess': '下架成功', - 'helpManage.publishFailed': '发布失败', - 'helpManage.unpublishFailed': '下架失败', - 'helpManage.topSuccess': '置顶成功', - 'helpManage.untopSuccess': '取消置顶成功', - 'helpManage.topFailed': '置顶失败', - 'helpManage.untopFailed': '取消置顶失败', - 'helpManage.deleteSuccess': '删除成功', - 'helpManage.deleteFailed': '删除失败', - 'helpManage.batchDeleteSuccess': '批量删除成功', - 'helpManage.batchDeleteFailed': '批量删除失败', - 'helpManage.addSuccess': '添加成功', - 'helpManage.addFailed': '添加失败', - 'helpManage.updateSuccess': '更新成功', - 'helpManage.updateFailed': '更新失败', - 'helpManage.fetchFailed': '获取帮助中心列表失败', - 'helpManage.fetchDetailFailed': '获取详情失败', - 'helpManage.noDeleteItems': '没有可删除的帮助', - 'helpManage.selectedCount': '已选择 {count} 项', - 'helpManage.publishedNoEdit': '已发布的帮助不能编辑', - 'helpManage.publishedNoDelete': '已发布的帮助不能删除', - 'helpManage.deleteConfirmTitle': '标题', - 'helpManage.deleteConfirmContent': '删除后无法恢复', - 'helpManage.searchTitlePlaceholder': '请输入标题关键词', - 'helpManage.searchCategoryPlaceholder': '请选择问题类型', - 'helpManage.searchStatusPlaceholder': '请选择状态', - - // 帮助中心表单 - 'helpManage.form.isTop': '是否置顶', - 'helpManage.form.category': '问题类型', - 'helpManage.form.categoryRequired': '请选择问题类型', - 'helpManage.form.categoryPlaceholder': '请选择问题类型', - 'helpManage.form.chineseTab': '中文版', - 'helpManage.form.englishTab': '英文版', - 'helpManage.form.titleZh': '标题(中文)', - 'helpManage.form.titleZhRequired': '请输入中文标题', - 'helpManage.form.titleZhPlaceholder': '请输入中文标题', - 'helpManage.form.contentZh': '内容(中文)', - 'helpManage.form.contentZhRequired': '请输入中文内容', - 'helpManage.form.contentZhPlaceholder': '请输入帮助内容...', - 'helpManage.form.answerContentZh': '回答内容(中文)', - 'helpManage.form.answerContentZhPlaceholder': '请输入回答内容...', - 'helpManage.form.titleEn': '标题(英文)', - 'helpManage.form.titleEnRequired': '请输入英文标题', - 'helpManage.form.titleEnPlaceholder': '请输入英文标题', - 'helpManage.form.contentEn': '内容(英文)', - 'helpManage.form.contentEnRequired': '请输入英文内容', - 'helpManage.form.contentEnPlaceholder': '请输入英文帮助内容...', - 'helpManage.form.answerContentEn': '回答内容(英文)', - 'helpManage.form.answerContentEnPlaceholder': '请输入英文回答内容...', - - // 帮助中心详情 - 'helpManage.detail.title': '标题', - 'helpManage.detail.titleEn': '英文标题', - 'helpManage.detail.category': '问题类型', - 'helpManage.detail.isTop': '是否置顶', - 'helpManage.detail.status': '状态', - 'helpManage.detail.creator': '创建人', - 'helpManage.detail.createTime': '创建时间', - 'helpManage.detail.updateTime': '更新时间', - 'helpManage.detail.contentZh': '问题内容(中文)', - 'helpManage.detail.contentEn': '问题内容(英文)', - 'helpManage.detail.answerContentZh': '回答内容(中文)', - 'helpManage.detail.answerContentEn': '回答内容(英文)', - 'helpManage.detail.yes': '是', - 'helpManage.detail.no': '否', - - // 帮助状态 - 'helpManage.status.draft': '草稿', - 'helpManage.status.published': '已发布', - 'helpManage.status.unpublished': '已下架', - 'helpManage.status.unknown': '未知', - - // 帮助分类 - 'helpManage.category.registerGuide': '注册指南', - 'helpManage.category.biddingGuide': '投标指南', - 'helpManage.category.faq': '常见问题', - 'helpManage.category.contactUs': '联系我们', -}; diff --git a/src/locales/zh-CN/menu.ts b/src/locales/zh-CN/menu.ts index 7ffc27e..f637731 100644 --- a/src/locales/zh-CN/menu.ts +++ b/src/locales/zh-CN/menu.ts @@ -1,30 +1,25 @@ export default { 'menu.首页': '首页', + + // 供应商评价模块 'menu.供应商评价': '供应商评价', 'menu.模板管理': '模板管理', + 'menu.模板管理新增': '模板管理新增', + 'menu.模板管理详情': '模板管理详情', 'menu.任务管理': '任务管理', + 'menu.任务管理新增': '任务管理新增', 'menu.评价打分': '评价打分', 'menu.评价结果': '评价结果', - 'menu.评价结果审批': '评价结果审批', 'menu.评价结果详情': '评价结果详情', 'menu.评价结果得分明细': '评价结果得分明细', 'menu.评价结果打分情况': '评价结果打分情况', + 'menu.评价结果审批': '评价结果审批', 'menu.评价审批详情': '评价审批详情', - 'menu.供应商年度': '供应商年度', - 'menu.年度模板管理': '年度模板管理', - 'menu.年度任务管理': '年度任务管理', + // 供应商年审模块 + 'menu.供应商年审': '供应商年审', + 'menu.年审模板管理': '年审模板管理', + 'menu.年审任务管理': '年审任务管理', 'menu.年度查询': '年度查询', - 'menu.年度结果': '年度结果', - - 'menu.用户管理': '用户管理', - 'menu.下载管理': '下载管理', - 'menu.公告管理': '公告管理', - 'menu.政策法规管理': '政策法规管理', - 'menu.关于我们': '关于我们', - 'menu.帮助中心': '帮助中心', - 'menu.已读问题': '已读问题', - 'menu.未读问题': '未读问题', - 'menu.友情链接分类': '友情链接分类', - 'menu.友情链接管理': '友情链接管理', + 'menu.年审结果': '年审结果', }; diff --git a/src/locales/zh-CN/policyManage.ts b/src/locales/zh-CN/policyManage.ts deleted file mode 100644 index c72b663..0000000 --- a/src/locales/zh-CN/policyManage.ts +++ /dev/null @@ -1,86 +0,0 @@ -export default { - // 政策法规管理列表页 - 'policyManage.title': '政策法规管理', - 'policyManage.serialNumber': '序号', - 'policyManage.title.label': '标题', - 'policyManage.date': '日期', - 'policyManage.status': '状态', - 'policyManage.publisher': '发布人', - 'policyManage.operation': '操作', - 'policyManage.view': '查看', - 'policyManage.edit': '编辑', - 'policyManage.publish': '发布', - 'policyManage.unpublish': '下架', - 'policyManage.delete': '删除', - 'policyManage.top': '置顶', - 'policyManage.add': '新增', - 'policyManage.search': '搜索', - 'policyManage.reset': '重置', - 'policyManage.submit': '提交', - 'policyManage.cancel': '取消', - 'policyManage.close': '关闭', - 'policyManage.confirmDelete': '确定要删除该政策吗?', - 'policyManage.confirmDeleteBatch': '确定要删除选中的政策吗?', - 'policyManage.confirmPublish': '确定要发布该政策吗?', - 'policyManage.confirmUnpublish': '确定要下架该政策吗?', - 'policyManage.deleteSuccess': '删除成功', - 'policyManage.deleteFailed': '删除失败', - 'policyManage.batchDeleteSuccess': '删除成功', - 'policyManage.batchDeletePartialFailed': '部分删除失败,请刷新后重试', - 'policyManage.batchDeleteFailed': '批量删除失败', - 'policyManage.publishSuccess': '发布成功', - 'policyManage.unpublishSuccess': '下架成功', - 'policyManage.publishFailed': '发布失败', - 'policyManage.unpublishFailed': '下架失败', - 'policyManage.fetchFailed': '获取数据失败', - 'policyManage.fetchDetailFailed': '获取详情失败', - 'policyManage.deleteConfirmTitle': '标题', - 'policyManage.deleteConfirmContent': '删除后无法恢复', - 'policyManage.selectedCount': '已选择 {count} 项', - 'policyManage.searchTitlePlaceholder': '请输入标题关键词', - 'policyManage.searchStatusPlaceholder': '请选择状态', - - // 政策法规表单页 - 'policyManage.form.title': '政策法规', - 'policyManage.form.add': '新增政策法规', - 'policyManage.form.edit': '编辑政策法规', - 'policyManage.form.view': '查看政策法规', - 'policyManage.form.isTop': '是否置顶', - 'policyManage.form.chineseTab': '中文版', - 'policyManage.form.englishTab': '英文版', - 'policyManage.form.titleZh': '标题(中文)', - 'policyManage.form.titleZhRequired': '请输入中文标题', - 'policyManage.form.titleZhPlaceholder': '请输入中文标题', - 'policyManage.form.contentZh': '正文内容(中文)', - 'policyManage.form.contentZhRequired': '请输入中文正文', - 'policyManage.form.contentZhPlaceholder': '请输入中文正文内容...', - 'policyManage.form.titleEn': '标题(英文)', - 'policyManage.form.titleEnRequired': '请输入英文标题', - 'policyManage.form.titleEnPlaceholder': '请输入英文标题', - 'policyManage.form.contentEn': '正文内容(英文)', - 'policyManage.form.contentEnRequired': '请输入英文正文', - 'policyManage.form.contentEnPlaceholder': '请输入英文正文内容...', - 'policyManage.form.addSuccess': '添加成功', - 'policyManage.form.updateSuccess': '更新成功', - 'policyManage.form.addFailed': '添加失败', - 'policyManage.form.updateFailed': '更新失败', - - // 政策法规详情页 - 'policyManage.detail.title': '标题', - 'policyManage.detail.titleEn': '英文标题', - 'policyManage.detail.isTop': '是否置顶', - 'policyManage.detail.status': '状态', - 'policyManage.detail.creator': '创建人', - 'policyManage.detail.createTime': '创建时间', - 'policyManage.detail.updateTime': '更新时间', - 'policyManage.detail.contentZh': '中文内容', - 'policyManage.detail.contentEn': '英文内容', - 'policyManage.detail.yes': '是', - 'policyManage.detail.no': '否', - - // 政策状态 - 'policyManage.status.draft': '草稿', - 'policyManage.status.published': '已发布', - 'policyManage.status.unpublished': '已下架', - 'policyManage.status.unknown': '未知', -}; diff --git a/src/locales/zh-CN/userQuestion.ts b/src/locales/zh-CN/userQuestion.ts deleted file mode 100644 index efe9a70..0000000 --- a/src/locales/zh-CN/userQuestion.ts +++ /dev/null @@ -1,169 +0,0 @@ -export default { - // 用户提问管理页面 - 'userQuestion.title': '用户提问管理', - 'userQuestion.user': '用户', - 'userQuestion.question': '问题', - 'userQuestion.answer': '回答', - 'userQuestion.createTime': '提问时间', - 'userQuestion.status': '状态', - 'userQuestion.operation': '操作', - 'userQuestion.unanswered': '未回答', - 'userQuestion.answered': '已回答', - 'userQuestion.reply': '回复', - 'userQuestion.view': '查看', - 'userQuestion.viewAll': '查看全部', - 'userQuestion.confirmDelete': '确定要删除该问题吗?', - 'userQuestion.batchDelete': '确定要批量删除选中的问题吗?', - 'userQuestion.description': '用户提问管理说明', - 'userQuestion.descriptionText': '用户提问管理模块用于处理用户在平台上提交的问题。已阅问题为已回复的问题,未阅问题为待回复的问题。您可以点击相应的卡片进入对应的管理页面。', - 'userQuestion.deleteSuccess': '删除成功', - 'userQuestion.deleteFailed': '删除失败', - 'userQuestion.replySuccess': '回复成功', - 'userQuestion.replyFailed': '回复失败', - 'userQuestion.selectRequired': '请至少选择一项', - 'userQuestion.batchDeleteConfirm': '删除后无法恢复,确定要继续吗?', - 'userQuestion.unread': '未阅', - 'userQuestion.read': '已阅', - 'userQuestion.delete': '删除', - 'userQuestion.edit': '编辑回答', - 'userQuestion.editSuccess': '编辑成功', - 'userQuestion.editFailed': '编辑失败', - 'userQuestion.publishStatus': '发布状态', - 'userQuestion.topStatus': '置顶状态', - 'userQuestion.published': '已发布', - 'userQuestion.unpublished': '未发布', - 'userQuestion.top': '已置顶', - 'userQuestion.untop': '未置顶', - 'userQuestion.submitAnswer': '提交回答', - 'userQuestion.saveEdit': '保存修改', - 'userQuestion.confirmSubmit': '确认提交回答', - 'userQuestion.confirmEdit': '确认保存修改', - 'userQuestion.submitConfirmText': '确定要提交这个回答吗?提交后将变为已回答状态。', - 'userQuestion.editConfirmText': '确定要保存对此回答的修改吗?', - 'userQuestion.all': '全部', - 'userQuestion.selectCategory': '请选择分类', - 'userQuestion.selectAnswerStatus': '请选择回答状态', - - // 问题分类选项 - 'questionCategory.biddingProcess': '招标流程', - 'questionCategory.biddingGuide': '投标指南', - 'questionCategory.registrationGuide': '注册指南', - 'questionCategory.systemOperation': '系统操作', - 'questionCategory.otherIssues': '其他问题', - - // 已阅问题页面 - 'readQuestion.title': '已阅问题管理', - 'readQuestion.user': '用户名', - 'readQuestion.question': '问题内容', - 'readQuestion.answer': '回复内容', - 'readQuestion.createTime': '提问时间', - 'readQuestion.answerTime': '回复时间', - 'readQuestion.status': '状态', - 'readQuestion.operation': '操作', - 'readQuestion.view': '查看详情', - 'readQuestion.delete': '删除', - 'readQuestion.search': '搜索', - 'readQuestion.reset': '重置', - 'readQuestion.confirmDelete': '确定要删除该问题吗?', - 'readQuestion.batchDelete': '批量删除', - 'readQuestion.viewDetails': '查看问题详情', - 'readQuestion.questionDetails': '问题详情', - 'readQuestion.answerDetails': '回复详情', - 'readQuestion.close': '关闭', - 'readQuestion.deleteSuccess': '删除成功', - 'readQuestion.deleteFailed': '删除失败', - 'readQuestion.selectRequired': '请至少选择一项', - 'readQuestion.batchDeleteConfirm': '删除后无法恢复,确定要继续吗?', - 'readQuestion.questionPlaceholder': '请输入问题关键词', - 'readQuestion.fetchFailed': '获取已回答问题列表失败', - 'readQuestion.edit': '编辑回答', - 'readQuestion.serialNumber': '序号', - 'readQuestion.questionTitle': '问题标题', - 'readQuestion.category': '问题分类', - 'readQuestion.asker': '提问人', - 'readQuestion.company': '公司', - 'readQuestion.account': '账号', - 'readQuestion.contact': '联系方式', - 'readQuestion.email': '邮箱', - 'readQuestion.askTime': '提问时间', - 'readQuestion.respondent': '回答人', - 'readQuestion.answerStatus': '回答状态', - 'readQuestion.confirm': '确认', - 'readQuestion.cancel': '取消', - 'readQuestion.batchDeleteSuccess': '批量删除成功', - 'readQuestion.batchDeleteFailed': '批量删除失败', - 'readQuestion.selectedCount': '已选择 {count} 项', - 'readQuestion.all': '全部', - 'readQuestion.selectCategory': '请选择分类', - 'readQuestion.selectAnswerStatus': '请选择回答状态', - - // 未阅问题页面 - 'unreadQuestion.title': '未阅问题管理', - 'unreadQuestion.user': '用户名', - 'unreadQuestion.question': '问题内容', - 'unreadQuestion.createTime': '提问时间', - 'unreadQuestion.status': '状态', - 'unreadQuestion.operation': '操作', - 'unreadQuestion.reply': '回答', - 'unreadQuestion.delete': '删除', - 'unreadQuestion.search': '搜索', - 'unreadQuestion.reset': '重置', - 'unreadQuestion.confirmDelete': '确定要删除该问题吗?', - 'unreadQuestion.batchDelete': '批量删除', - 'unreadQuestion.replyModal': '回复问题', - 'unreadQuestion.questionContent': '问题内容', - 'unreadQuestion.answerContent': '回复内容', - 'unreadQuestion.answerPlaceholder': '请输入回复内容...', - 'unreadQuestion.submit': '提交', - 'unreadQuestion.cancel': '取消', - 'unreadQuestion.answerRequired': '请输入回复内容', - 'unreadQuestion.selectRequired': '请至少选择一项', - 'unreadQuestion.batchDeleteConfirm': '删除后无法恢复,确定要继续吗?', - 'unreadQuestion.questionPlaceholder': '请输入问题关键词', - 'unreadQuestion.fetchFailed': '获取未回答问题列表失败', - 'unreadQuestion.serialNumber': '序号', - 'unreadQuestion.questionTitle': '问题标题', - 'unreadQuestion.category': '问题分类', - 'unreadQuestion.asker': '提问人', - 'unreadQuestion.company': '公司', - 'unreadQuestion.account': '账号', - 'unreadQuestion.contact': '联系方式', - 'unreadQuestion.email': '邮箱', - 'unreadQuestion.askTime': '提问时间', - 'unreadQuestion.batchDeleteSuccess': '批量删除成功', - 'unreadQuestion.batchDeleteFailed': '批量删除失败', - 'unreadQuestion.selectedCount': '已选择 {count} 项', - 'unreadQuestion.all': '全部', - 'unreadQuestion.selectCategory': '请选择分类', - - // 问题详情组件 - 'questionDetail.title': '标题', - 'questionDetail.category': '问题分类', - 'questionDetail.askTime': '提问时间', - 'questionDetail.asker': '提问人', - 'questionDetail.company': '公司名称', - 'questionDetail.account': '账号', - 'questionDetail.contact': '联系方式', - 'questionDetail.email': '邮箱', - 'questionDetail.publishStatus': '是否发布', - 'questionDetail.topStatus': '是否置顶', - 'questionDetail.answerTime': '回答时间', - 'questionDetail.respondent': '回答人', - 'questionDetail.questionContent': '问题内容', - 'questionDetail.answerContent': '回答内容', - - // 问题模态框组件 - 'questionModal.answer': '回答问题', - 'questionModal.edit': '编辑回答', - 'questionModal.view': '问题详情', - 'questionModal.publishSwitch': '发布', - 'questionModal.topSwitch': '置顶', - 'questionModal.confirmSubmit': '确认提交', - 'questionModal.confirmEdit': '确认修改', - 'questionModal.close': '关闭', - 'questionModal.answerRequired': '请输入回答内容', - 'questionModal.answerSuccess': '回答成功', - 'questionModal.answerFailed': '回答失败', - 'questionModal.editSuccess': '修改成功', - 'questionModal.editFailed': '修改失败', -}; diff --git a/src/pages/aboutManage/aboutManage.less b/src/pages/aboutManage/aboutManage.less deleted file mode 100644 index cdb4362..0000000 --- a/src/pages/aboutManage/aboutManage.less +++ /dev/null @@ -1,13 +0,0 @@ -.aboutManageContent { - background: #fff; - padding: 24px; - min-height: 500px; - border-radius: 4px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); -} - -.saveBtnWrapper { - display: flex; - justify-content: flex-end; - margin-top: 16px; -} diff --git a/src/pages/aboutManage/aboutManage.tsx b/src/pages/aboutManage/aboutManage.tsx deleted file mode 100644 index 300d3bc..0000000 --- a/src/pages/aboutManage/aboutManage.tsx +++ /dev/null @@ -1,268 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { useIntl, FormattedMessage } from 'umi'; -import { Card, Form, Input, Button, message, Tabs, Spin } from 'antd'; -import WangEditor from '@/components/WangEidtor/WangEidtor'; -import { getAboutUs, updateAboutUs, AboutUsRequest } from '@/servers/api/about'; -import styles from './aboutManage.less'; - -const { TabPane } = Tabs; - -interface ErrorInfo { - errorFields: { - name: string[]; - errors: string[]; - }[]; - values: Record; -} - -const AboutManage: React.FC = () => { - const intl = useIntl(); - const [form] = Form.useForm(); - const [loading, setLoading] = useState(false); - const [submitting, setSubmitting] = useState(false); - const [activeTabKey, setActiveTabKey] = useState('zh'); - const [aboutData, setAboutData] = useState(null); - - // 获取关于我们详情数据 - const fetchAboutData = async () => { - setLoading(true); - try { - const response = await getAboutUs(); - if (response && response.success) { - setAboutData(response.data); - // 设置表单初始值 - form.setFieldsValue({ - title: response.data.title, - titleEn: response.data.titleEn, - content: response.data.content, - contentEn: response.data.contentEn, - address: response.data.address, - addressEn: response.data.addressEn, - contactsPhone: response.data.contactsPhone, - contactsPhoneEn: response.data.contactsPhoneEn, - contactsEmail: response.data.contactsEmail, - contactsEmailEn: response.data.contactsEmailEn, - contactsConsult: response.data.contactsConsult, - contactsConsultEn: response.data.contactsConsultEn, - }); - } else { - message.error(response.message || intl.formatMessage({ id: 'aboutManage.fetchFailed' })); - } - } catch (error) { - console.error('获取关于我们数据失败:', error); - message.error(intl.formatMessage({ id: 'aboutManage.fetchFailed' })); - } finally { - setLoading(false); - } - }; - - // 首次加载时获取数据 - useEffect(() => { - fetchAboutData(); - }, []); - - // 处理Tab切换 - const handleTabChange = (key: string) => { - setActiveTabKey(key); - }; - - // 处理表单提交 - const handleSubmit = async () => { - try { - const values = await form.validateFields(); - setSubmitting(true); - - // 准备提交数据 - const submitData: AboutUsRequest = { - ...aboutData, - ...values, - }; - - // 保留原有的addressImg,如果没有则设置为空字符串 - submitData.addressImg = aboutData?.addressImg || ''; - - const response = await updateAboutUs(submitData); - if (response && response.success) { - message.success(intl.formatMessage({ id: 'aboutManage.saveSuccess' })); - fetchAboutData(); // 刷新数据 - } else { - message.error(response.message || intl.formatMessage({ id: 'aboutManage.saveFailed' })); - } - } catch (errorInfo: any) { - // 获取所有字段的错误信息 - const errorFields = errorInfo.errorFields || []; - - // 检查是否有中文标题或内容的错误 - const hasZhError = errorFields.some((field: any) => { - if (!field.name) return false; - const fieldName = Array.isArray(field.name) ? field.name.join('.') : String(field.name); - return !fieldName.includes('En'); - }); - - // 检查是否有英文标题或内容的错误 - const hasEnError = errorFields.some((field: any) => { - if (!field.name) return false; - const fieldName = Array.isArray(field.name) ? field.name.join('.') : String(field.name); - return fieldName.includes('En'); - }); - - // 如果有中文字段错误,切换到中文Tab - if (hasZhError) { - setActiveTabKey('zh'); - } - // 如果只有英文字段错误,切换到英文Tab - else if (hasEnError && !hasZhError) { - setActiveTabKey('en'); - } - - console.log('表单验证失败:', errorInfo); - } finally { - setSubmitting(false); - } - }; - - return ( -
- - {intl.formatMessage({ id: 'aboutManage.save' })} - - } - > - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
-
-
- ); -}; - -export default AboutManage; diff --git a/src/pages/downloadManage/downloadManage.less b/src/pages/downloadManage/downloadManage.less deleted file mode 100644 index 4d77c6e..0000000 --- a/src/pages/downloadManage/downloadManage.less +++ /dev/null @@ -1,7 +0,0 @@ -.downloadManageContainer { - .uploadHint { - margin-top: 8px; - color: #999; - font-size: 12px; - } -} diff --git a/src/pages/downloadManage/downloadManage.tsx b/src/pages/downloadManage/downloadManage.tsx deleted file mode 100644 index d55c800..0000000 --- a/src/pages/downloadManage/downloadManage.tsx +++ /dev/null @@ -1,675 +0,0 @@ -import React, { useState } from 'react'; -import { useIntl } from 'umi'; -import { Button, Table, Space, Modal, message, Input, Select, Form, Tooltip, Switch, Upload, Tag } from 'antd'; -import { - PlusOutlined, - DeleteOutlined, - ExclamationCircleOutlined, - SearchOutlined, - InboxOutlined, -} from '@ant-design/icons'; -import { validateFileSize } from '@/utils/utils'; -import styles from './downloadManage.less'; -import type { UploadFile } from 'antd/es/upload/interface'; - -const { Option } = Select; -const { Dragger } = Upload; - -type DownloadType = API.DownloadRecord & { - key: string; -}; - -const DownloadManage: React.FC = () => { - const intl = useIntl(); - const [selectedRowKeys, setSelectedRowKeys] = useState([]); - const [loading, setLoading] = useState(false); - const [form] = Form.useForm(); - const [modalVisible, setModalVisible] = useState(false); - const [isEdit, setIsEdit] = useState(false); - const [currentId, setCurrentId] = useState(''); - const [modalForm] = Form.useForm(); - const [fileList, setFileList] = useState([]); - const [thumbnailList, setThumbnailList] = useState([]); - const [downloadData, setDownloadData] = useState([ - { - key: '1', - id: '1', - name: '采购申请模板', - category: '模板文件', - keyword: '采购,申请,模板', - createTime: '2023-06-15 10:30:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '2', - id: '2', - name: '系统操作手册V1.0', - category: '操作手册', - keyword: '系统,操作,手册', - createTime: '2023-06-20 14:45:00', - createBy: 'admin', - status: '0', // 草稿 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '3', - id: '3', - name: '发票申请指南', - category: '操作手册', - keyword: '发票,申请,指南', - createTime: '2023-06-25 09:15:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - ]); - const [pagination, setPagination] = useState({ - current: 1, - pageSize: 10, - total: 3, - showSizeChanger: true, - showQuickJumper: true, - showTotal: (total: number) => `共 ${total} 条记录`, - }); - const [searchParams, setSearchParams] = useState({}); - - // 获取下载中心列表(模拟数据) - const fetchDownloadList = (current: number = 1, pageSize: number = 10) => { - setLoading(true); - // 模拟API请求延迟 - setTimeout(() => { - setLoading(false); - }, 500); - }; - - // 处理编辑 - const handleEdit = (record: DownloadType) => { - // 检查是否为已发布状态 - if (record.status === '1') { - message.warning('已发布的文件不能编辑'); - return; - } - - setIsEdit(true); - setCurrentId(record.id); - setModalVisible(true); - - // 填充表单数据 - modalForm.setFieldsValue({ - name: record.name, - category: record.category, - keyword: record.keyword, - }); - - // 重置文件列表和缩略图 - setFileList([]); - if (record.thumbnail) { - setThumbnailList([ - { - uid: '-1', - name: 'thumbnail.png', - status: 'done', - url: record.thumbnail, - type: 'image/png', - size: 0, - } as UploadFile - ]); - } else { - setThumbnailList([]); - } - }; - - // 处理删除 - const showDeleteConfirm = (record: DownloadType) => { - // 检查是否为已发布状态 - if (record.status === '1') { - message.warning('已发布的文件不能删除'); - return; - } - - Modal.confirm({ - title: '确定要删除该文件吗?', - icon: , - content: `名称: ${record.name}`, - okText: '确定', - okType: 'danger', - cancelText: '取消', - maskClosable: false, - onOk: async () => { - try { - // 模拟删除操作 - const newData = downloadData.filter(item => item.id !== record.id); - setDownloadData(newData); - message.success('删除成功'); - } catch (error) { - console.error('删除文件失败:', error); - message.error('删除失败'); - } - }, - }); - }; - - // 处理发布/下架 - const handlePublishStatus = async (record: DownloadType) => { - // 状态: 0-草稿,1-已发布 - const isPublished = record.status === '1'; - const actionText = isPublished ? '下架' : '发布'; - const newStatus = isPublished ? '0' : '1'; - - try { - // 模拟API请求 - const newData = downloadData.map(item => - item.id === record.id ? { ...item, status: newStatus } : item - ); - setDownloadData(newData); - message.success(`${actionText}成功`); - } catch (error) { - console.error(`${actionText}失败:`, error); - message.error(`${actionText}失败`); - } - }; - - // 获取栏目标签 - const getCategoryTag = (category: string) => { - switch (category) { - case '模板文件': - return 模板文件; - case '操作手册': - return 操作手册; - default: - return 其他; - } - }; - - // 获取状态标签 - const getStatusTag = (status: string) => { - switch (status) { - case '0': - return 草稿; - case '1': - return 已发布; - default: - return 未知; - } - }; - - // 处理表格分页变化 - const handleTableChange = (newPagination: any) => { - fetchDownloadList(newPagination.current, newPagination.pageSize); - }; - - const columns = [ - { - title: '序号', - dataIndex: 'id', - key: 'id', - width: 80, - }, - { - title: '缩略图', - dataIndex: 'thumbnail', - key: 'thumbnail', - render: (thumbnail: string) => ( - thumbnail ? 缩略图 : '无' - ), - }, - { - title: '名称', - dataIndex: 'name', - key: 'name', - ellipsis: { - showTitle: false, - }, - render: (name: string) => ( - - {name} - - ), - }, - { - title: '栏目', - dataIndex: 'category', - key: 'category', - render: (category: string) => getCategoryTag(category), - }, - { - title: '关键词', - dataIndex: 'keyword', - key: 'keyword', - ellipsis: { - showTitle: false, - }, - render: (keyword: string) => ( - - {keyword} - - ), - }, - { - title: '状态', - dataIndex: 'status', - key: 'status', - render: (status: string) => getStatusTag(status), - }, - { - title: '上传时间', - dataIndex: 'createTime', - key: 'createTime', - }, - { - title: '上传人', - dataIndex: 'createBy', - align: 'center' as const, - key: 'createBy', - }, - { - title: '操作', - key: 'action', - width: 300, - align: 'center' as const, - render: (_: unknown, record: DownloadType) => ( - <> - - {record.status === '1' ? ( - - ) : ( - <> - - - - )} - {record.status !== '1' && ( - - )} - - ), - }, - ]; - - // 行选择限制 - const checkSelectable = (record: DownloadType) => { - return record.status !== '1'; // 已发布的不能选择 - }; - - const onSelectChange = (newSelectedRowKeys: React.Key[]) => { - setSelectedRowKeys(newSelectedRowKeys); - }; - - const rowSelection = { - selectedRowKeys, - onChange: onSelectChange, - getCheckboxProps: (record: DownloadType) => ({ - disabled: record.status === '1', // 已发布的不能选择 - }), - }; - - const hasSelected = selectedRowKeys.length > 0; - - // 处理添加 - const handleAdd = () => { - setIsEdit(false); - setCurrentId(''); - modalForm.resetFields(); - setFileList([]); - setThumbnailList([]); - setModalVisible(true); - }; - - // 处理批量删除 - const handleBatchDelete = () => { - Modal.confirm({ - title: '确定要删除选中的文件吗?', - icon: , - content: '删除后无法恢复', - okText: '确定', - okType: 'danger', - cancelText: '取消', - maskClosable: false, - onOk: async () => { - setLoading(true); - try { - // 模拟批量删除,过滤掉已发布的文件 - const deleteIds = selectedRowKeys.filter(key => { - const record = downloadData.find(item => item.key === key); - return record && record.status !== '1'; - }); - - const newData = downloadData.filter(item => !deleteIds.includes(item.key)); - setDownloadData(newData); - setSelectedRowKeys([]); - message.success('删除成功'); - } catch (error) { - console.error('批量删除失败:', error); - message.error('批量删除失败'); - } finally { - setLoading(false); - } - }, - }); - }; - - // 处理搜索 - const handleSearch = (values: API.DownloadSearchParams) => { - console.log('搜索条件:', values); - setSearchParams(values); - - // 模拟搜索,实际项目中应调用API - const initialData = [ - { - key: '1', - id: '1', - name: '采购申请模板', - category: '模板文件', - keyword: '采购,申请,模板', - createTime: '2023-06-15 10:30:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '2', - id: '2', - name: '系统操作手册V1.0', - category: '操作手册', - keyword: '系统,操作,手册', - createTime: '2023-06-20 14:45:00', - createBy: 'admin', - status: '0', // 草稿 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '3', - id: '3', - name: '发票申请指南', - category: '操作手册', - keyword: '发票,申请,指南', - createTime: '2023-06-25 09:15:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - ]; - - if (values.name || values.category || values.status) { - const filteredData = initialData.filter(item => { - const nameMatch = values.name ? item.name.includes(values.name) : true; - const categoryMatch = values.category ? item.category === values.category : true; - const statusMatch = values.status ? item.status === values.status : true; - return nameMatch && categoryMatch && statusMatch; - }); - setDownloadData(filteredData); - } else { - setDownloadData(initialData); - } - }; - - // 处理文件上传变化 - const handleFileChange = (info: any) => { - setFileList(info.fileList.slice(-1)); // 只保留最后一个文件 - }; - - // 处理缩略图上传变化 - const handleThumbnailChange = (info: any) => { - setThumbnailList(info.fileList.slice(-1)); // 只保留最后一个文件 - - // 如果上传成功,模拟获取URL - if (info.file.status === 'done') { - message.success(`${info.file.name} 上传成功`); - } else if (info.file.status === 'error') { - message.error(`${info.file.name} 上传失败`); - } - }; - - // 处理模态框提交 - const handleModalSubmit = () => { - modalForm.validateFields().then(values => { - try { - // 检查是否有文件上传 - if (!isEdit && fileList.length === 0) { - message.error('请上传文件'); - return; - } - - const thumbnailUrl = thumbnailList.length > 0 - ? thumbnailList[0].url || 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' - : undefined; - - const newItem: DownloadType = { - key: isEdit ? currentId : (downloadData.length + 1).toString(), - id: isEdit ? currentId : (downloadData.length + 1).toString(), - name: values.name, - category: values.category, - keyword: values.keyword, - createTime: new Date().toLocaleString(), - createBy: 'admin', - status: '0', // 默认为草稿状态 - thumbnail: thumbnailUrl, - }; - - if (isEdit) { - // 编辑模式,更新数据 - const newData = downloadData.map(item => - item.id === currentId ? newItem : item - ); - setDownloadData(newData); - message.success('更新成功'); - } else { - // 新增模式,添加数据 - setDownloadData([...downloadData, newItem]); - message.success('添加成功'); - } - - setModalVisible(false); - modalForm.resetFields(); - setFileList([]); - setThumbnailList([]); - } catch (error) { - console.error(isEdit ? '更新文件失败:' : '添加文件失败:', error); - message.error(isEdit ? '更新失败' : '添加失败'); - } - }).catch(info => { - console.log('校验失败:', info); - }); - }; - - // 处理模态框取消 - const handleModalCancel = () => { - setModalVisible(false); - modalForm.resetFields(); - setFileList([]); - setThumbnailList([]); - }; - - return ( -
-
-
- - - - - - - - - - - - - -
- -
- - - {hasSelected && ( - - 已选择 {selectedRowKeys.length} 项 - - )} -
-
- -
- - - - {/* 新增/编辑模态框 */} - -
- - - - - - - - - - - - - - validateFileSize(file, 20, ['pdf', 'zip', 'rar', 'doc', 'docx'])} - onChange={handleFileChange} - action="/" - maxCount={1} - > -

- -

-

点击或拖拽文件到此区域上传

-

支持格式:.rar .zip .doc .docx .pdf,单个文件不能超过20MB

-
-
- - - validateFileSize(file, 2, ['jpg', 'png', 'gif'])} - onChange={handleThumbnailChange} - action="/" - maxCount={1} - > - {thumbnailList.length >= 1 ? null : ( -
- -
上传
-
- )} -
-
- -
- - ); -}; - -export default DownloadManage; diff --git a/src/pages/friendLinkManage/friendLinkCategory.tsx b/src/pages/friendLinkManage/friendLinkCategory.tsx deleted file mode 100644 index 957e9a3..0000000 --- a/src/pages/friendLinkManage/friendLinkCategory.tsx +++ /dev/null @@ -1,314 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { useIntl } from 'umi'; -import { Card, Table, Button, Modal, Form, Input, Space, message, Select, TreeSelect, Popconfirm, Tag } from 'antd'; -import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, EditOutlined } from '@ant-design/icons'; -import { getCategoryList, getAllCategories, addCategory, updateCategory, deleteCategory } from '@/servers/api/friendLink'; -import { useFriendLinkDict } from '@/dicts/friendLinkDict'; -import styles from './friendLinkManage.less'; - -const { Option } = Select; -const { TextArea } = Input; - -// 友情链接分类类型定义已移至全局typings.d.ts - -const FriendLinkCategory: React.FC = () => { - const intl = useIntl(); - const { categoryTypeOptions, getCategoryTypeText } = useFriendLinkDict(); - const [loading, setLoading] = useState(false); - const [modalVisible, setModalVisible] = useState(false); - const [isEdit, setIsEdit] = useState(false); - const [currentCategory, setCurrentCategory] = useState(null); - const [categoryData, setCategoryData] = useState([]); - const [pagination, setPagination] = useState({ - current: 1, - pageSize: 10, - total: 0, - }); - const [form] = Form.useForm(); - - // 获取分类列表 - const fetchCategoryList = async (pageNo = 1, pageSize = 10) => { - setLoading(true); - try { - const res = await getCategoryList({ - basePageRequest: { - pageNo, - pageSize, - }, - }); - - if (res.data && res.success) { - setCategoryData(res.data.records); - setPagination({ - current: res.data.current, - pageSize: res.data.size, - total: res.data.total, - }); - } - } catch (error) { - console.error('Failed to fetch category list', error); - } finally { - setLoading(false); - } - }; - - // 首次加载时获取数据 - useEffect(() => { - fetchCategoryList(); - }, []); - // 处理分页变化 - const handleTableChange = (paginationParams: any) => { - fetchCategoryList(paginationParams.current, paginationParams.pageSize); - }; - - // 处理添加分类 - const handleAddCategory = () => { - setIsEdit(false); - setCurrentCategory(null); - form.resetFields(); - form.setFieldsValue({ - parentId: '0', // 设置默认父级为顶级 - type: '0', // 设置默认类型为普通展示 - orderBy: '1', // 设置默认排序为1 - }); - setModalVisible(true); - }; - - // 处理编辑分类 - const handleEditCategory = (record: API.CategoryType) => { - setIsEdit(true); - setCurrentCategory(record); - form.setFieldsValue({ - name: record.name, - type: record.type, - parentId: record.parentId, - orderBy: record.orderBy, - remark: record.remark, - }); - setModalVisible(true); - }; - - // 处理删除分类 - const handleDeleteCategory = async (id: string) => { - try { - const res = await deleteCategory(id); - if (res.success) { - message.success(intl.formatMessage({ id: 'friendLink.category.delete.success' })); - fetchCategoryList(pagination.current, pagination.pageSize); - } - } catch (error) { - console.error('Failed to delete category', error); - } - }; - - // 显示删除确认框 - const showDeleteConfirm = (record: API.CategoryType) => { - Modal.confirm({ - title: intl.formatMessage({ id: 'friendLink.category.delete.confirm.title' }), - icon: , - content: intl.formatMessage( - { id: 'friendLink.category.delete.confirm.content' }, - { name: record.name } - ), - okText: intl.formatMessage({ id: 'common.confirm' }), - okType: 'danger', - cancelText: intl.formatMessage({ id: 'common.cancel' }), - onOk() { - handleDeleteCategory(record.id); - }, - }); - }; - - // 处理表单提交 - const handleModalSubmit = () => { - form.validateFields().then(async (values) => { - try { - if (isEdit && currentCategory) { - // 编辑模式 - const res = await updateCategory({ - ...values, - id: currentCategory.id, - }); - if (res.success) { - message.success(intl.formatMessage({ id: 'friendLink.category.update.success' })); - setModalVisible(false); - fetchCategoryList(pagination.current, pagination.pageSize); - } - } else { - // 新增模式 - const res = await addCategory(values); - if (res.success) { - message.success(intl.formatMessage({ id: 'friendLink.category.add.success' })); - setModalVisible(false); - fetchCategoryList(pagination.current, pagination.pageSize); - } - } - } catch (error) { - console.error('Submit failed', error); - } - }); - }; - - // 渲染分类类型标签 - const renderCategoryType = (type: string) => { - const color = type === '1' ? 'blue' : 'default'; - return ( - - {getCategoryTypeText(type)} - - ); - }; - - // 表格列定义 - const columns = [ - { - title: intl.formatMessage({ id: 'friendLink.category.name' }), - dataIndex: 'name', - key: 'name', - }, - { - title: intl.formatMessage({ id: 'friendLink.category.type' }), - dataIndex: 'type', - key: 'type', - render: (type: string) => renderCategoryType(type), - }, - { - title: intl.formatMessage({ id: 'friendLink.category.sort' }), - dataIndex: 'orderBy', - key: 'orderBy', - width: 100, - }, - { - title: intl.formatMessage({ id: 'friendLink.category.form.remark' }), - dataIndex: 'remark', - key: 'remark', - width: 200, - ellipsis: true, - }, - { - title: intl.formatMessage({ id: 'friendLink.category.operation' }), - key: 'operation', - width: 150, - render: (_: any, record: API.CategoryType) => ( - - - - - ), - }, - ]; - - return ( -
-
-
-
- -
-
- -
-
- - - {/* 新增/编辑分类模态框 */} - setModalVisible(false)} - destroyOnClose - > -
- - - - - - - - - {/* 父级分类项,已完全隐藏 */} - - - - - - - -