修复话题多语言问题
This commit is contained in:
@@ -86,15 +86,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_name" class="col-sm-3 control-label">阿语标题:</label>
|
||||
<label for="ar_modal_name" class="col-sm-3 control-label">阿语标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required,maxSize[7]]" name="name" id="ar_modal_name" placeholder="请输入内容,限定7个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_name" class="col-sm-3 control-label">印语标题:</label>
|
||||
<label for="en_modal_name" class="col-sm-3 control-label">英语标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required,maxSize[7]]" name="name" id="in_modal_name" placeholder="请输入内容,限定7个字符内">
|
||||
<input type="text" class="form-control validate[required,maxSize[7]]" name="name" id="en_modal_name" placeholder="请输入内容,限定7个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -408,9 +408,36 @@ export default {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
let name = i.name;
|
||||
if (name.startsWith('{') && name.endsWith('}')) {
|
||||
i.name = JSON.parse(i.name);
|
||||
} else {
|
||||
i.name = {
|
||||
zh: i.name,
|
||||
ar: i.name,
|
||||
en: i.name,
|
||||
};
|
||||
}
|
||||
let description = i.description;
|
||||
if (description.startsWith('{') && description.endsWith('}')) {
|
||||
i.description = JSON.parse(i.description);
|
||||
} else {
|
||||
i.description = {
|
||||
zh: i.description,
|
||||
ar: i.description,
|
||||
en: i.description,
|
||||
};
|
||||
}
|
||||
let notice = i.notice;
|
||||
if (notice.startsWith('{') && notice.endsWith('}')) {
|
||||
i.notice = JSON.parse(i.notice);
|
||||
} else {
|
||||
i.notice = {
|
||||
zh: i.notice,
|
||||
ar: i.notice,
|
||||
en: i.notice,
|
||||
};
|
||||
}
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
@@ -495,19 +522,38 @@ export default {
|
||||
$('#modal_endTime').val(new Date(data.endTime).format('yyyy-MM-dd hh:mm:ss'));
|
||||
}
|
||||
}
|
||||
let name = data.name;
|
||||
if (name.startsWith('{') && name.endsWith('}')) {
|
||||
var jsonName = JSON.parse(data.name);
|
||||
$("#modal_name").val(jsonName.zh);
|
||||
// 阿语名称
|
||||
$("#ar_modal_name").val(jsonName.ar);
|
||||
// 印语名称
|
||||
$("#in_modal_name").val(jsonName.in);
|
||||
// 英语名称
|
||||
$("#en_modal_name").val(jsonName.en);
|
||||
} else {
|
||||
$("#modal_name").val(name);
|
||||
// 阿语名称
|
||||
$("#ar_modal_name").val(name);
|
||||
// 英语名称
|
||||
$("#en_modal_name").val(name);
|
||||
}
|
||||
let description = data.description;
|
||||
if (description.startsWith('{') && description.endsWith('}')) {
|
||||
var jsonDescription = JSON.parse(data.description);
|
||||
$("#modal_description").val(jsonDescription.zh);
|
||||
// 阿语描述
|
||||
$("#ar_modal_description").val(jsonDescription.ar);
|
||||
// 英语描述
|
||||
$("#en_modal_description").val(jsonDescription.en);
|
||||
$('#modal_notice').val(data.notice);
|
||||
} else {
|
||||
$("#modal_description").val(description);
|
||||
// 阿语描述
|
||||
$("#ar_modal_description").val(description);
|
||||
// 英语描述
|
||||
$("#en_modal_description").val(description);
|
||||
}
|
||||
let notice = data.notice;
|
||||
if (notice.startsWith('{') && notice.endsWith('}')) {
|
||||
var jsonNotice = JSON.parse(data.notice);
|
||||
console.log(jsonNotice)
|
||||
$("#modal_notice").val(jsonNotice.zh);
|
||||
@@ -515,6 +561,14 @@ export default {
|
||||
$("#ar_modal_notice").val(jsonNotice.ar);
|
||||
// 印语名称
|
||||
$("#en_modal_notice").val(jsonNotice.en);
|
||||
} else {
|
||||
$("#modal_notice").val(notice);
|
||||
// 阿语名称
|
||||
$("#ar_modal_notice").val(notice);
|
||||
// 印语名称
|
||||
$("#en_modal_notice").val(notice);
|
||||
}
|
||||
|
||||
//分类
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
|
Reference in New Issue
Block a user