From 6af861ac0971335a2b71d94a55ff40624626675d Mon Sep 17 00:00:00 2001 From: jacky Date: Thu, 18 Jul 2024 11:49:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BD=E5=A4=96=E9=99=A2?= =?UTF-8?q?=E5=A3=AB=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/content/academician/index.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/view/content/academician/index.vue b/src/view/content/academician/index.vue index bd49648..c1fc48e 100644 --- a/src/view/content/academician/index.vue +++ b/src/view/content/academician/index.vue @@ -125,6 +125,16 @@ watch( } ) +const formatKind = (kind) => { + if (kind == 1) { + return "院士" + } else if (kind == 2) { + return "研究员" + } else if (kind == 3) { + return "国外院士" + } +} + // 重置 const handleResetSearch = () => { initSearchInfo() @@ -187,7 +197,7 @@ const handleMultiDelete = () => { } // 删除 const handleRowDelete = (ID) => { - ElMessageBox.confirm('此操作将删除' + (route.params.kind == '1' ? '院士' : '研究员') + ', 是否继续?', '请确认', { + ElMessageBox.confirm('此操作将删除' + formatKind(route.params.kind) + ', 是否继续?', '请确认', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' @@ -210,12 +220,12 @@ const elEditRef = ref(null) const editTitle = ref('') // 添加 const handleAdd = () => { - editTitle.value = '添加' + (route.params.kind == '1' ? '院士' : '研究员') + editTitle.value = '添加' + formatKind(route.params.kind) elEditRef.value.openPage({ id: 0, kind: parseInt(route.params.kind) }) } // 修改 const handleRowEdit = async (ID) => { - editTitle.value = '修改' + (route.params.kind == '1' ? '院士' : '研究员') + '-ID:' + ID + editTitle.value = '修改' + formatKind(route.params.kind) + '-ID:' + ID elEditRef.value.openPage({ ID: ID, kind: parseInt(route.params.kind) }) } // 保存后 @@ -225,7 +235,7 @@ const handlerFormSave = () => { const selectArticleTitle = ref('') const handleSelProject = (row) => { - selectArticleTitle.value = '关联' + (route.params.kind == '1' ? '院士' : '研究员') + '项目' + '-ID:' + row.ID + selectArticleTitle.value = '关联' + formatKind(route.params.kind) + '项目' + '-ID:' + row.ID let articleIds = [] if (row.projects != '') { articleIds = JSON.parse(row.projects) @@ -234,7 +244,7 @@ const handleSelProject = (row) => { elSelectArticleRef.value.openPage(params, articleIds) } const handleSelLecture = (row) => { - selectArticleTitle.value = '关联' + (route.params.kind == '1' ? '院士' : '研究员') + '讲座' + '-ID:' + row.ID + selectArticleTitle.value = '关联' + formatKind(route.params.kind) + '讲座' + '-ID:' + row.ID let articleIds = [] if (row.lectures != '') { articleIds = JSON.parse(row.lectures)