From bbd5a681e2e2505d7c046f0b3ada99a8e3026558 Mon Sep 17 00:00:00 2001 From: xxm1995 Date: Mon, 20 Feb 2023 17:44:44 +0800 Subject: [PATCH 1/7] =?UTF-8?q?style=20=E6=96=87=E6=9C=AC=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/demo/notice/email/SimpleEmailSender.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/modules/demo/notice/email/SimpleEmailSender.vue b/src/views/modules/demo/notice/email/SimpleEmailSender.vue index c5e2695..81e89c4 100644 --- a/src/views/modules/demo/notice/email/SimpleEmailSender.vue +++ b/src/views/modules/demo/notice/email/SimpleEmailSender.vue @@ -9,8 +9,8 @@ - - + +
-- Gitee From 153156755709008f0d01c5a9fe9a9fbfae245bae Mon Sep 17 00:00:00 2001 From: xxm1995 Date: Fri, 10 Mar 2023 16:55:26 +0800 Subject: [PATCH 2/7] =?UTF-8?q?feat=20=E6=95=B0=E6=8D=AE=E6=BA=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/develop/dynamicDataSource.js | 117 +++++++++++ src/mixins/FormMixin.js | 1 - .../develop/dynamicsource/DataSourceList.vue | 78 +++++++ .../dynamicsource/DynamicDataSourceEdit.vue | 121 +++++++---- .../dynamicsource/DynamicDataSourceList.vue | 198 ++++++++++++------ 5 files changed, 404 insertions(+), 111 deletions(-) create mode 100644 src/views/modules/develop/dynamicsource/DataSourceList.vue diff --git a/src/api/develop/dynamicDataSource.js b/src/api/develop/dynamicDataSource.js index 3a3e008..8ecd9b6 100644 --- a/src/api/develop/dynamicDataSource.js +++ b/src/api/develop/dynamicDataSource.js @@ -64,3 +64,120 @@ export function del (id) { method: 'DELETE' }) } + +/** + * 测试连接 + */ +export const testConnection = (obj) => { + return axios({ + url: '/dynamic/source/testConnection', + data: obj, + method: 'POST' + }) +} + +/** + * 测试连接 + */ +export const testConnectionById = (id) => { + return axios({ + url: '/dynamic/source/testConnectionById', + params: { id }, + method: 'GET' + }) +} + +/** + * 根据id进行添加到连接池中 + */ +export const addDynamicDataSourceById = (id) => { + return axios({ + url: '/dynamic/source/addDynamicDataSourceById', + params: { id }, + method: 'POST' + }) +} + +/** + * 判断编码是否被使用 + */ +export const existsByCode = (code) => { + return axios({ + url: '/dynamic/source/existsByCode', + params: { code }, + method: 'GET' + }) +} + +/** + * 判断编码是否被使用 + */ +export const existsByCodeNotId = (code, id) => { + return axios({ + url: '/dynamic/source/existsByCodeNotId', + params: { code, id }, + method: 'GET' + }) +} +/** + * 判断是否已经添加到连接池中 + */ +export const existsByDataSourceKey = (code) => { + return axios({ + url: '/dynamic/source/existsByDataSourceKey', + params: { code }, + method: 'GET' + }) +} + +/** + * 查询当前数据源列表 + */ +export const findAllDataSource = () => { + return axios({ + url: '/dynamic/source/findAllDataSource', + method: 'GET' + }) +} + +/** + * 从数据源列表中删除指定数据源 + */ +export const removeDataSourceByKey = (key) => { + return axios({ + url: '/dynamic/source/removeDataSourceByKey', + params: { key }, + method: 'DELETE' + }) +} + +/** + * 数据类型列表 + */ +export const databaseTypes = [ + { value: 'mysql', label: 'MySQL' }, + { value: 'oracle', label: 'Oracle' }, + { value: 'mssql', label: 'SQLServer' }, +] + +/** + * 数据类型关联信息列表 + */ +export // 数据列表 +const databaseTypeMap = { + mysql: { + dbDriver: 'com.mysql.cj.jdbc.Driver', + dbUrl: + 'jdbc:mysql://127.0.0.1:3306/bootx?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai', + }, + oracle: { + dbDriver: 'oracle.jdbc.OracleDriver', + dbUrl: 'jdbc:oracle:thin:@127.0.0.1:1521:BOOTX', + }, + mssql: { + dbDriver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver', + dbUrl: 'jdbc:mysql://127.0.0.1:3306/bootx?characterEncoding=UTF-8&useUnicode=true&useSSL=false', + }, +} + + diff --git a/src/mixins/FormMixin.js b/src/mixins/FormMixin.js index e8553b4..65ac787 100644 --- a/src/mixins/FormMixin.js +++ b/src/mixins/FormMixin.js @@ -3,7 +3,6 @@ import { getDictItemsAsync, getDictItemsByNumber, getDictItemsByNumberAsync } from '@/components/Bootx/Dict/DictUtils' -import { findByParamKey } from '@/api/system/param' export const FormMixin = { data () { diff --git a/src/views/modules/develop/dynamicsource/DataSourceList.vue b/src/views/modules/develop/dynamicsource/DataSourceList.vue new file mode 100644 index 0000000..3163eb3 --- /dev/null +++ b/src/views/modules/develop/dynamicsource/DataSourceList.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/src/views/modules/develop/dynamicsource/DynamicDataSourceEdit.vue b/src/views/modules/develop/dynamicsource/DynamicDataSourceEdit.vue index 564242a..4b8e994 100644 --- a/src/views/modules/develop/dynamicsource/DynamicDataSourceEdit.vue +++ b/src/views/modules/develop/dynamicsource/DynamicDataSourceEdit.vue @@ -1,12 +1,11 @@