From 64284b18db627033a70247ef8d060e761ec53026 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 25 Oct 2023 18:35:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 6148 bytes ui/src/api/dataset.ts | 30 ++++++ ui/src/api/team.ts | 6 +- ui/src/api/type/dataset.ts | 7 ++ ui/src/api/type/team.ts | 6 +- ui/src/components/app-avatar/index.vue | 20 ++++ ui/src/components/card-add/index.vue | 38 ++++++++ ui/src/components/card-box/index.vue | 74 ++++++++++++++ .../content-container/LayoutContent.vue | 4 +- ui/src/components/index.ts | 8 ++ .../components/top-bar/avatar/index.vue | 14 ++- ui/src/layout/main-layout/index.vue | 1 - ui/src/router/routes.ts | 12 +-- ui/src/styles/app.scss | 9 ++ ui/src/views/dataset/index.vue | 92 +++++++++++++++++- .../setting/component/CreateMemberDialog.vue | 10 +- .../setting/component/PermissionSetting.vue | 2 +- 17 files changed, 298 insertions(+), 35 deletions(-) create mode 100644 .DS_Store create mode 100644 ui/src/api/dataset.ts create mode 100644 ui/src/api/type/dataset.ts create mode 100644 ui/src/components/app-avatar/index.vue create mode 100644 ui/src/components/card-add/index.vue create mode 100644 ui/src/components/card-box/index.vue diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..90847363517040cd0e5644a2215e5f53658de7fd GIT binary patch literal 6148 zcmeHK%}T>S5Z<-5O({YS3OxqA7EEgu#7l_v1&ruHr6we3FwK@GHHT8jSzpK}@p+ut z-5i1eZz6UEcE8#A+0A^A{b7u8cNLBpGZ|wBG(?U{gP^(5wWEU(xtt?mSx{t)AQ3^s zM1RqQ-`-(!CRoTKR{#EwV3EXGZrh)Hr`6u=bd9djHy*raQFytZuQJzP-r?w4h$N_V zKe&mbVrK4Nh&1=(G+N4pIE*0V{x(iSQMh82hMCOul*8y5y_q>!uTN}yXpP2`&Cpt( zjX|FrpKdliD61NiAbNoUgcD=gv0@Z$`^Z2#mES@g;v9{o VLYxKdG98dE0+JBwh=E^V;0pzFOeFvS literal 0 HcmV?d00001 diff --git a/ui/src/api/dataset.ts b/ui/src/api/dataset.ts new file mode 100644 index 000000000..aaba9eb48 --- /dev/null +++ b/ui/src/api/dataset.ts @@ -0,0 +1,30 @@ +import { Result } from '@/request/Result' +import { get, post, del, put } from '@/request/index' +import type { datasetListRequest } from '@/api/type/dataset' + +const prefix = '/dataset' + +/** + * 获取分页数据集 + * @param 参数 { + "current_page": "string", + "page_size": "string", + "search_text": "string", + } + */ +const getDateset: (param: datasetListRequest) => Promise> = (param) => { + return get(`${prefix}`, param) +} + +/** + * 获取全部数据集 + * @param 参数 search_text + */ +const getAllDateset: (param?: String) => Promise> = (param) => { + return get(`${prefix}`, param && { search_text: param }) +} + +export default { + getDateset, + getAllDateset +} diff --git a/ui/src/api/team.ts b/ui/src/api/team.ts index b427f50d1..1e08b684b 100644 --- a/ui/src/api/team.ts +++ b/ui/src/api/team.ts @@ -1,6 +1,6 @@ import { Result } from '@/request/Result' import { get, post, del, put } from '@/request/index' -import type { TeamMember, TeamMemberRequest } from '@/api/type/team' +import type { TeamMember } from '@/api/type/team' // import type { Ref } from 'vue' const prefix = '/team/member' @@ -16,8 +16,8 @@ const getTeamMember: () => Promise> = () => { * 添加成员 * @param 参数 { "username_or_email": "string" } */ -const postCreatTeamMember: (body: TeamMemberRequest) => Promise> = (body) => { - return post(`${prefix}`, body) +const postCreatTeamMember: (data: String) => Promise> = (data) => { + return post(`${prefix}`, { username_or_email: data }) } /** diff --git a/ui/src/api/type/dataset.ts b/ui/src/api/type/dataset.ts new file mode 100644 index 000000000..f8247e1ac --- /dev/null +++ b/ui/src/api/type/dataset.ts @@ -0,0 +1,7 @@ +interface datasetListRequest { + current_page: number + page_size: number + search_text: string +} + +export type { datasetListRequest } diff --git a/ui/src/api/type/team.ts b/ui/src/api/type/team.ts index be1a4c45a..9e17a842a 100644 --- a/ui/src/api/type/team.ts +++ b/ui/src/api/type/team.ts @@ -10,8 +10,4 @@ interface TeamMember { user_id: string } -interface TeamMemberRequest { - username_or_email: string -} - -export type { TeamMember, TeamMemberRequest } +export type { TeamMember } diff --git a/ui/src/components/app-avatar/index.vue b/ui/src/components/app-avatar/index.vue new file mode 100644 index 000000000..cfee6ad60 --- /dev/null +++ b/ui/src/components/app-avatar/index.vue @@ -0,0 +1,20 @@ + + + diff --git a/ui/src/components/card-add/index.vue b/ui/src/components/card-add/index.vue new file mode 100644 index 000000000..c6f7673be --- /dev/null +++ b/ui/src/components/card-add/index.vue @@ -0,0 +1,38 @@ + + + diff --git a/ui/src/components/card-box/index.vue b/ui/src/components/card-box/index.vue new file mode 100644 index 000000000..e5fc5fb1f --- /dev/null +++ b/ui/src/components/card-box/index.vue @@ -0,0 +1,74 @@ + + + diff --git a/ui/src/components/content-container/LayoutContent.vue b/ui/src/components/content-container/LayoutContent.vue index e59f6675b..20db34851 100644 --- a/ui/src/components/content-container/LayoutContent.vue +++ b/ui/src/components/content-container/LayoutContent.vue @@ -6,7 +6,7 @@ -
+
@@ -25,7 +25,7 @@ defineProps({ \ No newline at end of file + diff --git a/ui/src/layout/main-layout/index.vue b/ui/src/layout/main-layout/index.vue index 5e766ba3a..9d3fc311d 100644 --- a/ui/src/layout/main-layout/index.vue +++ b/ui/src/layout/main-layout/index.vue @@ -20,6 +20,5 @@ import { Sidebar, AppMain } from '../components' } .view-container { width: 100%; - padding: var(--app-view-padding); } diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts index 637eb98f4..e7e9ab22b 100644 --- a/ui/src/router/routes.ts +++ b/ui/src/router/routes.ts @@ -11,12 +11,12 @@ export const routes: Array = [ component: () => import('@/layout/app-layout/index.vue'), redirect: '/setting', children: [ - { - path: '/first', - name: 'first', - meta: { icon: 'House', title: '首页' }, - component: () => import('@/views/first/index.vue') - }, + // { + // path: '/first', + // name: 'first', + // meta: { icon: 'House', title: '首页' }, + // component: () => import('@/views/first/index.vue') + // }, ...rolesRoutes ] }, diff --git a/ui/src/styles/app.scss b/ui/src/styles/app.scss index 8edee08bb..9e8793f50 100644 --- a/ui/src/styles/app.scss +++ b/ui/src/styles/app.scss @@ -136,6 +136,15 @@ ul { cursor: pointer; } +.ellipsis { + display: inline-block; + max-width: 100px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +// 内容部分 自适应高度 .main-calc-height { height: calc(100vh - 125px); } diff --git a/ui/src/views/dataset/index.vue b/ui/src/views/dataset/index.vue index fa1fd78b1..969477762 100644 --- a/ui/src/views/dataset/index.vue +++ b/ui/src/views/dataset/index.vue @@ -1,9 +1,95 @@ - \ No newline at end of file + diff --git a/ui/src/views/setting/component/CreateMemberDialog.vue b/ui/src/views/setting/component/CreateMemberDialog.vue index 4ccb896ef..539508cdc 100644 --- a/ui/src/views/setting/component/CreateMemberDialog.vue +++ b/ui/src/views/setting/component/CreateMemberDialog.vue @@ -81,12 +81,10 @@ const submitMember = async (formEl: FormInstance | undefined) => { await formEl.validate((valid, fields) => { if (valid) { loading.value = true - const obj: any = { - username_or_email: memberForm.value.users?.length - ? memberForm.value.users.toString() - : memberForm.value.user - } - TeamApi.postCreatTeamMember(obj).then(() => { + const submitValue: string = memberForm.value.users?.length + ? memberForm.value.users.toString() + : memberForm.value.user + TeamApi.postCreatTeamMember(submitValue).then(() => { MsgSuccess('提交成功') emit('refresh') dialogVisible.value = false diff --git a/ui/src/views/setting/component/PermissionSetting.vue b/ui/src/views/setting/component/PermissionSetting.vue index ed97ba50f..37b962cbe 100644 --- a/ui/src/views/setting/component/PermissionSetting.vue +++ b/ui/src/views/setting/component/PermissionSetting.vue @@ -47,7 +47,7 @@ const allChecked: any = ref({ [USE]: false }) -const tableHeight = ref(100) +const tableHeight = ref(0) watch( () => props.data,