From 42d49a308353a5ef01f43363b84e046cde347c09 Mon Sep 17 00:00:00 2001
From: easy <1358086367@qq.com>
Date: Fri, 17 Feb 2023 18:16:49 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/system/dataSource.ts | 11 +
.../DataSource/components/EditDialog.vue | 224 +++++++++++++
src/views/system/DataSource/index.vue | 304 ++++++++++++++++++
src/views/system/DataSource/typing.d.ts | 24 ++
.../components/EditPermissionDialog.vue | 2 +-
src/views/system/Department/device/index.vue | 2 +-
src/views/system/Department/typing.d.ts | 4 +-
src/views/system/Relationship/index.vue | 6 +-
8 files changed, 570 insertions(+), 7 deletions(-)
create mode 100644 src/api/system/dataSource.ts
create mode 100644 src/views/system/DataSource/components/EditDialog.vue
create mode 100644 src/views/system/DataSource/index.vue
create mode 100644 src/views/system/DataSource/typing.d.ts
diff --git a/src/api/system/dataSource.ts b/src/api/system/dataSource.ts
new file mode 100644
index 00000000..46a59cff
--- /dev/null
+++ b/src/api/system/dataSource.ts
@@ -0,0 +1,11 @@
+import server from '@/utils/request';
+
+
+// 获取数据源列表
+export const getDataSourceList_api = (data: object) => server.post(`/datasource/config/_query/`, data);
+
+// 获取数据库类型字典
+export const getDataTypeDict_api = () => server.get(`/datasource/config/types`);
+
+// 修改数据源状态
+export const changeStatus_api = (id:string, status:'_disable'|'_enable') => server.put(`/datasource/config/${id}/${status}`);
\ No newline at end of file
diff --git a/src/views/system/DataSource/components/EditDialog.vue b/src/views/system/DataSource/components/EditDialog.vue
new file mode 100644
index 00000000..de689045
--- /dev/null
+++ b/src/views/system/DataSource/components/EditDialog.vue
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/DataSource/index.vue b/src/views/system/DataSource/index.vue
new file mode 100644
index 00000000..0190f7e8
--- /dev/null
+++ b/src/views/system/DataSource/index.vue
@@ -0,0 +1,304 @@
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+ {{
+ (table.typeOptions.value.length &&
+ table.getTypeLabel(slotProps.typeId)) ||
+ ''
+ }}
+
+
+
+
+
+
+
+ router.push(
+ `/system/DataSource/Management?id=${slotProps.id}`,
+ )
+ "
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/DataSource/typing.d.ts b/src/views/system/DataSource/typing.d.ts
new file mode 100644
index 00000000..1ece8c43
--- /dev/null
+++ b/src/views/system/DataSource/typing.d.ts
@@ -0,0 +1,24 @@
+export type dictItemType = {
+ id: string,
+ name: string
+}
+export type optionItemType = {
+ label: string,
+ value: string
+}
+export type sourceItemType = {
+ id?: string,
+ name: string,
+ state: { text: string, value: "enabled" | 'disabled' },
+ typeId: string,
+ shareConfig:{
+ url:string,
+ adminUrl:string,
+ addresses:string,
+ username:string,
+ password:string,
+ virtualHost:string,
+ schema:string
+ }
+ description: string
+}
\ No newline at end of file
diff --git a/src/views/system/Department/components/EditPermissionDialog.vue b/src/views/system/Department/components/EditPermissionDialog.vue
index 3a32b6a2..42182b6f 100644
--- a/src/views/system/Department/components/EditPermissionDialog.vue
+++ b/src/views/system/Department/components/EditPermissionDialog.vue
@@ -20,7 +20,7 @@