Merge pull request #13025 from ulleo/dev-v2

feat: 国际化
This commit is contained in:
ulleo 2024-10-30 17:37:06 +08:00 committed by GitHub
commit 1172f79a18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 178 additions and 59 deletions

View File

@ -103,12 +103,24 @@ export default {
}, },
commons: { commons: {
date: { date: {
select_date: 'Select Date',
start_date: 'Start Date',
end_date: 'End Date',
select_date_time: 'Select Date and Time',
start_date_time: 'Start Date and Time',
end_date_time: 'End Date and Time',
range_separator: 'to',
data_time_error: 'Start date cannot be after end date',
one_hour: 'One Hour',
one_day: 'One Day',
one_week: 'One Week',
one_month: 'One Month',
permanent: 'Permanent', permanent: 'Permanent',
one_year: 'One year', one_year: 'One Year',
six_months: 'Six months', six_months: 'Six Months',
three_months: 'Three months', three_months: 'Three Months',
of_range_1_59: 'Minutes out of range [1-59]', of_range_1_59: 'Minute out of range [1-59]',
of_range_1_23: 'Hours out of range [1-23]' of_range_1_23: 'Hour out of range [1-23]'
} }
}, },
system: { system: {
@ -386,7 +398,20 @@ export default {
cancel_favorites: 'Cancel favorites', cancel_favorites: 'Cancel favorites',
open_dataset: 'Open dataset', open_dataset: 'Open dataset',
administrator_for_authorization: administrator_for_authorization:
'There is no business menu permission, please contact the administrator for authorization' 'There is no business menu permission, please contact the administrator for authorization',
public_link_share: 'Public Link Sharing',
share_time_limit: 'Must be greater than the current time',
ticket_setting: 'Ticket Settings',
cannot_share_link:
'Global link sharing is disabled. Sharing function is temporarily unavailable. Please contact the administrator!',
open_link_hint: 'Once enabled, users can access via this link',
uuid_checker: 'Only supports 8-16 characters (alphanumeric). Please re-enter!',
error_password_hint: 'Password format is incorrect. Please refill!',
error_link_hint: 'Link format is incorrect. Please refill!',
password_null_hint: 'Password cannot be empty. Please re-enter!',
password_hint:
'Password must be a 4-10 character string containing numbers, letters, and special characters [!@#$%^&*()_+]',
max_ticket_count: 'Supports up to 5 Tickets creation'
}, },
data_set: { data_set: {
ten_wan: '100000', ten_wan: '100000',

View File

@ -150,7 +150,18 @@ export default {
new_page_preview: '新頁面預覽', new_page_preview: '新頁面預覽',
cancel_favorites: '取消收藏', cancel_favorites: '取消收藏',
open_dataset: '打開數據集', open_dataset: '打開數據集',
administrator_for_authorization: '沒有任何業務菜單權限請聯系管理員授權' administrator_for_authorization: '沒有任何業務菜單權限請聯系管理員授權',
public_link_share: '公共鏈接分享',
share_time_limit: '必須大于當前時間',
ticket_setting: 'Ticket 設置',
cannot_share_link: '已經開啟全局禁用分享分享功能暫不可用請聯系管理員',
open_link_hint: '開啟后用戶可以通過該鏈接訪問',
uuid_checker: '僅支持8-16位(字母數字)請重新輸入',
error_password_hint: '密碼格式錯誤請重新填寫',
error_link_hint: '鏈接格式錯誤請重新填寫',
password_null_hint: '密碼不能為空請重新輸入',
password_hint: '密碼必須是包含數字字母特殊字符[!@#$%^&*()_+]的4-10位字符串',
max_ticket_count: '最多支持創建5個Ticket'
}, },
data_set: { data_set: {
ten_wan: '10萬', ten_wan: '10萬',
@ -577,7 +588,7 @@ export default {
authentication_settings: '認證設置', authentication_settings: '認證設置',
be_turned_on: '測試連接有效后可開啟', be_turned_on: '測試連接有效后可開啟',
platform_information_first: '請先保存平台信息', platform_information_first: '請先保存平台信息',
for_example: '{"account":"uid","name":"cn","email":"mail"}', for_example: "如:{'{'}'account':'uid','name':'cn','email':'mail'{'}'}",
in_json_format: '請輸入json格式', in_json_format: '請輸入json格式',
ldap_settings: 'LDAP設置', ldap_settings: 'LDAP設置',
ldap_address: 'LDAP地址', ldap_address: 'LDAP地址',
@ -586,7 +597,7 @@ export default {
user_ou: '用戶OU', user_ou: '用戶OU',
separate_each_ou: 'OU使用|分割各OU', separate_each_ou: 'OU使用|分割各OU',
user_filter: '用戶過濾器', user_filter: '用戶過濾器',
such_as_uid: '過濾器 [可能的選項是cn或uid或sAMAccountName={0}, (uid={0})]', such_as_uid: "過濾器 [可能的選項是cn或uid或sAMAccountName={'{'}0{'}'}, 如:(uid={'{'}0{'}'})]",
ldap_attribute_mapping: 'LDAP屬性映射', ldap_attribute_mapping: 'LDAP屬性映射',
incorrect_please_re_enter_de: 'url格式錯誤請重新輸入', incorrect_please_re_enter_de: 'url格式錯誤請重新輸入',
oauth2_settings: 'OAUTH2設置', oauth2_settings: 'OAUTH2設置',
@ -598,11 +609,70 @@ export default {
client_key: '客戶端密鑰', client_key: '客戶端密鑰',
callback_address: '回調地址', callback_address: '回調地址',
field_mapping: '字段映射', field_mapping: '字段映射',
oauth2name: '例如{"account": "oauth2Account", "name": "oauth2Name", "email": "email"}', oauth2name:
"例如:{'{'}'account': 'oauth2Account', 'name': 'oauth2Name', 'email': 'email'{'}'}",
oidc_settings: 'OIDC設置', oidc_settings: 'OIDC設置',
test_mail_recipient: '僅用來作為測試郵件收件人', test_mail_recipient: '僅用來作為測試郵件收件人',
to_enable_ssl: '如果SMTP端口是 465 通常需要啟用SSL', to_enable_ssl: '如果SMTP端口是 465 通常需要啟用SSL',
to_enable_tsl: '如果SMTP端口是 587 通常需要啟用TSL' to_enable_tsl: '如果SMTP端口是 587 通常需要啟用TSL',
wrong_please_re_enter: '地址格式錯誤請重新輸入',
create_embedded_application: '創建嵌入式應用',
edit_embedded_application: '編輯嵌入式應用',
application_name: '應用名稱',
cross_domain_settings: '跨域設置',
embedded_management: '嵌入式管理',
to_5_applications: '最多支持創建5個應用',
update_app_secret: '確定更新APP Secret嗎',
operate_with_caution: '重置后現有的APP Secret將會失效請謹慎操作',
no_application: '暫無應用',
delete_this_application: '確定刪除此應用嗎',
platform_connection: '平台對接',
dingtalk_settings: '釘釘設置',
enabled: '已開啟',
close: '已關閉',
can_enable_it: '測試連接有效后可開啟',
access: '接入',
feishu_settings: '飛書設置',
international_feishu_settings: '國際飛書設置',
international_feishu: '國際飛書',
enterprise_wechat_settings: '企業微信設置',
enterprise_wechat: '企業微信',
plugin_management: '插件管理',
search_plugin_name: '搜索插件名稱',
local_installation: '本地安裝',
relevant_content_found: '沒有找到相關內容',
no_plugins_yet: '暫無插件',
installation_time: '安裝時間',
developer: '開發者',
update_the_plugin: '確認更新該插件嗎',
to_take_effect_update: '更新並重啟服務器之后才能生效',
uninstall_the_plugin: '確認卸載該插件嗎',
to_take_effect_de: '卸載並重啟服務器之后才能生效',
uninstall_successful: '卸載成功',
update_successful: '更新成功',
installation_successful: '安裝成功',
can_be_uploaded: '只能上傳jar文件',
to_change_it: '變量類型修改后變量值將清空確認要修改嗎',
add_variable: '添加變量',
edit_variable: '編輯變量',
variable_name: '變量名稱',
variable_type: '變量類型',
system_built_in_variable: '系統內置變量',
custom_variable: '自定義變量',
account: '賬戶',
delete_this_variable: '確定刪除該變量嗎',
this_variable_value: '確定刪除該變量值嗎',
variable_list: '變量列表',
add_variable_value: '添加變量值',
search_variable_value: '搜索變量值',
variable_value: '變量值',
set_variable_value: '設置變量值',
the_minimum_value: '請輸入最小值',
the_maximum_value: '請輸入最大值',
the_minimum_date: '請選擇最小日期',
the_maximum_date: '請選擇最大日期',
on_the_left_p: '請選擇左側變量',
edit_variable_value: '編輯變量值'
}, },
components: { components: {
dashboard_style: '儀表板風格', dashboard_style: '儀表板風格',
@ -2393,6 +2463,7 @@ export default {
end_date_time: '結束日期時間', end_date_time: '結束日期時間',
range_separator: '至', range_separator: '至',
data_time_error: '開始日期不能大于結束日期', data_time_error: '開始日期不能大于結束日期',
one_hour: '一小時',
one_day: '一天', one_day: '一天',
one_week: '一周', one_week: '一周',
one_month: '一個月', one_month: '一個月',

View File

@ -150,7 +150,18 @@ export default {
new_page_preview: '新页面预览', new_page_preview: '新页面预览',
cancel_favorites: '取消收藏', cancel_favorites: '取消收藏',
open_dataset: '打开数据集', open_dataset: '打开数据集',
administrator_for_authorization: '没有任何业务菜单权限请联系管理员授权' administrator_for_authorization: '没有任何业务菜单权限请联系管理员授权',
public_link_share: '公共链接分享',
share_time_limit: '必须大于当前时间',
ticket_setting: 'Ticket 设置',
cannot_share_link: '已经开启全局禁用分享分享功能暂不可用请联系管理员',
open_link_hint: '开启后用户可以通过该链接访问',
uuid_checker: '仅支持8-16位(字母数字)请重新输入',
error_password_hint: '密码格式错误请重新填写',
error_link_hint: '链接格式错误请重新填写',
password_null_hint: '密码不能为空请重新输入',
password_hint: '密码必须是包含数字字母特殊字符[!@#$%^&*()_+]的4-10位字符串',
max_ticket_count: '最多支持创建5个Ticket'
}, },
data_set: { data_set: {
ten_wan: '10万', ten_wan: '10万',
@ -2452,6 +2463,7 @@ export default {
end_date_time: '结束日期时间', end_date_time: '结束日期时间',
range_separator: '至', range_separator: '至',
data_time_error: '开始日期不能大于结束日期', data_time_error: '开始日期不能大于结束日期',
one_hour: '一小时',
one_day: '一天', one_day: '一天',
one_week: '一周', one_week: '一周',
one_month: '一个月', one_month: '一个月',

View File

@ -107,7 +107,7 @@ const getEmptyImg = (): string => {
const getEmptyDesc = (): string => { const getEmptyDesc = (): string => {
if (panelKeyword.value) { if (panelKeyword.value) {
return '没有找到相关内容' return t('work_branch.relevant_content_found')
} }
return '' return ''
@ -172,7 +172,7 @@ watch(
v-model="panelKeyword" v-model="panelKeyword"
clearable clearable
@change="triggerFilterPanel" @change="triggerFilterPanel"
placeholder="搜索关键词" :placeholder="t('work_branch.search_keyword')"
> >
<template #prefix> <template #prefix>
<el-icon> <el-icon>
@ -230,7 +230,7 @@ watch(
<el-table-column width="96" fixed="right" key="_operation" :label="t('common.operate')"> <el-table-column width="96" fixed="right" key="_operation" :label="t('common.operate')">
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" content="新页面预览" placement="top"> <el-tooltip effect="dark" :content="t('work_branch.new_page_preview')" placement="top">
<el-icon class="hover-icon hover-icon-in-table" @click="preview(scope.row.resourceId)"> <el-icon class="hover-icon hover-icon-in-table" @click="preview(scope.row.resourceId)">
<Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon> <Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon>
</el-icon> </el-icon>

View File

@ -24,7 +24,7 @@
:close-on-click-modal="true" :close-on-click-modal="true"
:append-to-body="true" :append-to-body="true"
:before-close="beforeClose" :before-close="beforeClose"
title="公共链接分享" :title="t('work_branch.public_link_share')"
width="480px" width="480px"
:show-close="false" :show-close="false"
> >
@ -46,7 +46,9 @@
{{ formatLinkBase() }} {{ formatLinkBase() }}
</template> </template>
</el-input> </el-input>
<el-button v-if="linkCustom" text @click="finishEditUuid">完成</el-button> <el-button v-if="linkCustom" text @click="finishEditUuid">{{
t('components.complete')
}}</el-button>
<el-button v-else @click="editUuid" size="default" plain> <el-button v-else @click="editUuid" size="default" plain>
<template #icon> <template #icon>
<icon name="icon_admin_outlined"><icon_admin_outlined class="svg-icon" /></icon> <icon name="icon_admin_outlined"><icon_admin_outlined class="svg-icon" /></icon>
@ -82,7 +84,7 @@
:disabled-date="disabledDate" :disabled-date="disabledDate"
value-format="x" value-format="x"
/> />
<span v-if="expError" class="exp-error">必须大于当前时间</span> <span v-if="expError" class="exp-error">{{ t('work_branch.share_time_limit') }}</span>
</div> </div>
</div> </div>
<div v-if="shareEnable" class="pwd-container"> <div v-if="shareEnable" class="pwd-container">
@ -145,7 +147,7 @@
</div> </div>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button secondary @click="openTicket">Ticket 设置</el-button> <el-button secondary @click="openTicket">{{ t('work_branch.ticket_setting') }}</el-button>
<el-button :disabled="!shareEnable || expError" type="primary" @click.stop="copyInfo"> <el-button :disabled="!shareEnable || expError" type="primary" @click.stop="copyInfo">
{{ t('visualization.copy_link') }} {{ t('visualization.copy_link') }}
</el-button> </el-button>
@ -205,7 +207,11 @@ const state = reactive({
const emits = defineEmits(['loaded']) const emits = defineEmits(['loaded'])
const shareTips = computed( const shareTips = computed(
() => () =>
`开启后,用户可以通过该链接访问${props.resourceType === 'dashboard' ? '仪表板' : '数据大屏'}` `${t('work_branch.open_link_hint')}${
props.resourceType === 'dashboard'
? t('work_branch.dashboard')
: t('work_branch.big_data_screen')
}`
) )
const shareDisable = computed(() => shareStore.getShareDisable) const shareDisable = computed(() => shareStore.getShareDisable)
const sharePeRequire = computed(() => shareStore.getSharePeRequire) const sharePeRequire = computed(() => shareStore.getSharePeRequire)
@ -221,13 +227,13 @@ const validateUuid = async () => {
const val = state.detailInfo.uuid const val = state.detailInfo.uuid
const className = 'link-uuid-error-msg' const className = 'link-uuid-error-msg'
if (!val) { if (!val) {
showPageError('不能为空!', linkUuidRef, className) showPageError(t('commons.cannot_be_null'), linkUuidRef, className)
return false return false
} }
const regex = /^[a-zA-Z0-9]{8,16}$/ const regex = /^[a-zA-Z0-9]{8,16}$/
const result = regex.test(val) const result = regex.test(val)
if (!result) { if (!result) {
showPageError('仅支持8-16位(字母数字),请重新输入!', linkUuidRef, className) showPageError(t('work_branch.uuid_checker'), linkUuidRef, className)
} else { } else {
const msg = await uuidValidateApi(val) const msg = await uuidValidateApi(val)
showPageError(msg, linkUuidRef, className) showPageError(msg, linkUuidRef, className)
@ -249,7 +255,7 @@ const finishEditUuid = async () => {
const copyPwd = async () => { const copyPwd = async () => {
if (shareEnable.value && passwdEnable.value) { if (shareEnable.value && passwdEnable.value) {
if (!state.detailInfo.autoPwd && existErrorMsg('link-pwd-error-msg')) { if (!state.detailInfo.autoPwd && existErrorMsg('link-pwd-error-msg')) {
ElMessage.warning('密码格式错误,请重新填写!') ElMessage.warning(t('work_branch.error_password_hint'))
return return
} }
try { try {
@ -266,7 +272,7 @@ const copyInfo = async () => {
if (shareEnable.value) { if (shareEnable.value) {
try { try {
if (existErrorMsg('link-uuid-error-msg')) { if (existErrorMsg('link-uuid-error-msg')) {
ElMessage.warning('链接格式错误,请重新填写!') ElMessage.warning(t('work_branch.error_link_hint'))
return return
} }
formatLinkAddr() formatLinkAddr()
@ -406,7 +412,7 @@ const validateExpRequire = () => {
showCheckboxError(null, expCheckbox) showCheckboxError(null, expCheckbox)
return true return true
} }
showCheckboxError('必填', expCheckbox) showCheckboxError(t('common.required'), expCheckbox)
return false return false
} }
@ -415,7 +421,7 @@ const validatePwdRequire = () => {
showCheckboxError(null, pwdCheckbox) showCheckboxError(null, pwdCheckbox)
return true return true
} }
showCheckboxError('必填', pwdCheckbox) showCheckboxError(t('common.required'), pwdCheckbox)
return false return false
} }
const validatePwdFormat = () => { const validatePwdFormat = () => {
@ -425,12 +431,12 @@ const validatePwdFormat = () => {
} }
const val = state.detailInfo.pwd const val = state.detailInfo.pwd
if (!val) { if (!val) {
showPageError('密码不能为空,请重新输入!', pwdRef) showPageError(t('work_branch.password_null_hint'), pwdRef)
return false return false
} }
const regex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d!@#$%^&*()_+]{4,10}$/ const regex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d!@#$%^&*()_+]{4,10}$/
if (!regex.test(val)) { if (!regex.test(val)) {
showPageError('密码必须是包含数字、字母、特殊字符[!@#$%^&*()_+]的4-10位字符串', pwdRef) showPageError(t('work_branch.password_hint'), pwdRef)
return false return false
} }
showPageError(null, pwdRef) showPageError(null, pwdRef)
@ -577,7 +583,7 @@ defineExpose({
onMounted(() => { onMounted(() => {
if (!props.inGrid && props.weight >= 7) { if (!props.inGrid && props.weight >= 7) {
const commandInfo = { const commandInfo = {
label: '分享', label: t('visualization.share'),
command: 'share', command: 'share',
svgName: dvShare svgName: dvShare
} }

View File

@ -11,7 +11,7 @@
</el-icon> </el-icon>
</span> </span>
</el-tooltip> </el-tooltip>
<span class="ticket-title">{{ 'Ticket ' + $t('commons.setting') }}</span> <span class="ticket-title">{{ 'Ticket ' + t('commons.setting') }}</span>
</div> </div>
<div class="ticket-model-end"> <div class="ticket-model-end">
<el-checkbox <el-checkbox
@ -63,11 +63,11 @@
<el-table-column prop="exp" :label="$t('visualization.over_time')" width="100"> <el-table-column prop="exp" :label="$t('visualization.over_time')" width="100">
<template v-slot:header> <template v-slot:header>
<div class="ticket-exp-head"> <div class="ticket-exp-head">
<span>{{ $t('visualization.over_time') }}</span> <span>{{ t('visualization.over_time') }}</span>
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
:content="$t('link_ticket.time_tips')" :content="t('link_ticket.time_tips')"
placement="top" placement="top"
> >
<Icon name="dv-info"><dvInfo class="svg-icon" /></Icon> <Icon name="dv-info"><dvInfo class="svg-icon" /></Icon>
@ -112,12 +112,7 @@
<el-table-column :label="$t('commons.operating')" width="80"> <el-table-column :label="$t('commons.operating')" width="80">
<template v-slot="scope"> <template v-slot="scope">
<div class="ticket-row"> <div class="ticket-row">
<el-tooltip <el-tooltip class="item" effect="dark" :content="t('commons.delete')" placement="top">
class="item"
effect="dark"
:content="$t('commons.delete')"
placement="top"
>
<el-button text @click.stop="deleteTicket(scope.row, scope.$index)"> <el-button text @click.stop="deleteTicket(scope.row, scope.$index)">
<template #icon> <template #icon>
<Icon name="icon_delete-trash_outlined" <Icon name="icon_delete-trash_outlined"
@ -220,7 +215,7 @@ const requireTicketChange = val => {
const createLimit = (count?: number) => { const createLimit = (count?: number) => {
const realCount = count ? count : state.tableData.length || 0 const realCount = count ? count : state.tableData.length || 0
if (realCount > 4) { if (realCount > 4) {
ElMessageBox.confirm('提示', { ElMessageBox.confirm(t('chart.tips'), {
confirmButtonType: 'primary', confirmButtonType: 'primary',
type: 'warning', type: 'warning',
confirmButtonText: t('common.roger_that'), confirmButtonText: t('common.roger_that'),
@ -228,7 +223,7 @@ const createLimit = (count?: number) => {
autofocus: false, autofocus: false,
showClose: false, showClose: false,
showCancelButton: false, showCancelButton: false,
tip: '最多支持创建5个Ticket' tip: t('work_branch.max_ticket_count')
}) })
return false return false
} }

View File

@ -28,7 +28,7 @@
class="share-container" class="share-container"
:class="{ 'hidden-link-container': showTicket }" :class="{ 'hidden-link-container': showTicket }"
> >
<div class="share-title share-padding">公共链接分享</div> <div class="share-title share-padding">{{ t('work_branch.public_link_share') }}</div>
<div class="open-share flex-align-center share-padding"> <div class="open-share flex-align-center share-padding">
<el-switch size="small" v-model="shareEnable" @change="enableSwitcher" /> <el-switch size="small" v-model="shareEnable" @change="enableSwitcher" />
{{ shareTips }} {{ shareTips }}
@ -46,7 +46,9 @@
{{ formatLinkBase() }} {{ formatLinkBase() }}
</template> </template>
</el-input> </el-input>
<el-button v-if="linkCustom" text @click.stop="finishEditUuid">完成</el-button> <el-button v-if="linkCustom" text @click.stop="finishEditUuid">{{
t('components.complete')
}}</el-button>
<el-button v-else @click.stop="editUuid" size="default" plain> <el-button v-else @click.stop="editUuid" size="default" plain>
<template #icon> <template #icon>
<icon name="icon_admin_outlined"><icon_admin_outlined class="svg-icon" /></icon> <icon name="icon_admin_outlined"><icon_admin_outlined class="svg-icon" /></icon>
@ -82,7 +84,7 @@
:disabled-date="disabledDate" :disabled-date="disabledDate"
value-format="x" value-format="x"
/> />
<span v-if="expError" class="exp-error">必须大于当前时间</span> <span v-if="expError" class="exp-error">{{ t('work_branch.share_time_limit') }}</span>
</div> </div>
</div> </div>
<div v-if="shareEnable" class="pwd-container share-padding"> <div v-if="shareEnable" class="pwd-container share-padding">
@ -135,16 +137,16 @@
<el-divider v-if="shareEnable" class="share-divider" /> <el-divider v-if="shareEnable" class="share-divider" />
<div v-if="shareEnable" class="share-foot share-padding"> <div v-if="shareEnable" class="share-foot share-padding">
<el-button secondary @click="openTicket">Ticket 设置</el-button> <el-button secondary @click="openTicket">{{ t('work_branch.ticket_setting') }}</el-button>
<el-button :disabled="!shareEnable || expError" type="primary" @click="copyInfo"> <el-button :disabled="!shareEnable || expError" type="primary" @click="copyInfo">
{{ t('visualization.copy_link') }} {{ t('visualization.copy_link') }}
</el-button> </el-button>
</div> </div>
</div> </div>
<div v-else class="share-container"> <div v-else class="share-container">
<div class="share-title share-padding">公共链接分享</div> <div class="share-title share-padding">{{ t('work_branch.public_link_share') }}</div>
<div class="open-share flex-align-center share-padding"> <div class="open-share flex-align-center share-padding">
<span>已经开启全局禁用分享分享功能暂不可用请联系管理员</span> <span>{{ t('work_branch.cannot_share_link') }}</span>
</div> </div>
</div> </div>
<div v-if="!shareDisable && shareEnable && showTicket" class="share-ticket-container"> <div v-if="!shareDisable && shareEnable && showTicket" class="share-ticket-container">
@ -242,7 +244,11 @@ const openPopover = () => {
} }
const shareTips = computed( const shareTips = computed(
() => () =>
`开启后,用户可以通过该链接访问${props.resourceType === 'dashboard' ? '仪表板' : '数据大屏'}` `${t('work_branch.open_link_hint')}${
props.resourceType === 'dashboard'
? t('work_branch.dashboard')
: t('work_branch.big_data_screen')
}`
) )
const shareDisable = computed(() => shareStore.getShareDisable) const shareDisable = computed(() => shareStore.getShareDisable)
const sharePeRequire = computed(() => shareStore.getSharePeRequire) const sharePeRequire = computed(() => shareStore.getSharePeRequire)
@ -251,7 +257,7 @@ const copyInfo = async () => {
if (shareEnable.value) { if (shareEnable.value) {
try { try {
if (existErrorMsg('link-uuid-error-msg')) { if (existErrorMsg('link-uuid-error-msg')) {
ElMessage.warning('链接格式错误,请重新填写!') ElMessage.warning(t('work_branch.error_link_hint'))
return return
} }
formatLinkAddr() formatLinkAddr()
@ -422,7 +428,7 @@ const validateExpRequire = () => {
showCheckboxError(null, expCheckbox) showCheckboxError(null, expCheckbox)
return true return true
} }
showCheckboxError('必填', expCheckbox) showCheckboxError(t('common.required'), expCheckbox)
return false return false
} }
@ -431,7 +437,7 @@ const validatePwdRequire = () => {
showCheckboxError(null, pwdCheckbox) showCheckboxError(null, pwdCheckbox)
return true return true
} }
showCheckboxError('必填', pwdCheckbox) showCheckboxError(t('common.required'), pwdCheckbox)
return false return false
} }
const validatePwdFormat = () => { const validatePwdFormat = () => {
@ -441,12 +447,12 @@ const validatePwdFormat = () => {
} }
const val = state.detailInfo.pwd const val = state.detailInfo.pwd
if (!val) { if (!val) {
showPageError('密码不能为空,请重新输入!', pwdRef) showPageError(t('work_branch.password_null_hint'), pwdRef)
return false return false
} }
const regex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d!@#$%^&*()_+]{4,10}$/ const regex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d!@#$%^&*()_+]{4,10}$/
if (!regex.test(val)) { if (!regex.test(val)) {
showPageError('密码必须是包含数字、字母、特殊字符[!@#$%^&*()_+]的4-10位字符串', pwdRef) showPageError(t('work_branch.password_hint'), pwdRef)
return false return false
} }
showPageError(null, pwdRef) showPageError(null, pwdRef)
@ -530,7 +536,7 @@ const autoEnableSwitcher = val => {
const copyPwd = async () => { const copyPwd = async () => {
if (shareEnable.value && passwdEnable.value) { if (shareEnable.value && passwdEnable.value) {
if (!state.detailInfo.autoPwd && existErrorMsg('link-pwd-error-msg')) { if (!state.detailInfo.autoPwd && existErrorMsg('link-pwd-error-msg')) {
ElMessage.warning('密码格式错误,请重新填写!') ElMessage.warning(t('work_branch.error_password_hint'))
return return
} }
try { try {
@ -555,13 +561,13 @@ const validateUuid = async () => {
const val = state.detailInfo.uuid const val = state.detailInfo.uuid
const className = 'link-uuid-error-msg' const className = 'link-uuid-error-msg'
if (!val) { if (!val) {
showPageError('不能为空!', linkUuidRef, className) showPageError(t('commons.cannot_be_null'), linkUuidRef, className)
return false return false
} }
const regex = /^[a-zA-Z0-9]{8,16}$/ const regex = /^[a-zA-Z0-9]{8,16}$/
const result = regex.test(val) const result = regex.test(val)
if (!result) { if (!result) {
showPageError('仅支持8-16位(字母数字),请重新输入!', linkUuidRef, className) showPageError(t('work_branch.uuid_checker'), linkUuidRef, className)
} else { } else {
const msg = await uuidValidateApi(val) const msg = await uuidValidateApi(val)
showPageError(msg, linkUuidRef, className) showPageError(msg, linkUuidRef, className)

View File

@ -1,3 +1,5 @@
import { useI18n } from '@/hooks/web/useI18n'
export interface ShareInfo { export interface ShareInfo {
id: string id: string
exp?: number exp?: number
@ -9,9 +11,11 @@ export interface ShareInfo {
export const SHARE_BASE = '/de-link/' export const SHARE_BASE = '/de-link/'
const { t } = useI18n()
export const shortcuts = [ export const shortcuts = [
{ {
text: '一小时', text: t('commons.date.one_hour'),
value: () => { value: () => {
const date = new Date() const date = new Date()
date.setTime(date.getTime() + 3600 * 1000) date.setTime(date.getTime() + 3600 * 1000)
@ -19,7 +23,7 @@ export const shortcuts = [
} }
}, },
{ {
text: '一天', text: t('commons.date.one_day'),
value: () => { value: () => {
const date = new Date() const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24) date.setTime(date.getTime() + 3600 * 1000 * 24)
@ -27,7 +31,7 @@ export const shortcuts = [
} }
}, },
{ {
text: '一周', text: t('commons.date.one_week'),
value: () => { value: () => {
const date = new Date() const date = new Date()
date.setTime(date.getTime() + 7 * 3600 * 1000 * 24) date.setTime(date.getTime() + 7 * 3600 * 1000 * 24)

View File

@ -11,7 +11,7 @@
:create-auth="createAuth" :create-auth="createAuth"
@closePreview="closePreview" @closePreview="closePreview"
@templateApply="templateApply" @templateApply="templateApply"
></market-preview-v2> />
<el-row v-if="previewModel === 'createPreview'" class="main-container"> <el-row v-if="previewModel === 'createPreview'" class="main-container">
<el-row class="market-head"> <el-row class="market-head">
<el-icon class="custom-back-icon hover-icon" @click="previewModel = 'full'" <el-icon class="custom-back-icon hover-icon" @click="previewModel = 'full'"