From b67084e67470bc67e3528e21c481f3bf0a35aea2 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Thu, 17 Oct 2024 17:56:18 +0800 Subject: [PATCH] 1 --- .../system/DashboardComponents/department.vue | 4 ++-- src/views/system/DashboardComponents/toDo.vue | 15 +++---------- src/views/system/components/BatchUser.vue | 22 +++++++++++++++---- .../system/components/ModuleBatchUsers.vue | 21 ++++++++++++++---- 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/views/system/DashboardComponents/department.vue b/src/views/system/DashboardComponents/department.vue index b7f84f7..5d6c56a 100644 --- a/src/views/system/DashboardComponents/department.vue +++ b/src/views/system/DashboardComponents/department.vue @@ -140,9 +140,9 @@ export default { let per = 0 if (m2 !== 0) { - per = ((m3 / m2) * 100).toFixed(2) + per = m2 === 0 ? ((m3 / m2) * 100) : 0 } else if (m1 !== 0) { - per = ((m3 / m1) * 100).toFixed(2) + per = m1 === 0 ? ((m3 / m1) * 100) : 0 } return Number(per) + '%' } diff --git a/src/views/system/DashboardComponents/toDo.vue b/src/views/system/DashboardComponents/toDo.vue index ac2ea89..e766e77 100644 --- a/src/views/system/DashboardComponents/toDo.vue +++ b/src/views/system/DashboardComponents/toDo.vue @@ -110,19 +110,10 @@ export default { }, { title: '内容', - key: 'data', + key: 'data.title', align: 'left', 'show-overflow-tooltip': true, - minWidth: 200, - formatter: (row, column, cellValue) => { - try { - const data = JSON.parse(cellValue) - return data.title - } catch (err) { - console.error(err) - return '' - } - } + minWidth: 200 } ] } @@ -202,7 +193,7 @@ export default { }, handle(row) { try { - const data = JSON.parse(row.data) + const data = row.data if (data.from === 'ht') { this.modalUrl = `/${data.from}/#/contract/contractList?auth_token=${window.encodeURIComponent(getToken())}&module_name=${data.from}&keyword=${(/\[(.*?)]/.exec(data.title) ? /\[(.*?)]/.exec(data.title)[1] : '')}` } else if (data.from === 'oa') { diff --git a/src/views/system/components/BatchUser.vue b/src/views/system/components/BatchUser.vue index 1e4f772..806ee47 100644 --- a/src/views/system/components/BatchUser.vue +++ b/src/views/system/components/BatchUser.vue @@ -11,9 +11,16 @@ @input="e => $emit('update:isShow',e)" >