From 23faa2b61e7628952f518920404ce97932f51295 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Tue, 16 Apr 2024 10:44:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=BF=E9=97=B4=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/room/RoomtagAdminView.vue | 34 +++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/views/room/RoomtagAdminView.vue b/src/views/room/RoomtagAdminView.vue index b050fbb..06aa8c0 100644 --- a/src/views/room/RoomtagAdminView.vue +++ b/src/views/room/RoomtagAdminView.vue @@ -472,12 +472,22 @@ export default { success: function (json) { if (json) { $("#id").val(id); - var jsonName = JSON.parse(json.name); - $("#modal_name").val(jsonName.zh); - // 阿语名称 - $("#ar_modal_name").val(jsonName.ar); - // 英语名称 - $("#en_modal_name").val(jsonName.en); + let name = json.name; + if (name.startsWith('{') && name.endsWith('}')) { + var jsonName = JSON.parse(json.name); + $("#modal_name").val(jsonName.zh); + // 阿语名称 + $("#ar_modal_name").val(jsonName.ar); + // 英语名称 + $("#en_modal_name").val(jsonName.en); + } else { + $("#modal_name").val(name); + // 阿语名称 + $("#ar_modal_name").val(name); + // 英语名称 + $("#en_modal_name").val(name); + } + $("#modal_seq").val(json.seq); $("#modal_description").val(json.description); if (json.status == true) { @@ -538,10 +548,7 @@ export default { initPartition() { getPartitionInfoList().then(res => { let data = res.data; - buildSelectOption( - "#modal_partitionId", - null, - [{ + let array = [{ value: '', text: '全部', }].concat(data.map((v) => { @@ -549,7 +556,12 @@ export default { value: v.id, text: v.desc, }; - })) + })); + console.log(array); + buildSelectOption( + "#modal_partitionId", + null, + array ); }); },