From 5d3199cb4ae45aa12faf50d57329bd72915cc65a Mon Sep 17 00:00:00 2001 From: v_yutyi Date: Tue, 14 Nov 2023 16:40:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A4=E8=AF=81=E6=BA=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8=20&=20=E6=9C=AC=E5=9C=B0=E8=B4=A6=E5=AF=86=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/MainBreadcrumbsDetails.vue | 9 +- src/pages/src/http/authSourceFiles.ts | 24 + src/pages/src/http/types/authSourceFiles.ts | 15 + src/pages/src/images/wecom.svg | 1 + src/pages/src/router/index.ts | 39 +- src/pages/src/views/Header.vue | 2 +- src/pages/src/views/auth-source/List.vue | 337 +++++++++++ .../src/views/auth-source/ViewDetails.vue | 340 ++++++++++++ .../src/views/auth-source/edit-data/index.vue | 17 + src/pages/src/views/auth-source/index.vue | 271 +-------- .../src/views/auth-source/new-data/Local.vue | 495 +++++++++++++++++ .../views/auth-source/new-data/NewConfig.vue | 253 --------- .../src/views/auth-source/new-data/WeCom.vue | 522 ++++++++++++++++++ .../src/views/auth-source/new-data/config.vue | 197 +++++++ .../src/views/auth-source/new-data/index.vue | 98 ++++ .../views/data-source/local-details/index.vue | 6 +- .../src/views/data-source/new-data/index.vue | 6 +- 17 files changed, 2095 insertions(+), 537 deletions(-) create mode 100644 src/pages/src/http/authSourceFiles.ts create mode 100644 src/pages/src/http/types/authSourceFiles.ts create mode 100644 src/pages/src/images/wecom.svg create mode 100644 src/pages/src/views/auth-source/List.vue create mode 100644 src/pages/src/views/auth-source/ViewDetails.vue create mode 100644 src/pages/src/views/auth-source/edit-data/index.vue create mode 100644 src/pages/src/views/auth-source/new-data/Local.vue delete mode 100644 src/pages/src/views/auth-source/new-data/NewConfig.vue create mode 100644 src/pages/src/views/auth-source/new-data/WeCom.vue create mode 100644 src/pages/src/views/auth-source/new-data/config.vue create mode 100644 src/pages/src/views/auth-source/new-data/index.vue diff --git a/src/pages/src/components/layouts/MainBreadcrumbsDetails.vue b/src/pages/src/components/layouts/MainBreadcrumbsDetails.vue index 029af7230..077b0714a 100644 --- a/src/pages/src/components/layouts/MainBreadcrumbsDetails.vue +++ b/src/pages/src/components/layouts/MainBreadcrumbsDetails.vue @@ -21,8 +21,8 @@ diff --git a/src/pages/src/http/authSourceFiles.ts b/src/pages/src/http/authSourceFiles.ts new file mode 100644 index 000000000..ccef32e9b --- /dev/null +++ b/src/pages/src/http/authSourceFiles.ts @@ -0,0 +1,24 @@ +import http from './fetch'; +import type { + NewIdpsParams, +} from './types/authSourceFiles'; + +/** + * 认证源列表 + */ +export const getIdps = (keyword: string) => http.get(`/api/v1/web/idps/?keyword=${keyword}`); + +/** + * 认证源插件列表 + */ +export const getIdpsPlugins = () => http.get('/api/v1/web/idps/plugins/'); + +/** + * 新建认证源 + */ +export const postIdps = (params: NewIdpsParams) => http.post('/api/v1/web/idps/plugins/', params); + +/** + * 认证源详情 + */ +export const getIdpsDetails = (id: string) => http.get(`/api/v1/web/idps/${id}/`); diff --git a/src/pages/src/http/types/authSourceFiles.ts b/src/pages/src/http/types/authSourceFiles.ts new file mode 100644 index 000000000..8a8e490f0 --- /dev/null +++ b/src/pages/src/http/types/authSourceFiles.ts @@ -0,0 +1,15 @@ +/** + * 新建认证源参数 + */ +export interface NewIdpsParams { + name: string, + plugin_id: string, + plugin_config: {}, + data_source_match_rules?: { + data_source_id: number, + field_compare_rules: { + source_field: string, + target_field: string, + }[], + }[], +} diff --git a/src/pages/src/images/wecom.svg b/src/pages/src/images/wecom.svg new file mode 100644 index 000000000..02a95b6d3 --- /dev/null +++ b/src/pages/src/images/wecom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/pages/src/router/index.ts b/src/pages/src/router/index.ts index f9871508e..19d4c0e00 100644 --- a/src/pages/src/router/index.ts +++ b/src/pages/src/router/index.ts @@ -118,15 +118,40 @@ export default createRouter({ { path: '/auth-source', name: 'authSource', - component: () => import('@/views/auth-source/index.vue'), - }, - { - path: '/auth-source/new', - name: 'newAuthSource', meta: { - navName: '新建认证源', + navName: '认证源管理', }, - component: () => import('@/views/auth-source/new-data/NewConfig.vue'), + component: () => import('@/views/auth-source/index.vue'), + children: [ + { + path: '', + name: 'authSourceList', + meta: { + routeParentName: 'authSource', + navName: '认证源管理', + }, + component: () => import('@/views/auth-source/List.vue'), + }, + { + path: 'new', + name: 'newAuthSource', + meta: { + routeParentName: 'authSource', + navName: '新建认证源', + }, + component: () => import('@/views/auth-source/new-data/index.vue'), + }, + { + path: 'edit/:id', + name: 'editAuthSource', + meta: { + routeParentName: 'authSource', + navName: '编辑本地认证源', + showBack: true, + }, + component: () => import('@/views/auth-source/edit-data/index.vue'), + }, + ], }, { path: '/audit', diff --git a/src/pages/src/views/Header.vue b/src/pages/src/views/Header.vue index 76725a7d6..c3eb60d16 100644 --- a/src/pages/src/views/Header.vue +++ b/src/pages/src/views/Header.vue @@ -114,7 +114,7 @@ const userInfo = computed(() => { const baseNav = [ { name: '组织架构', path: 'organization' }, { name: '数据源管理', path: 'dataSource' }, - { name: '认证源管理', path: 'authSource' }, + { name: '认证源管理', path: 'authSourceList' }, ]; if (role === 'super_manager') { headerNav.value = [...baseNav, { name: '租户管理', path: 'tenant' }, { name: '设置', path: 'setting' }]; diff --git a/src/pages/src/views/auth-source/List.vue b/src/pages/src/views/auth-source/List.vue new file mode 100644 index 000000000..f0e475ac1 --- /dev/null +++ b/src/pages/src/views/auth-source/List.vue @@ -0,0 +1,337 @@ + + + + + diff --git a/src/pages/src/views/auth-source/ViewDetails.vue b/src/pages/src/views/auth-source/ViewDetails.vue new file mode 100644 index 000000000..f5577d955 --- /dev/null +++ b/src/pages/src/views/auth-source/ViewDetails.vue @@ -0,0 +1,340 @@ + + + + + diff --git a/src/pages/src/views/auth-source/edit-data/index.vue b/src/pages/src/views/auth-source/edit-data/index.vue new file mode 100644 index 000000000..375b7802c --- /dev/null +++ b/src/pages/src/views/auth-source/edit-data/index.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/src/pages/src/views/auth-source/index.vue b/src/pages/src/views/auth-source/index.vue index f532b1ecf..98393de41 100644 --- a/src/pages/src/views/auth-source/index.vue +++ b/src/pages/src/views/auth-source/index.vue @@ -1,278 +1,9 @@ diff --git a/src/pages/src/views/auth-source/new-data/Local.vue b/src/pages/src/views/auth-source/new-data/Local.vue new file mode 100644 index 000000000..e63202243 --- /dev/null +++ b/src/pages/src/views/auth-source/new-data/Local.vue @@ -0,0 +1,495 @@ + + + + + diff --git a/src/pages/src/views/auth-source/new-data/NewConfig.vue b/src/pages/src/views/auth-source/new-data/NewConfig.vue deleted file mode 100644 index 34d6ccb54..000000000 --- a/src/pages/src/views/auth-source/new-data/NewConfig.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/new-data/WeCom.vue b/src/pages/src/views/auth-source/new-data/WeCom.vue new file mode 100644 index 000000000..a0e63a61e --- /dev/null +++ b/src/pages/src/views/auth-source/new-data/WeCom.vue @@ -0,0 +1,522 @@ + + + + + diff --git a/src/pages/src/views/auth-source/new-data/config.vue b/src/pages/src/views/auth-source/new-data/config.vue new file mode 100644 index 000000000..f2dd4ec24 --- /dev/null +++ b/src/pages/src/views/auth-source/new-data/config.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/pages/src/views/auth-source/new-data/index.vue b/src/pages/src/views/auth-source/new-data/index.vue new file mode 100644 index 000000000..eb6ea5753 --- /dev/null +++ b/src/pages/src/views/auth-source/new-data/index.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/src/pages/src/views/data-source/local-details/index.vue b/src/pages/src/views/data-source/local-details/index.vue index cce54d76a..67fcf762c 100644 --- a/src/pages/src/views/data-source/local-details/index.vue +++ b/src/pages/src/views/data-source/local-details/index.vue @@ -1,6 +1,6 @@