From 6eb65ce53110a590bb78136071c1ba6c4e5f5e91 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 26 Sep 2024 13:15:16 +0800 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 888bbc83d6ebcc137d9e5339d8cb7a217d3eca48 Author: joylink_zhaoerwei Date: Thu Sep 26 13:08:07 2024 +0800 用户管理+绘制管理的userName commit 320c1e92ccf9b91165c781c7ca3e348fa0222bc8 Author: joylink_zhaoerwei Date: Wed Sep 25 14:54:46 2024 +0800 新的ISCS数据结构实现加载赞提 commit dede7f400f91cbec0d6b8caa18607b6fc5af2a8b Author: joylink_fanyuhong <18706759286@163.com> Date: Wed Sep 25 10:37:26 2024 +0800 绘图工具调整 commit 4adcfacc12e6427ff947e9de956c9ae5516dfe4e Author: joylink_zhaoerwei Date: Tue Sep 24 16:42:11 2024 +0800 增加更多筛选项 commit 5888422322c2982467ffc0cee1db46b22cdf924a Author: joylink_zhaoerwei Date: Tue Sep 24 14:22:31 2024 +0800 Squashed commit of the following: commit 27fb1ee4ea1c18ef8b8f54cb2321628d8903e0fe Author: joylink_fanyuhong <18706759286@163.com> Date: Tue Sep 24 14:05:41 2024 +0800 报错调整 commit 069615d05da535d01af0ef229069c9c0a673495d Author: joylink_fanyuhong <18706759286@163.com> Date: Tue Sep 24 14:04:30 2024 +0800 代码调整 commit 66c4ac33b34fbceafa0e835f648e9b809a08acf6 Merge: 107d8a5 b267859 Author: shengxuqiang Date: Tue Sep 24 12:09:11 2024 +0800 Merge pull request '修改打包目录配置' (#3) from develop into local-test Reviewed-on: https://gitea.joylink.club/joylink/rtss-simulation-app-client/pulls/3 commit 107d8a50f1170c548fa13d3482b3ac39bf8f8a79 Merge: 75797eb b01ee7c Author: shengxuqiang Date: Tue Sep 24 11:59:24 2024 +0800 Merge pull request '添加local-test环境打包配置' (#2) from develop into local-test Reviewed-on: https://gitea.joylink.club/joylink/rtss-simulation-app-client/pulls/2 commit 75797ebc404be4013ca1ff5655f7abb4840b5950 Merge: ff65d38 1a4ae38 Author: shengxuqiang Date: Tue Sep 24 11:52:28 2024 +0800 Merge pull request '添加local-test分支CICD配置' (#1) from develop into local-test Reviewed-on: https://gitea.joylink.club/joylink/rtss-simulation-app-client/pulls/1 commit 4f7ba40f3ea4106adf3e6544ca311597f76ef077 Author: joylink_zhaoerwei Date: Tue Sep 24 13:21:29 2024 +0800 目录调整 --- src/api/DraftApi.ts | 28 +- src/api/PublishApi.ts | 6 +- src/api/UserApi.ts | 83 ++++ src/components/common/DraggableDialog.vue | 10 +- src/drawApp/iscsApp.ts | 129 +++++- src/layouts/IscsDrawLayout.vue | 68 ++- src/layouts/MainLayout.vue | 7 +- src/pages/IscsDraftManage.vue | 70 +++- src/pages/IscsPublishManage.vue | 62 ++- src/pages/UserManage.vue | 200 +++++++++ src/protos/iscs_graphic_data.ts | 483 +++++++++++++++++----- src/router/routes.ts | 29 +- src/stores/auth-store.ts | 2 +- src/stores/draw-store.ts | 16 +- 14 files changed, 999 insertions(+), 194 deletions(-) create mode 100644 src/api/UserApi.ts create mode 100644 src/pages/UserManage.vue diff --git a/src/api/DraftApi.ts b/src/api/DraftApi.ts index 29cb8d1..ce3f216 100644 --- a/src/api/DraftApi.ts +++ b/src/api/DraftApi.ts @@ -21,6 +21,14 @@ export const iscsStyleOption = [ }, ]; +export const searchTscsStyleOption = [ + { + label: '全部', + value: IscsStyle.UNKNOWN, + }, + ...iscsStyleOption, +]; + export interface DraftItem { id: number; name: string; @@ -33,8 +41,11 @@ export interface DraftItem { createdAt: string; updatedAt: string; defaultReleaseDataName: string; + userName: string; +} +export interface IscsDataOptions { + style: IscsStyle; } - export interface PagingQueryParams { paging: { page: number; @@ -42,9 +53,10 @@ export interface PagingQueryParams { }; query: { dataType: DraftDataType; - userId?: number; + options?: IscsDataOptions; name?: string; isShared?: boolean; + userId?: number; }; } export interface DraftIscsDataDto { @@ -52,9 +64,6 @@ export interface DraftIscsDataDto { options: IscsDataOptions; } -export interface IscsDataOptions { - style: IscsStyle; -} export async function draftPageQuery( params: PagingQueryParams ): Promise> { @@ -63,7 +72,7 @@ export async function draftPageQuery( userDraftIscsDataPaging(paging: $paging, query: $query) { total items { - draftData {id name dataType userId defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName} + draftData {id name dataType userName defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName} options {style} } } @@ -84,7 +93,7 @@ export async function sharedDraftPageQuery( sharedDraftIscsDataPaging(paging: $paging, query: $query) { total items { - draftData {id name dataType userId defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName} + draftData {id name dataType userName defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName} options {style} } } @@ -208,10 +217,7 @@ export function saveDraft(variables: { id: number; data: string }) { * @param variables * @returns */ -export async function saveAsDraft(variables: { - id: number; - name: string; -}) { +export async function saveAsDraft(variables: { id: number; name: string }) { const mutation = ` mutation saveAsNewDraftData($id: Int,$name: String) { saveAsNewDraftData(id: $id,name: $name){ diff --git a/src/api/PublishApi.ts b/src/api/PublishApi.ts index fe4d46a..3e0ff64 100644 --- a/src/api/PublishApi.ts +++ b/src/api/PublishApi.ts @@ -14,6 +14,7 @@ export interface PublishItem { createdAt: string; updatedAt: string; description: string; + userName: string; } interface PagingQueryParams { @@ -26,6 +27,7 @@ interface PagingQueryParams { userId?: number; name?: string; isPublished?: boolean; + options?: IscsDataOptions; }; } export interface PublishIscsDataDto { @@ -110,7 +112,7 @@ export async function publishPageQuery( releaseIscsDataPaging(page: $page, query: $query) { total items { - releaseData {id name dataType usedVersionId userId isPublished createdAt updatedAt description } + releaseData {id name dataType usedVersionId userName isPublished createdAt updatedAt description } options {style} } } @@ -162,7 +164,7 @@ export async function getPublishHistoryById(variables: { releaseDataVersionPaging(dataId: $dataId, page: $page) { total items { - id releaseDataId description userId createdAt + id releaseDataId description userName createdAt } } } diff --git a/src/api/UserApi.ts b/src/api/UserApi.ts new file mode 100644 index 0000000..8efedb2 --- /dev/null +++ b/src/api/UserApi.ts @@ -0,0 +1,83 @@ +import { api } from 'src/boot/axios'; +import { PageDto } from './ApiCommon'; + +export interface User { + id: string; + name: string; + mobile: string; + email: string; + roles: []; + createdAt: string; + updatedAt: string; +} + +export interface PagingQueryParams { + page: { + page: number; + itemsPerPage: number; + }; + query: { + id?: string; + name?: string; + mobile?: string; + email?: string; + roles?: []; + }; +} + +/** + * 分页查询用户信息 + * @param params + * @returns + */ +export async function userPageQuery( + params: PagingQueryParams +): Promise> { + const query = ` + query userPaging($page: PageQueryDto, $query: UserQueryDto) { + userPaging(page: $page, query: $query) { + total + items { + id name mobile email roles createdAt updatedAt + } + } + } +`; + const response = await api.post('', { + query, + variables: params, + }); + return response.data.data.userPaging; +} + +/** + * 获取获取用户信息 + */ +export async function getLoginUserInfo() { + const query = ` + query loginUserInfo { + loginUserInfo{ + id + } + } +`; + const response = await api.post('', { + query, + }); + return response.data.data; +} + +/** + * 同步用户 + */ +export async function syncUsersInfo() { + const mutation = ` + mutation syncUser { + syncUser + } +`; + const response = await api.post('', { + query: mutation, + }); + return response.data.data; +} diff --git a/src/components/common/DraggableDialog.vue b/src/components/common/DraggableDialog.vue index b4a458a..69d7545 100644 --- a/src/components/common/DraggableDialog.vue +++ b/src/components/common/DraggableDialog.vue @@ -84,7 +84,7 @@ diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 1f778e8..937e408 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -126,12 +126,17 @@ import SysMenu from 'src/components/SysMenu.vue'; import { useRoute } from 'vue-router'; import { clearJwtToken, saveJwtToken } from 'src/configs/TokenManage'; import { Dialog } from 'quasar'; +import { getLoginUserInfo } from 'src/api/UserApi'; +import { useAuthStore } from 'src/stores/auth-store'; const route = useRoute(); +const authStore = useAuthStore(); -onMounted(() => { +onMounted(async () => { if (route.params.token) { saveJwtToken(route.params.token as string); + const res = await getLoginUserInfo(); + authStore.setUserId(res.loginUserInfo.id); } }); diff --git a/src/pages/IscsDraftManage.vue b/src/pages/IscsDraftManage.vue index 8be2fc9..4db1a1c 100644 --- a/src/pages/IscsDraftManage.vue +++ b/src/pages/IscsDraftManage.vue @@ -15,19 +15,35 @@ @request="onRequest" >