From 0762fa28192cc07f8c8909c59833e46f23919abc Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 26 Aug 2024 15:05:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AD=97=E4=BD=93=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V2.10__ddl.sql | 13 +++++ core/core-frontend/src/api/font.ts | 39 +++++++++++++++ .../src/views/system/font/index.vue | 35 +++++++++++-- .../io/dataease/api/font/api/FontApi.java | 49 +++++++++++++++++++ .../dto/FontDto.java} | 6 ++- .../api/typeface/api/SysTypefaceApi.java | 40 --------------- 6 files changed, 136 insertions(+), 46 deletions(-) create mode 100644 core/core-frontend/src/api/font.ts create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/font/api/FontApi.java rename sdk/api/api-base/src/main/java/io/dataease/api/{typeface/dto/SysTypefaceDto.java => font/dto/FontDto.java} (85%) delete mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/typeface/api/SysTypefaceApi.java diff --git a/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql index 0ed36649c2..5f1d1d8455 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql @@ -70,3 +70,16 @@ alter table `core_chart_view` update visualization_outer_params_target_view_info tvi INNER JOIN core_chart_view ccv on tvi.target_view_id = ccv.id set tvi.target_ds_id = ccv.table_id + + +DROP TABLE IF EXISTS `core_font`; +CREATE TABLE `core_font` +( + `id` bigint NOT NULL COMMENT 'ID', + `name` varchar(255) NOT NULL COMMENT '字体名称', + `file_name` varchar(255) NOT NULL COMMENT '文件名称', + `file_trans_name` varchar(255) NOT NULL COMMENT '文件转换名称', + `is_default` tinyint(1) NOT NULL COMMENT '是否默认', + `is_BuiltIn` tinyint(1) NOT NULL COMMENT '是否内置', + PRIMARY KEY (`id`) +); diff --git a/core/core-frontend/src/api/font.ts b/core/core-frontend/src/api/font.ts new file mode 100644 index 0000000000..b47c556342 --- /dev/null +++ b/core/core-frontend/src/api/font.ts @@ -0,0 +1,39 @@ +import request from '@/config/axios' + +export interface Font { + id: string + name: string + fileName: string + isDefault: boolean + isBuiltin?: boolean +} + +export const list = (data = {}) => { + return request.post({ url: '/typeface/listFont', data }).then(res => { + return res?.data + }) +} + +export const create = (data = {}) => { + return request.post({ url: '/typeface/create', data }).then(res => { + return res?.data + }) +} + +export const edit = (data = {}) => { + return request.post({ url: '/typeface/edit', data }).then(res => { + return res?.data + }) +} + +export const changeDefault = (data = {}) => { + return request.post({ url: '/typeface/changeDefault', data }).then(res => { + return res?.data + }) +} + +export const deleteById = id => { + return request.post({ url: '/typeface/delete/' + id, data: {} }).then(res => { + return res?.data + }) +} diff --git a/core/core-frontend/src/views/system/font/index.vue b/core/core-frontend/src/views/system/font/index.vue index 9a2321fc65..e55dd41f84 100644 --- a/core/core-frontend/src/views/system/font/index.vue +++ b/core/core-frontend/src/views/system/font/index.vue @@ -1,12 +1,39 @@