添加 阿拉伯语 和 俄语

This commit is contained in:
2026-08-24 10:31:15 +08:00
parent e09f0eccda
commit 398bd6fac6
85 changed files with 2015 additions and 391 deletions
+2
View File
@@ -7,6 +7,8 @@ export interface IOverviewStats {
today: number
zh: number
en: number
ar: number
ru: number
}
export interface IOverviewRecentAssessment {
+4 -3
View File
@@ -1,11 +1,12 @@
import request from '@/utils/request'
import type { ICommonPageResponse, ICommonResponse } from '@/types/common'
import type { ContentLocale } from '@/utils/content-locale'
export type MediaType = 'article' | 'video'
export interface INewsItem {
id: string
locale: 'en' | 'zh'
locale: ContentLocale
mediaType: MediaType
title: string
summary: string
@@ -23,7 +24,7 @@ export interface INewsItem {
export interface INewsListParams {
page: number
pageSize: number
locale?: '' | 'en' | 'zh'
locale?: '' | ContentLocale
mediaType?: '' | MediaType
keyword?: string
status?: '' | 'published' | 'draft'
@@ -31,7 +32,7 @@ export interface INewsListParams {
export interface INewsInput {
id?: string
locale: 'en' | 'zh'
locale: ContentLocale
mediaType: MediaType
title: string
summary: string
+3 -2
View File
@@ -1,10 +1,11 @@
import request from '@/utils/request'
import type { ICommonResponse } from '@/types/common'
import type { ContentLocale } from '@/utils/content-locale'
export interface IPageSeoItem {
id: string
routeKey: string
locale: 'en' | 'zh'
locale: ContentLocale
pageLabel: string
title: string
description: string
@@ -30,7 +31,7 @@ export interface IPageSeoUpdatePayload {
}
export interface IPageSeoListParams {
locale?: 'en' | 'zh' | ''
locale?: ContentLocale | ''
keyword?: string
}
+4 -2
View File
@@ -22,6 +22,8 @@
<el-radio-group v-model="submitForm.locale">
<el-radio value="zh">中文</el-radio>
<el-radio value="en">英文</el-radio>
<el-radio value="ar">阿拉伯语</el-radio>
<el-radio value="ru">俄语</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="标题" prop="title">
@@ -31,7 +33,7 @@
<el-input v-model="submitForm.summary" type="textarea" :rows="4" placeholder="请输入简介" />
</el-form-item>
<el-form-item label="缩略图" prop="thumbnail">
<el-input v-model="submitForm.thumbnail" placeholder="如 /images/cases/case-1.png" />
<ThumbnailField v-model="submitForm.thumbnail" />
</el-form-item>
<el-form-item label="图片说明">
<el-input v-model="submitForm.thumbnailAlt" placeholder="缩略图 alt 文本(可选)" />
@@ -97,7 +99,7 @@ const formRules = computed<FormRules>(() => ({
locale: [{ required: true, message: '请选择语言', trigger: 'change' }],
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
summary: [{ required: true, message: '请输入简介', trigger: 'blur' }],
thumbnail: [{ required: true, message: '请输入缩略图地址', trigger: 'blur' }],
thumbnail: [{ required: true, message: '请上传缩略图或输入图片地址', trigger: 'blur' }],
url:
submitForm.value.mediaType === 'article'
? [{ required: true, message: '请输入原文链接', trigger: 'blur' }]
+10 -9
View File
@@ -33,13 +33,14 @@
<BaseTag :type="row.mediaType === 'video' ? 'warning' : 'primary'" :text="row.mediaType === 'video' ? '视频' : '文章'" />
</template>
<template #locale="{ row }">
<BaseTag :type="row.locale === 'zh' ? 'primary' : 'success'" :text="row.locale === 'zh' ? '中文' : '英文'" />
<BaseTag :type="contentLocaleTagType(row.locale)" :text="contentLocaleLabel(row.locale)" />
</template>
<template #thumbnail="{ row }">
<el-image
v-if="row.thumbnail"
:src="row.thumbnail"
:preview-src-list="[row.thumbnail]"
preview-teleported
fit="cover"
style="width: 120px; height: 120px; border-radius: 4px"
/>
@@ -79,6 +80,12 @@ import { Dialog } from '@/utils/dialog'
import { deleteNews, newsPage, type INewsItem } from '@/api/news'
import NewsCreate from '@/views/content/news/create.vue'
import type { IFormConfig } from '@/types/components/page'
import {
CONTENT_LOCALE_FILTER_OPTIONS,
contentLocaleLabel,
contentLocaleTagType,
type ContentLocale
} from '@/utils/content-locale'
defineOptions({ name: 'NewsView' })
@@ -86,12 +93,6 @@ const menuStore = useMenuStore()
const basePageRef = useTemplateRef('basePageRef')
const newsCreateRef = useTemplateRef<InstanceType<typeof NewsCreate>>('newsCreateRef')
const LANG_OPTIONS = [
{ label: '全部', value: '' },
{ label: '中文', value: 'zh' },
{ label: '英文', value: 'en' },
]
const TYPE_OPTIONS = [
{ label: '全部', value: '' },
{ label: '文章', value: 'article' },
@@ -116,7 +117,7 @@ const searchFormConfig = ref<IFormConfig[]>([
label: '语言',
prop: 'locale',
type: 'elSelect',
attrs: { placeholder: '请选择', options: LANG_OPTIONS },
attrs: { placeholder: '请选择', options: CONTENT_LOCALE_FILTER_OPTIONS },
defaultValue: '',
},
{
@@ -164,7 +165,7 @@ const getList = async (queryForm: Record<string, unknown>, page: number, pageSiz
page,
pageSize,
mediaType: (queryForm.mediaType as '' | 'article' | 'video') || undefined,
locale: (queryForm.locale as '' | 'en' | 'zh') || undefined,
locale: (queryForm.locale as '' | ContentLocale) || undefined,
keyword: String(queryForm.keyword || '') || undefined,
status: (queryForm.status as '' | 'published' | 'draft') || undefined,
})
@@ -34,9 +34,9 @@
</template>
</el-table-column>
<el-table-column prop="email" label="邮箱" min-width="140" show-overflow-tooltip />
<el-table-column label="语言" width="72">
<el-table-column label="语言" width="96">
<template #default="{ row }">
<BaseTag :type="row.lang === 'zh' ? 'primary' : 'success'" :text="row.lang === 'zh' ? '中文' : '英文'" size="small" />
<BaseTag :type="contentLocaleTagType(row.lang)" :text="contentLocaleLabel(row.lang)" size="small" />
</template>
</el-table-column>
<el-table-column label="状态" width="72">
@@ -59,9 +59,9 @@
<el-table-column label="联系人" min-width="100">
<template #default="{ row }">{{ row.firstName }} {{ row.lastName }}</template>
</el-table-column>
<el-table-column label="语言" width="72">
<el-table-column label="语言" width="96">
<template #default="{ row }">
<BaseTag :type="row.lang === 'zh' ? 'primary' : 'success'" :text="row.lang === 'zh' ? '中文' : '英文'" size="small" />
<BaseTag :type="contentLocaleTagType(row.lang)" :text="contentLocaleLabel(row.lang)" size="small" />
</template>
</el-table-column>
<el-table-column label="状态" width="72">
@@ -84,6 +84,7 @@
<script setup lang="ts">
import { getDashboardOverview, type IDashboardOverview } from '@/api/dashboard'
import { contentLocaleLabel, contentLocaleTagType } from '@/utils/content-locale'
const router = useRouter()
const menuStore = useMenuStore()
@@ -109,7 +110,7 @@ const statCards = computed(() => {
key: 'assessment-unread',
label: '评估表未读',
value: a.unread,
extra: `中文 ${a.zh} · 英文 ${a.en}`,
extra: `中 ${a.zh} · 英 ${a.en} · 阿 ${a.ar} · 俄 ${a.ru}`,
icon: 'HOutline:EnvelopeIcon',
type: 'orange',
},
@@ -125,7 +126,7 @@ const statCards = computed(() => {
key: 'partner-unread',
label: '合作申请未读',
value: p.unread,
extra: `中文 ${p.zh} · 英文 ${p.en}`,
extra: `中 ${p.zh} · 英 ${p.en} · 阿 ${p.ar} · 俄 ${p.ru}`,
icon: 'HOutline:ChatBubbleLeftRightIcon',
type: 'teal',
},
+12 -8
View File
@@ -21,7 +21,7 @@
</el-button>
</template>
<template #lang="{ row }">
<BaseTag :type="row.lang === 'zh' ? 'primary' : 'success'" :text="row.lang === 'zh' ? '中文' : '英文'" />
<BaseTag :type="contentLocaleTagType(row.lang)" :text="contentLocaleLabel(row.lang)" />
</template>
<template #status="{ row }">
<BaseTag :type="row.status === 'unread' ? 'warning' : 'info'" :text="row.status === 'unread' ? '未读' : '已读'" />
@@ -44,7 +44,7 @@
<el-dialog v-model="detailVisible" title="评估表详情" width="640px">
<el-descriptions v-if="current" :column="1" border>
<el-descriptions-item label="语言">{{ current.lang === 'zh' ? '中文' : '英文' }}</el-descriptions-item>
<el-descriptions-item label="语言">{{ contentLocaleLabel(current.lang) }}</el-descriptions-item>
<el-descriptions-item label="患者名">{{ current.firstName }}</el-descriptions-item>
<el-descriptions-item label="患者姓">{{ current.lastName || '-' }}</el-descriptions-item>
<el-descriptions-item label="邮箱">{{ current.email }}</el-descriptions-item>
@@ -66,17 +66,21 @@ import {
type IAssessmentItem,
} from '@/api/assessment'
import type { IFormConfig } from '@/types/components/page'
import {
CONTENT_LOCALE_FILTER_OPTIONS,
contentLocaleLabel,
contentLocaleTagType,
type ContentLocale
} from '@/utils/content-locale'
defineOptions({ name: 'AssessmentView' })
const menuStore = useMenuStore()
const basePageRef = useTemplateRef('basePageRef')
const LANG_OPTIONS = [
{ label: '全部', value: 'all' },
{ label: '中文', value: 'zh' },
{ label: '英文', value: 'en' },
]
const LANG_OPTIONS = CONTENT_LOCALE_FILTER_OPTIONS.map((opt) =>
opt.value === '' ? { label: '全部', value: 'all' } : opt
)
const searchFormConfig = ref<IFormConfig[]>([
{
@@ -124,7 +128,7 @@ const getList = async (queryForm: Record<string, unknown>, page: number, pageSiz
const { data: res } = await assessmentPage({
page,
pageSize,
lang: (queryForm.lang as 'all' | 'zh' | 'en') || 'all',
lang: (queryForm.lang as 'all' | ContentLocale) || 'all',
email: String(queryForm.email || ''),
})
if (res.code !== 200) return
+12 -8
View File
@@ -21,7 +21,7 @@
</el-button>
</template>
<template #lang="{ row }">
<BaseTag :type="row.lang === 'zh' ? 'primary' : 'success'" :text="row.lang === 'zh' ? '中文' : '英文'" />
<BaseTag :type="contentLocaleTagType(row.lang)" :text="contentLocaleLabel(row.lang)" />
</template>
<template #status="{ row }">
<BaseTag :type="row.status === 'unread' ? 'warning' : 'info'" :text="row.status === 'unread' ? '未读' : '已读'" />
@@ -44,7 +44,7 @@
<el-dialog v-model="detailVisible" title="加入我们详情" width="640px">
<el-descriptions v-if="current" :column="1" border>
<el-descriptions-item label="语言">{{ current.lang === 'zh' ? '中文' : '英文' }}</el-descriptions-item>
<el-descriptions-item label="语言">{{ contentLocaleLabel(current.lang) }}</el-descriptions-item>
<el-descriptions-item label="名">{{ current.firstName }}</el-descriptions-item>
<el-descriptions-item label="姓">{{ current.lastName }}</el-descriptions-item>
<el-descriptions-item label="公司">{{ current.companyName }}</el-descriptions-item>
@@ -67,17 +67,21 @@ import {
type IPartnerItem,
} from '@/api/partner'
import type { IFormConfig } from '@/types/components/page'
import {
CONTENT_LOCALE_FILTER_OPTIONS,
contentLocaleLabel,
contentLocaleTagType,
type ContentLocale
} from '@/utils/content-locale'
defineOptions({ name: 'PartnerView' })
const menuStore = useMenuStore()
const basePageRef = useTemplateRef('basePageRef')
const LANG_OPTIONS = [
{ label: '全部', value: 'all' },
{ label: '中文', value: 'zh' },
{ label: '英文', value: 'en' },
]
const LANG_OPTIONS = CONTENT_LOCALE_FILTER_OPTIONS.map((opt) =>
opt.value === '' ? { label: '全部', value: 'all' } : opt
)
const searchFormConfig = ref<IFormConfig[]>([
{
@@ -128,7 +132,7 @@ const getList = async (queryForm: Record<string, unknown>, page: number, pageSiz
const { data: res } = await partnerPage({
page,
pageSize,
lang: (queryForm.lang as 'all' | 'zh' | 'en') || 'all',
lang: (queryForm.lang as 'all' | ContentLocale) || 'all',
email: String(queryForm.email || ''),
})
if (res.code !== 200) return
+13 -11
View File
@@ -11,7 +11,7 @@
@refresh="getList"
>
<template #locale="{ row }">
<BaseTag :type="row.locale === 'zh' ? 'primary' : 'success'" :text="row.locale === 'zh' ? '中文' : '英文'" />
<BaseTag :type="contentLocaleTagType(row.locale)" :text="contentLocaleLabel(row.locale)" />
</template>
<template #title="{ row }">
<TextEllipsis :text="row.title" :lines="2" />
@@ -32,7 +32,7 @@
<el-input :model-value="current?.routeKey" disabled />
</el-form-item>
<el-form-item label="语言">
<el-input :model-value="current?.locale === 'zh' ? '中文' : '英文'" disabled />
<el-input :model-value="current ? contentLocaleLabel(current.locale) : ''" disabled />
</el-form-item>
<el-form-item label="页面标题" prop="title">
<el-input v-model="form.title" type="textarea" :rows="2" placeholder="浏览器标签页标题(完整 title)" />
@@ -79,24 +79,24 @@
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import { seoList, updateSeo, type IPageSeoItem } from '@/api/seo'
import type { IFormConfig } from '@/types/components/page'
import {
CONTENT_LOCALE_FILTER_OPTIONS,
contentLocaleLabel,
contentLocaleTagType,
type ContentLocale
} from '@/utils/content-locale'
defineOptions({ name: 'SeoView' })
const basePageRef = useTemplateRef('basePageRef')
const formRef = useTemplateRef<FormInstance>('formRef')
const LANG_OPTIONS = [
{ label: '全部', value: '' },
{ label: '中文', value: 'zh' },
{ label: '英文', value: 'en' },
]
const searchFormConfig = ref<IFormConfig[]>([
{
label: '语言',
prop: 'locale',
type: 'elSelect',
attrs: { placeholder: '请选择', options: LANG_OPTIONS },
attrs: { placeholder: '请选择', options: CONTENT_LOCALE_FILTER_OPTIONS },
defaultValue: '',
},
{
@@ -142,14 +142,16 @@ const rules: FormRules = {
}
const editTitle = computed(() =>
current.value ? `编辑 SEO — ${current.value.pageLabel}(${current.value.locale === 'zh' ? '中文' : '英文'})` : '编辑 SEO'
current.value
? `编辑 SEO — ${current.value.pageLabel}(${contentLocaleLabel(current.value.locale)})`
: '编辑 SEO'
)
const getList = async (queryForm: Record<string, unknown> = {}) => {
loading.value = true
try {
const res = await seoList({
locale: (queryForm.locale as '' | 'en' | 'zh') || undefined,
locale: (queryForm.locale as '' | ContentLocale) || undefined,
keyword: String(queryForm.keyword || '') || undefined,
})
if (res.data.code === 200) {