开屏设置 - 增加多语言翻译
This commit is contained in:
@@ -36,7 +36,46 @@
|
||||
<!-- 表格 -->
|
||||
<el-table :data="tableData" border style="width: 100%; margin-top: 25px">
|
||||
<el-table-column align="center" prop="id" label="资源位ID" />
|
||||
<el-table-column align="center" prop="name" label="活动名称" />
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-华语区">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'zh') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-英语区">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'en') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-阿语区">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'ar') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-土耳其区">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'tr') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-葡萄牙语区">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'pt') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-俄语">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'ru') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-西班牙语">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'es') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="活动名称-乌兹别克语">
|
||||
<template v-slot="scope">{{ getJsonField(scope.row.name, 'uz') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="partitionId" label="地区">
|
||||
<template v-slot="scope">
|
||||
<span>{{ getPartitionInfo(scope.row.partitionId) }}</span>
|
||||
@@ -147,20 +186,7 @@
|
||||
/>
|
||||
<!-- 编辑弹窗 -->
|
||||
<el-dialog v-model="editDialog" title="开屏配置" width="50%" center>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>活动名称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="resource.name"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请输入活动名称"
|
||||
></el-input>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px; margin-top: 70px">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
@@ -179,6 +205,70 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 活动名称-华语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-华语</span>
|
||||
<el-input v-model="resource.nickZh"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 活动名称-英语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-英语</span>
|
||||
<el-input v-model="resource.nickEn"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 活动名称-阿语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-阿语</span>
|
||||
<el-input v-model="resource.nickAr"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 活动名称-土耳其 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-土耳其</span>
|
||||
<el-input v-model="resource.nickTr"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 活动名称-葡萄牙语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-葡萄牙语</span>
|
||||
<el-input v-model="resource.nickPt"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 活动名称-俄语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-俄语</span>
|
||||
<el-input v-model="resource.nickRu"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 活动名称-西班牙语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-西班牙语</span>
|
||||
<el-input v-model="resource.nickEs"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 活动名称-乌兹别克语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">活动名称-乌兹别克语</span>
|
||||
<el-input v-model="resource.nickUz"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
@@ -419,6 +509,14 @@ export default {
|
||||
seqNo: 0,
|
||||
ruleValue: {},
|
||||
partitionId: null,
|
||||
nickZh: "",
|
||||
nickEn: "",
|
||||
nickAr: "",
|
||||
nickTr: "",
|
||||
nickPt: "",
|
||||
nickRu: "",
|
||||
nickEs: "",
|
||||
nickUz: "",
|
||||
},
|
||||
imageUrl: "",
|
||||
partitionInfos: [],
|
||||
@@ -521,6 +619,16 @@ export default {
|
||||
this.resource.endTime = null;
|
||||
this.resource.seqNo = 0;
|
||||
this.resource.ruleValue = {};
|
||||
|
||||
this.resource.nickZh = "";
|
||||
this.resource.nickEn = "";
|
||||
this.resource.nickAr = "";
|
||||
this.resource.nickTr = "";
|
||||
this.resource.nickPt = "";
|
||||
this.resource.nickRu = "";
|
||||
this.resource.nickEs = "";
|
||||
this.resource.nickUz = "";
|
||||
|
||||
for (let i = 0, len = this.rules.length; i < len; i++) {
|
||||
let rule = this.rules[i];
|
||||
this.resource.ruleValue[rule.ruleCode] = "";
|
||||
@@ -538,6 +646,16 @@ export default {
|
||||
this.resource.startTime = row.startTime;
|
||||
this.resource.endTime = row.endTime;
|
||||
this.resource.seqNo = row.seqNo;
|
||||
|
||||
this.resource.nickZh = JSON.parse(row.name).zh;
|
||||
this.resource.nickEn = JSON.parse(row.name).en;
|
||||
this.resource.nickAr = JSON.parse(row.name).ar;
|
||||
this.resource.nickTr = JSON.parse(row.name).tr;
|
||||
this.resource.nickPt = JSON.parse(row.name).pt;
|
||||
this.resource.nickRu = JSON.parse(row.name).ru;
|
||||
this.resource.nickEs = JSON.parse(row.name).es;
|
||||
this.resource.nickUz = JSON.parse(row.name).uz;
|
||||
|
||||
let ruleValue = row.ruleValue;
|
||||
for (let i = 0, len = this.rules.length; i < len; i++) {
|
||||
let ruleCode = this.rules[i].ruleCode;
|
||||
@@ -577,9 +695,19 @@ export default {
|
||||
if (now >= new Date(startTime) && now <= new Date(endTime)) {
|
||||
isEnabled = 1;
|
||||
}
|
||||
let resourceName = JSON.stringify({
|
||||
zh: this.resource.nickZh,
|
||||
en: this.resource.nickEn,
|
||||
ar: this.resource.nickAr,
|
||||
tr: this.resource.nickTr,
|
||||
pt: this.resource.nickPt,
|
||||
ru: this.resource.nickRu,
|
||||
es: this.resource.nickEs,
|
||||
uz: this.resource.nickUz,
|
||||
});
|
||||
saveResource({
|
||||
id: this.resource.id,
|
||||
name: this.resource.name,
|
||||
name: resourceName,
|
||||
icon: this.resource.icon,
|
||||
type: 2,
|
||||
skipType: this.resource.skipType,
|
||||
@@ -623,6 +751,17 @@ export default {
|
||||
}
|
||||
return partitions[0].desc;
|
||||
},
|
||||
// 解析json字段
|
||||
getJsonField (jsonStr, field) {
|
||||
try {
|
||||
if (!jsonStr) return '';
|
||||
const obj = JSON.parse(jsonStr);
|
||||
return obj?.[field] || '';
|
||||
} catch (e) {
|
||||
console.error('JSON 解析失败:', jsonStr);
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user