From 01be529ec41b99dd71d69aa3c154eae3c0ee0b01 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 28 Aug 2024 15:35:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=AD=97=E4=BD=93=E8=AE=BE=E7=BD=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/font/index.vue | 28 ++++++++++++++++++- .../data/dataset/form/CalcFieldEdit.vue | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/system/font/index.vue b/core/core-frontend/src/views/system/font/index.vue index a9846cf041..0016f3a82a 100644 --- a/core/core-frontend/src/views/system/font/index.vue +++ b/core/core-frontend/src/views/system/font/index.vue @@ -80,6 +80,11 @@ const setToDefault = item => { if (ele.id === '0' && ele.isDefault) { ele.isDefault = 0 } + + if (ele.id !== '0' && item.id !== ele.id && ele.isDefault) { + ele.isDefault = 0 + edit(ele) + } }) item.isDefault = 1 loading.value = true @@ -117,7 +122,28 @@ const getDefaultFont = () => { setDefaultFont(`${basePath}/typeface/download/${font?.id}`, font?.name) }) } +const uploadFilish = () => { + loading.value = true + list({}) + .then(res => { + fontList.value = [ + { + name: 'PingFang', + id: '0', + isBuiltin: true, + updateTime: new Date(), + fileName: '-', + isDefault: Number(!(res || []).some(ele => ele.isDefault)) + }, + ...(res || []) + ] + getDefaultFont() + }) + .finally(() => { + loading.value = false + }) +} const cancelDefault = item => { fontList.value.forEach(ele => { if (ele.id === '0') { @@ -196,7 +222,7 @@ onMounted(() => { - +